-
-
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 13, 2024
1 parent
6fc1ecf
commit 09f5ef6
Showing
13 changed files
with
276 additions
and
80 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
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
This file was deleted.
Oops, something went wrong.
File renamed without changes.
57 changes: 57 additions & 0 deletions
57
playground/agents/agents_and_memory/finance_agent_with_memory
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,57 @@ | ||
import os | ||
|
||
from swarms_memory import ChromaDB | ||
|
||
from swarms import Agent, Anthropic | ||
from swarms.prompts.finance_agent_sys_prompt import ( | ||
FINANCIAL_AGENT_SYS_PROMPT, | ||
) | ||
from swarms.utils.data_to_text import data_to_text | ||
|
||
# Initilaize the chromadb client | ||
chromadb = ChromaDB( | ||
metric="cosine", | ||
output_dir="fiance_agent_rag", | ||
# docs_folder="artifacts", # Folder of your documents | ||
) | ||
|
||
|
||
# Initialize the agent | ||
agent = Agent( | ||
agent_name="Financial-Analysis-Agent", | ||
system_prompt=FINANCIAL_AGENT_SYS_PROMPT, | ||
agent_description="Agent creates ", | ||
llm=Anthropic(anthropic_api_key=os.getenv("ANTHROPIC_API_KEY")), | ||
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, | ||
# agent_ops_on=True, | ||
# long_term_memory=ChromaDB(docs_folder="artifacts"), | ||
) | ||
|
||
|
||
contract = data_to_text("your_contract_pdf.pdf") | ||
|
||
agent.run( | ||
f"Analyze the following contract and give me a full summary: {contract}" | ||
) |
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,46 @@ | ||
import os | ||
from swarms import Agent, Anthropic | ||
from swarms.prompts.finance_agent_sys_prompt import ( | ||
FINANCIAL_AGENT_SYS_PROMPT, | ||
) | ||
from swarms.utils.data_to_text import data_to_text | ||
|
||
# Initialize the agent | ||
agent = Agent( | ||
agent_name="Financial-Analysis-Agent", | ||
system_prompt=FINANCIAL_AGENT_SYS_PROMPT, | ||
agent_description="Agent creates ", | ||
llm=Anthropic(anthropic_api_key=os.getenv("ANTHROPIC_API_KEY")), | ||
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, | ||
# agent_ops_on=True, | ||
# long_term_memory=ChromaDB(docs_folder="artifacts"), | ||
) | ||
|
||
|
||
contract = data_to_text("your_contract_pdf.pdf") | ||
|
||
agent.run( | ||
f"Analyze the following contract and give me a full summary: {contract}" | ||
) |
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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.4" | ||
version = "5.3.5" | ||
description = "Swarms - Pytorch" | ||
license = "MIT" | ||
authors = ["Kye Gomez <[email protected]>"] | ||
|
Oops, something went wrong.