|
import os |
|
from mistralai.client import MistralClient |
|
from mistralai.models.chat_completion import ChatMessage |
|
|
|
|
|
os.environ["MISTRAL_API_KEY"] = "API_KEY" |
|
api_key = os.environ.get("MISTRAL_API_KEY") |
|
if not api_key: |
|
raise ValueError("MISTRAL_API_KEY environment variable not set") |
|
|
|
model = "mistral-tiny" |
|
|
|
client = MistralClient(api_key=api_key) |
|
|
|
input_var = "Exam data Analysis" |
|
|
|
messages = [ |
|
ChatMessage(role="user", content=f"Generate 10 specific, industry relevant goals for {input_var} using Python and Pandas. Each goal should include a brief name and a one-sentence description of the task or skill. Focus on practical applications in educational assessment, covering areas such as data processing, statistical analysis, visualization, and advanced techniques") |
|
] |
|
|
|
|
|
response = client.chat(model=model, messages=messages) |
|
content = response.choices[0].message.content |
|
|
|
|
|
print(content) |
|
|