Skip to content

Commit

Permalink
import fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Occupying-Mars committed Nov 30, 2024
1 parent 4dafc04 commit 1a8e305
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ The `run` method is the primary entry point for executing tasks with an `Agent`

```python
from swarms import Agent
from swarms.models import OpenAIChat

model = OpenAIChat(
openai_api_key="your-api-key",
model_name="gpt-4o-mini",
temperature=0.1
)

agent = Agent(
agent_name="Stock-Analysis-Agent",
Expand Down Expand Up @@ -168,7 +175,7 @@ The `Agent` class offers a range of settings to tailor its behavior to specific
```python
import os
from swarms import Agent
from swarm_models import OpenAIChat
from swarms.models import OpenAIChat

from swarms.prompts.finance_agent_sys_prompt import (
FINANCIAL_AGENT_SYS_PROMPT,
Expand Down Expand Up @@ -231,7 +238,7 @@ graph TD
```python
import os

from swarms_memory import ChromaDB
from swarms.memory import ChromaDB

# Initialize the ChromaDB client for long-term memory management
chromadb = ChromaDB(
Expand All @@ -243,7 +250,7 @@ chromadb = ChromaDB(

**Step 2: Define the Model**
```python
from swarm_models import Anthropic
from swarms.models import Anthropic
from swarms.prompts.finance_agent_sys_prompt import (
FINANCIAL_AGENT_SYS_PROMPT,
)
Expand Down Expand Up @@ -378,7 +385,7 @@ The following is an example of an agent that intakes a pydantic basemodel and ou
```python
from pydantic import BaseModel, Field
from swarms import Agent
from swarm_models import Anthropic
from swarms.models import OpenAIChat


# Initialize the schema for the person's information
Expand Down Expand Up @@ -410,7 +417,11 @@ agent = Agent(
),
# Set the tool schema to the JSON string -- this is the key difference
tool_schema=tool_schema,
llm=Anthropic(),
llm=OpenAIChat(
openai_api_key="your-api-key",
model_name="gpt-4o",
temperature=0.1
),
max_loops=3,
autosave=True,
dashboard=False,
Expand Down Expand Up @@ -442,6 +453,7 @@ Run the agent with multiple modalities useful for various real-world tasks in ma
import os
from dotenv import load_dotenv
from swarms import Agent
from swarms.models import OpenAIChat

from swarm_models import GPT4VisionAPI

Expand All @@ -450,7 +462,7 @@ load_dotenv()


# Initialize the language model
llm = GPT4VisionAPI(
llm = OpenAIChat(
openai_api_key=os.environ.get("OPENAI_API_KEY"),
max_tokens=500,
)
Expand Down Expand Up @@ -552,7 +564,7 @@ Steps:

For example, here's an example on how to create an agent from griptape.

Heres how you can create a custom **Griptape** agent that integrates with the **Swarms** framework by inheriting from the `Agent` class in **Swarms** and overriding the `run(task: str) -> str` method.
Here's how you can create a custom **Griptape** agent that integrates with the **Swarms** framework by inheriting from the `Agent` class in **Swarms** and overriding the `run(task: str) -> str` method.


```python
Expand Down Expand Up @@ -694,7 +706,7 @@ In this example, each `Agent` represents a task that is executed sequentially. T
```python
import os
from swarms import Agent, SequentialWorkflow
from swarm_models import OpenAIChat
from swarms.models import OpenAIChat

# model = Anthropic(anthropic_api_key=os.getenv("ANTHROPIC_API_KEY"))
company = "Nvidia"
Expand Down Expand Up @@ -911,7 +923,7 @@ The `run` method returns the final output after all agents have processed the in
from swarms import Agent, AgentRearrange


from swarm_models import Anthropic
from swarm.models import Anthropic

# Initialize the director agent

Expand Down Expand Up @@ -1288,7 +1300,7 @@ The `run` method returns a dictionary containing the outputs of each agent that
```python
import os
from swarms import Agent
from swarm_models import OpenAIChat
from swarms.models import OpenAIChat
from swarms.structs.spreadsheet_swarm import SpreadSheetSwarm

# Define custom system prompts for each social media platform
Expand Down Expand Up @@ -1613,7 +1625,7 @@ The `SwarmRouter` class is a flexible routing system designed to manage differen
import os
from dotenv import load_dotenv
from swarms import Agent
from swarm_models import OpenAIChat
from swarms.models import OpenAIChat
from swarms.structs.swarm_router import SwarmRouter, SwarmType

load_dotenv()
Expand Down

0 comments on commit 1a8e305

Please sign in to comment.