Skip to content

Commit

Permalink
Merge pull request #331 from MervinPraison/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
MervinPraison authored Jan 23, 2025
2 parents 806b90d + d0bd59a commit 03a6eb6
Show file tree
Hide file tree
Showing 20 changed files with 762 additions and 176 deletions.
6 changes: 6 additions & 0 deletions agents/deepseek-reasoning-agents.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from praisonaiagents import Agent

agent = Agent(instructions="You are helpful Assisant", llm="deepseek-reasoner", reasoning_steps=True)

result = agent.start("Why sky is Blue?")
print(result)
14 changes: 14 additions & 0 deletions agents/deepseek-reasoning-multi-agents.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from praisonaiagents import Agent, Task, PraisonAIAgents

reasoning_agent = Agent(role="Helpful Assistant", reasoning_steps=True, llm="deepseek/deepseek-reasoner")
small_agent = Agent(role="Helpful Assistant", llm="gpt-3.5-turbo")

reasoning_task = Task(description="How many r's in the word 'Strawberry'?", agent=reasoning_agent)
small_task = Task(description="With the provided reasoning tell me how many r's in the word 'Strawberry'?", agent=small_agent)

agents = PraisonAIAgents(
agents=[reasoning_agent, small_agent],
tasks=[reasoning_task, small_task]
)

agents.start()
18 changes: 18 additions & 0 deletions agents/deepseek-think.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from openai import OpenAI

client = OpenAI()

response = client.chat.completions.create(
model="deepseek-reasoner",
messages=[
{"role": "system", "content": "You are a helpful assistant"},
{"role": "user", "content": "Why sky is Blue?"},
],
stream=True
)

for chunk in response:
if chunk.choices[0].delta.content is not None:
print(chunk.choices[0].delta.content, end="", flush=True)
if chunk.choices[0].delta.reasoning_content is not None:
print(chunk.choices[0].delta.reasoning_content, end="", flush=True)
14 changes: 14 additions & 0 deletions agents/litellm-reasoning.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from litellm import completion

messages = [{"role": "user", "content": "What is 1+1?"}]
resp = completion(
model="deepseek/deepseek-reasoner",
messages=messages,
stream=False
)

reasoning_content = resp.choices[0].message.provider_specific_fields["reasoning_content"]
content = resp.choices[0].message.content

print(reasoning_content)
print(content)
9 changes: 9 additions & 0 deletions agents/llm-deepseek-agents.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from praisonaiagents import Agent

agent = Agent(
instructions="You are helpful Assisant",
llm="deepseek/deepseek-reasoner"
)

result = agent.start("Why sky is Blue?")
print(result)
10 changes: 10 additions & 0 deletions agents/llm-deepseek-reasoning-agents.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from praisonaiagents import Agent

agent = Agent(
instructions="You are helpful Assisant",
llm="deepseek/deepseek-reasoner",
reasoning_steps=True
)

result = agent.start("Why sky is Blue?")
print(result)
Loading

0 comments on commit 03a6eb6

Please sign in to comment.