From 1bdee887e4feabd4e8fe3e6ce954e0ce1b6a6eee Mon Sep 17 00:00:00 2001 From: ascender1729 Date: Fri, 2 May 2025 19:46:44 +0530 Subject: [PATCH] Update agent.md documentation --- docs/swarms/structs/agent.md | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/docs/swarms/structs/agent.md b/docs/swarms/structs/agent.md index c3b8a7a2..6b533ab4 100644 --- a/docs/swarms/structs/agent.md +++ b/docs/swarms/structs/agent.md @@ -234,24 +234,14 @@ pip3 install -U swarms Then, you can initialize and use the agent as follows: ```python -import os -from swarms import Agent -from swarm_models import OpenAIChat +from swarms.structs.agent import Agent 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-4-0613", temperature=0.1 -) - -# Initialize the agent +# Initialize the Financial Analysis Agent with GPT-4o-mini model agent = Agent( agent_name="Financial-Analysis-Agent", system_prompt=FINANCIAL_AGENT_SYS_PROMPT, - llm=model, + model_name="gpt-4o-mini", max_loops=1, autosave=True, dashboard=False, @@ -270,6 +260,7 @@ response = agent.run( "How can I establish a ROTH IRA to buy stocks and get a tax break? What are the criteria?" ) print(response) + ``` ## Advanced Usage