-
-
Notifications
You must be signed in to change notification settings - Fork 505
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #331 from MervinPraison/develop
Develop
- Loading branch information
Showing
20 changed files
with
762 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Oops, something went wrong.