Skip to content

Commit 7312393

Browse files
committed
[NEW MODEL][GPT 5] [Sonnet 4 examples]
1 parent a9e957b commit 7312393

4 files changed

Lines changed: 36 additions & 3 deletions

File tree

example.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@
3333
- Performance attribution
3434
3535
You communicate in precise, technical terms while maintaining clarity for stakeholders.""",
36-
model_name="gpt-4.1",
36+
model_name="claude-sonnet-4-20250514",
3737
dynamic_temperature_enabled=True,
3838
output_type="str-all-except-first",
3939
max_loops="auto",
4040
interactive=True,
4141
no_reasoning_prompt=True,
4242
streaming_on=True,
4343
# dashboard=True
44+
llm_base_url="https://api.openai.com/v1"
4445
)
4546

4647
out = agent.run(

examples/models/gpt_5_example.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""
2+
Instructions:
3+
4+
1. Install the swarms package:
5+
> pip3 install -U swarms
6+
7+
2. Set the model name:
8+
> model_name = "openai/gpt-5-2025-08-07"
9+
10+
3. Add your OPENAI_API_KEY to the .env file and verify your account.
11+
12+
4. Run the agent!
13+
14+
Verify your OpenAI account here: https://platform.openai.com/settings/organization/general
15+
"""
16+
17+
from swarms import Agent
18+
19+
agent = Agent(
20+
name="Research Agent",
21+
description="A research agent that can answer questions",
22+
model_name="openai/gpt-5-2025-08-07",
23+
streaming_on=True,
24+
max_loops=1,
25+
interactive=True,
26+
)
27+
28+
out = agent.run(
29+
"What are the best arbitrage trading strategies for altcoins? Give me research papers and articles on the topic."
30+
)
31+
32+
print(out)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
55

66
[tool.poetry]
77
name = "swarms"
8-
version = "8.0.4"
8+
version = "8.0.5"
99
description = "Swarms - TGSC"
1010
license = "MIT"
1111
authors = ["Kye Gomez <kye@apac.ai>"]

simple_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
agent = Agent(
44
name="Research Agent",
55
description="A research agent that can answer questions",
6-
model_name="claude-3-5-sonnet-20241022",
6+
model_name="claude-sonnet-4-20250514",
77
streaming_on=True,
88
max_loops=1,
99
interactive=True,

0 commit comments

Comments
 (0)