-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathmistral_example.py
More file actions
30 lines (23 loc) · 766 Bytes
/
mistral_example.py
File metadata and controls
30 lines (23 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""
Basic example of using Mistral with PraisonAI
"""
from praisonaiagents import Agent
# Initialize Agent with Mistral
agent = Agent(
instructions="You are a helpful assistant",
llm="mistral/mistral-large-latest",
)
# Example conversation
response = agent.start("Why sky is Blue?")
# Example with language translation
translation_task = """
Translate the following text to French and explain any cultural nuances:
"The early bird catches the worm, but the second mouse gets the cheese."
"""
response = agent.start(translation_task)
# Example with creative content generation
creative_task = """
Write a haiku about artificial intelligence and its impact on society.
Then explain the symbolism in your haiku.
"""
response = agent.start(creative_task)