-
-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kye Gomez
authored and
Kye Gomez
committed
Jul 19, 2024
1 parent
450a7b7
commit f602722
Showing
6 changed files
with
536 additions
and
32 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
49 changes: 49 additions & 0 deletions
49
playground/agents/gpt4o_mini_demo/financial_agent_gpt4o_mini.py
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,49 @@ | ||
import os | ||
|
||
from swarms import Agent, OpenAIChat | ||
from swarms.prompts.finance_agent_sys_prompt import ( | ||
FINANCIAL_AGENT_SYS_PROMPT, | ||
) | ||
|
||
# Get the OpenAI API key from the environment variable | ||
api_key = os.getenv("OPENAI_API_KEY") | ||
|
||
# Create an instance of the OpenAIChat class | ||
model = OpenAIChat(api_key=api_key, model_name="gpt-4o-mini") | ||
|
||
|
||
# Initialize the agent | ||
agent = Agent( | ||
agent_name="Financial-Analysis-Agent", | ||
system_prompt=FINANCIAL_AGENT_SYS_PROMPT, | ||
llm=model, | ||
max_loops="auto", | ||
autosave=True, | ||
# dynamic_temperature_enabled=True, | ||
dashboard=False, | ||
verbose=True, | ||
streaming_on=True, | ||
# interactive=True, # Set to False to disable interactive mode | ||
dynamic_temperature_enabled=True, | ||
saved_state_path="finance_agent.json", | ||
# tools=[Add your functions here# ], | ||
# stopping_token="Stop!", | ||
# interactive=True, | ||
# docs_folder="docs", # Enter your folder name | ||
# pdf_path="docs/finance_agent.pdf", | ||
# sop="Calculate the profit for a company.", | ||
# sop_list=["Calculate the profit for a company."], | ||
user_name="swarms_corp", | ||
# # docs= | ||
# # docs_folder="docs", | ||
retry_attempts=3, | ||
# context_length=1000, | ||
# tool_schema = dict | ||
context_length=200000, | ||
interactive=True, | ||
# agent_ops_on=True, | ||
# long_term_memory=ChromaDB(docs_folder="artifacts"), | ||
) | ||
|
||
|
||
agent.run("What are the best states to register a C CORP in?") |
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,16 @@ | ||
from swarms import OpenAIChat | ||
import os | ||
|
||
# Get the OpenAI API key from the environment variable | ||
api_key = os.getenv("OPENAI_API_KEY") | ||
|
||
# Create an instance of the OpenAIChat class | ||
model = OpenAIChat(api_key=api_key, model_name="gpt-4o-mini") | ||
|
||
# Query the model with a question | ||
out = model( | ||
"What is the best state to register a business in the US for the least amount of taxes?" | ||
) | ||
|
||
# Print the model's response | ||
print(out) |
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api" | |
|
||
[tool.poetry] | ||
name = "swarms" | ||
version = "5.3.9" | ||
version = "5.4.0" | ||
description = "Swarms - Pytorch" | ||
license = "MIT" | ||
authors = ["Kye Gomez <[email protected]>"] | ||
|
This file was deleted.
Oops, something went wrong.