From 7312393a7140d9554a0635ce4e27fb8a810eb688 Mon Sep 17 00:00:00 2001 From: Kye Gomez Date: Thu, 7 Aug 2025 10:54:00 -0700 Subject: [PATCH] [NEW MODEL][GPT 5] [Sonnet 4 examples] --- example.py | 3 ++- examples/models/gpt_5_example.py | 32 ++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- simple_agent.py | 2 +- 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 examples/models/gpt_5_example.py diff --git a/example.py b/example.py index 387704ae..645e76d0 100644 --- a/example.py +++ b/example.py @@ -33,7 +33,7 @@ agent = Agent( - Performance attribution You communicate in precise, technical terms while maintaining clarity for stakeholders.""", - model_name="gpt-4.1", + model_name="claude-sonnet-4-20250514", dynamic_temperature_enabled=True, output_type="str-all-except-first", max_loops="auto", @@ -41,6 +41,7 @@ agent = Agent( no_reasoning_prompt=True, streaming_on=True, # dashboard=True + llm_base_url="https://api.openai.com/v1" ) out = agent.run( diff --git a/examples/models/gpt_5_example.py b/examples/models/gpt_5_example.py new file mode 100644 index 00000000..6974b036 --- /dev/null +++ b/examples/models/gpt_5_example.py @@ -0,0 +1,32 @@ +""" +Instructions: + +1. Install the swarms package: + > pip3 install -U swarms + +2. Set the model name: + > model_name = "openai/gpt-5-2025-08-07" + +3. Add your OPENAI_API_KEY to the .env file and verify your account. + +4. Run the agent! + +Verify your OpenAI account here: https://platform.openai.com/settings/organization/general +""" + +from swarms import Agent + +agent = Agent( + name="Research Agent", + description="A research agent that can answer questions", + model_name="openai/gpt-5-2025-08-07", + streaming_on=True, + max_loops=1, + interactive=True, +) + +out = agent.run( + "What are the best arbitrage trading strategies for altcoins? Give me research papers and articles on the topic." +) + +print(out) diff --git a/pyproject.toml b/pyproject.toml index 1a254c1c..d1b0e0f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "swarms" -version = "8.0.4" +version = "8.0.5" description = "Swarms - TGSC" license = "MIT" authors = ["Kye Gomez "] diff --git a/simple_agent.py b/simple_agent.py index de3aa638..9af05573 100644 --- a/simple_agent.py +++ b/simple_agent.py @@ -3,7 +3,7 @@ from swarms import Agent agent = Agent( name="Research Agent", description="A research agent that can answer questions", - model_name="claude-3-5-sonnet-20241022", + model_name="claude-sonnet-4-20250514", streaming_on=True, max_loops=1, interactive=True,