Skip to content

Commit 2281ac7

Browse files
Merge branch 'kortix-ai:main' into sheets-agent
2 parents 3373967 + 2975772 commit 2281ac7

File tree

5 files changed

+1502
-1389
lines changed

5 files changed

+1502
-1389
lines changed

backend/pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ classifiers = [
1212
requires-python = ">=3.11"
1313
dependencies = [
1414
"python-dotenv==1.0.1",
15-
"litellm==1.72.2",
15+
"litellm==1.75.2",
1616
"click==8.1.7",
1717
"questionary==2.0.1",
1818
"requests==2.32.3",
@@ -74,3 +74,8 @@ repository = "https://github.com/kortix-ai/suna"
7474

7575
[tool.uv]
7676
package = false
77+
78+
[dependency-groups]
79+
dev = [
80+
"orjson>=3.11.1",
81+
]

backend/services/llm.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
from utils.config import config
2222

2323
# litellm.set_verbose=True
24-
litellm.modify_params=True
24+
# Let LiteLLM auto-adjust params and drop unsupported ones (e.g., GPT-5 temperature!=1)
25+
litellm.modify_params = True
26+
litellm.drop_params = True
2527

2628
# Constants
2729
MAX_RETRIES = 2
@@ -144,7 +146,9 @@ def prepare_params(
144146
logger.debug(f"Skipping max_tokens for Claude 3.7 model: {model_name}")
145147
# Do not add any max_tokens parameter for Claude 3.7
146148
else:
147-
param_name = "max_completion_tokens" if 'o1' in model_name else "max_tokens"
149+
is_openai_o_series = 'o1' in model_name
150+
is_openai_gpt5 = 'gpt-5' in model_name
151+
param_name = "max_completion_tokens" if (is_openai_o_series or is_openai_gpt5) else "max_tokens"
148152
params[param_name] = max_tokens
149153

150154
# Add tools if provided
@@ -199,6 +203,10 @@ def prepare_params(
199203
# Apply Anthropic prompt caching (minimal implementation)
200204
# Check model name *after* potential modifications (like adding bedrock/ prefix)
201205
effective_model_name = params.get("model", model_name) # Use model from params if set, else original
206+
207+
# OpenAI GPT-5: drop unsupported temperature param (only default 1 allowed)
208+
if "gpt-5" in effective_model_name and "temperature" in params and params["temperature"] != 1:
209+
params.pop("temperature", None)
202210
if "claude" in effective_model_name.lower() or "anthropic" in effective_model_name.lower():
203211
messages = params["messages"] # Direct reference, modification affects params
204212

backend/utils/constants.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,22 @@
8484
},
8585
"tier_availability": ["paid"]
8686
},
87+
"openai/gpt-5": {
88+
"aliases": ["gpt-5"],
89+
"pricing": {
90+
"input_cost_per_million_tokens": 1.25,
91+
"output_cost_per_million_tokens": 10.00
92+
},
93+
"tier_availability": ["paid"]
94+
},
95+
"openai/gpt-5-mini": {
96+
"aliases": ["gpt-5-mini"],
97+
"pricing": {
98+
"input_cost_per_million_tokens": 0.25,
99+
"output_cost_per_million_tokens": 2.00
100+
},
101+
"tier_availability": ["paid"]
102+
},
87103
"openai/gpt-4.1-mini": {
88104
"aliases": ["gpt-4.1-mini"],
89105
"pricing": {

0 commit comments

Comments
 (0)