Skip to content

Commit

Permalink
[GPT4o Mini Finance Agent Demo 🔥] ]
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye Gomez authored and Kye Gomez committed Jul 19, 2024
1 parent 450a7b7 commit f602722
Show file tree
Hide file tree
Showing 6 changed files with 536 additions and 32 deletions.
468 changes: 468 additions & 0 deletions docs/swarms/framework/blog.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion multi_agent_collab_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
retry_attempts=3,
# context_length=1000,
# tool_schema = dict
context_length=200000,
context_length=160000,
# agent_ops_on=True,
interactive=True,
# long_term_memory=ChromaDB(docs_folder="artifacts"),
)

Expand Down
49 changes: 49 additions & 0 deletions playground/agents/gpt4o_mini_demo/financial_agent_gpt4o_mini.py
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?")
16 changes: 16 additions & 0 deletions playground/models/gpt_4o_mini.py
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)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]>"]
Expand Down
30 changes: 0 additions & 30 deletions txt_to_csv.py

This file was deleted.

0 comments on commit f602722

Please sign in to comment.