Merge pull request #857 from ascender1729/fix/structs-index-agent-init

fix/structs-index-agent-init
dependabot/pip/pypdf-5.6.0
Kye Gomez 2 weeks ago committed by GitHub
commit 120d6a829f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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.")

Loading…
Cancel
Save