Skip to content

Commit 27972b6

Browse files
committed
2 parents 90c4f12 + ca211bc commit 27972b6

File tree

65 files changed

+580
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+580
-14
lines changed
Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
import asyncio
22
from praisonaiagents import Agent
33

4-
async def main():
5-
agent = Agent(
6-
instructions="You are a helpful assistant",
7-
llm="gemini/gemini-1.5-flash-8b",
8-
self_reflect=True,
9-
verbose=True
10-
)
4+
agent = Agent(
5+
instructions="You are a helpful assistant",
6+
llm="gemini/gemini-1.5-flash-8b",
7+
self_reflect=True,
8+
verbose=True
9+
)
1110

12-
# Use achat instead of start/chat for async operation
13-
response = await agent.achat("Why sky is Blue in 1000 words?")
14-
print(response)
15-
16-
if __name__ == "__main__":
17-
# Run the async main function
18-
asyncio.run(main())
11+
# Use achat instead of start/chat for async operation
12+
response = asyncio.run(agent.achat("Why sky is Blue in 1000 words?"))
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""
2+
Basic example of using Grok model in PraisonAI
3+
"""
4+
5+
from praisonaiagents import Agent
6+
7+
# Initialize Agent with Grok model
8+
agent = Agent(
9+
instructions="You are a helpful assistant",
10+
llm="xai/grok-beta",
11+
)
12+
13+
# Example conversation
14+
response = agent.start("Hello! Can you explain quantum computing in simple terms?")
15+
16+
# Example with mathematical reasoning
17+
math_task = """
18+
Solve this problem step by step:
19+
If a train travels at 60 mph for 2.5 hours, how far does it travel?
20+
"""
21+
22+
response = agent.start(math_task)
23+
24+
# Example with creative writing
25+
creative_task = """
26+
Write a short story about a robot learning to paint.
27+
Make it engaging and about 100 words.
28+
"""
29+
30+
response = agent.start(creative_task)

0 commit comments

Comments
 (0)