From 75356d45c2ca991cb34ed946eb937744cf0a6df1 Mon Sep 17 00:00:00 2001 From: pliny <133052465+elder-plinius@users.noreply.github.com> Date: Sat, 2 Mar 2024 09:49:16 -0800 Subject: [PATCH] Update example.py --- example.py | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/example.py b/example.py index 26e0ac86..bebdb11a 100644 --- a/example.py +++ b/example.py @@ -1,28 +1,8 @@ -import os - -from dotenv import load_dotenv - -# Import the OpenAIChat model and the Agent struct -from swarms.models import OpenAIChat -from swarms.structs import Agent - -# 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=1000, -) +from swarms import Agent, OpenAIChat ## Initialize the workflow agent = Agent( - llm=llm, + llm=OpenAIChat(), max_loops=1, autosave=True, dashboard=False, @@ -31,4 +11,4 @@ agent = Agent( ) # Run the workflow on a task -agent.run("Generate a 10,000 word blog on health and wellness.") +agent("Find a chick fil a equivalent in hayes valley")