From 9aaff48a2ce2b2b622f11b0a527adfff05980f6a Mon Sep 17 00:00:00 2001 From: Pavan Kumar <66913595+ascender1729@users.noreply.github.com> Date: Mon, 26 May 2025 15:12:37 +0000 Subject: [PATCH] fix(structs): simplify Agent initialization example in index.md - Remove explicit OpenAIChat import and llm setup - Show passing temperature, model_name, and max_tokens directly to Agent - Remove dotenv/env loading instructions --- docs/swarms/structs/index.md | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/docs/swarms/structs/index.md b/docs/swarms/structs/index.md index 6ead63f8..85f4e931 100644 --- a/docs/swarms/structs/index.md +++ b/docs/swarms/structs/index.md @@ -40,28 +40,10 @@ Features: ✅ Long term memory database with RAG (ChromaDB, Pinecone, Qdrant) ```python -import os - -from dotenv import load_dotenv - -# Import the OpenAIChat model and the Agent struct from swarms import Agent -from swarm_models import OpenAIChat - -# Load the environment variables -load_dotenv() - -# Get the API key from the environment -api_key = os.environ.get("OPENAI_API_KEY") - -# Initialize the language model -llm = OpenAIChat( - temperature=0.5, model_name="gpt-4", openai_api_key=api_key, max_tokens=4000 -) - ## Initialize the workflow -agent = Agent(llm=llm, max_loops=1, autosave=True, dashboard=True) +agent = Agent(temperature=0.5, model_name="gpt-4o-mini", max_tokens=4000, max_loops=1, autosave=True, dashboard=True) # Run the workflow on a task agent.run("Generate a 10,000 word blog on health and wellness.")