Skip to content

Commit 82798fb

Browse files
authored
Add openai models and flesh out builtin tools (#421)
Signed-off-by: Trevor Grant <[email protected]>
1 parent 8468c43 commit 82798fb

File tree

3 files changed

+198
-159
lines changed

3 files changed

+198
-159
lines changed
Lines changed: 51 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
models = {
42

53
"gemini-2.5-pro": {
@@ -9,22 +7,26 @@
97
"default": 1.0,
108
"min": 0.0,
119
"max": 2.0,
12-
"description": "Temperature - Controls randomness"
13-
},
14-
"reasoning_effort": {
15-
"type": "choice",
16-
"default": "disable",
17-
"choices": ["disable", "low", "medium", "high"],
18-
"description": "Reasoning Effort: Effort level for reasoning during generation"
10+
"description": "Temperature - Controls the randomness of the output."
1911
},
2012
},
2113
"built_in_tools": [
22-
{
23-
"id": "google_search",
24-
"description": "Performs a Google search.",
25-
"tool_config": {"google_search": {}}
26-
}
27-
],
14+
{
15+
"id": "google_search",
16+
"description": "Performs a Google search.",
17+
"tool_config": {"google_search": {}}
18+
},
19+
{
20+
"id": "urlContext",
21+
"description": "Provides context from a specified URL.",
22+
"tool_config": {"urlContext": {}}
23+
},
24+
{
25+
"id": "code_execution",
26+
"description": "Executes code snippets in a secure environment.",
27+
"tool_config": {"codeExecution": {}}
28+
}
29+
],
2830
},
2931
"gemini-2.5-flash": {
3032
"parameters": {
@@ -33,22 +35,26 @@
3335
"default": 1.0,
3436
"min": 0.0,
3537
"max": 2.0,
36-
"description": "Temperature - Controls randomness"
37-
},
38-
"reasoning_effort": {
39-
"type": "choice",
40-
"default": "disable",
41-
"choices": ["disable", "low", "medium", "high"],
42-
"description": "Reasoning Effort: Effort level for reasoning during generation"
38+
"description": "Temperature - Controls the randomness of the output."
4339
},
4440
},
4541
"built_in_tools": [
46-
{
47-
"id": "google_search",
48-
"description": "Performs a Google search.",
49-
"tool_config": {"google_search": {}}
50-
}
51-
],
42+
{
43+
"id": "google_search",
44+
"description": "Performs a Google search.",
45+
"tool_config": {"google_search": {}}
46+
},
47+
{
48+
"id": "urlContext",
49+
"description": "Provides context from a specified URL.",
50+
"tool_config": {"urlContext": {}}
51+
},
52+
{
53+
"id": "code_execution",
54+
"description": "Executes code snippets in a secure environment.",
55+
"tool_config": {"codeExecution": {}}
56+
}
57+
],
5258
},
5359
"gemini-2.5-flash-lite": {
5460
"parameters": {
@@ -57,21 +63,25 @@
5763
"default": 1.0,
5864
"min": 0.0,
5965
"max": 2.0,
60-
"description": "Temperature - Controls randomness"
61-
},
62-
"reasoning_effort": {
63-
"type": "choice",
64-
"default": "disable",
65-
"choices": ["disable", "low", "medium", "high"],
66-
"description": "Reasoning Effort: Effort level for reasoning during generation"
66+
"description": "Temperature - Controls the randomness of the output."
6767
},
6868
},
6969
"built_in_tools": [
70-
{
71-
"id": "google_search",
72-
"description": "Performs a Google search.",
73-
"tool_config": {"google_search": {}}
74-
}
75-
],
70+
{
71+
"id": "google_search",
72+
"description": "Performs a Google search.",
73+
"tool_config": {"google_search": {}}
74+
},
75+
{
76+
"id": "urlContext",
77+
"description": "Provides context from a specified URL.",
78+
"tool_config": {"urlContext": {}}
79+
},
80+
{
81+
"id": "code_execution",
82+
"description": "Executes code snippets in a secure environment.",
83+
"tool_config": {"codeExecution": {}}
84+
}
85+
],
7686
}
7787
}
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# Code interpreter will work, but needs special handling of responses or throws error:
2+
# ResponseCodeInterpreterToolCall has no attribute 'content'
3+
4+
models = {
5+
# === GPT-5 family ===
6+
"gpt-5": {
7+
"api_style": "responses",
8+
"returns_thoughts": True, # reasoning traces supported by GPT-5/o-series
9+
"parameters": {
10+
"reasoning": {
11+
"type": "object",
12+
"properties": {
13+
"effort": {
14+
"type": "choice",
15+
"default": "medium",
16+
"choices": ["low", "medium", "high"],
17+
"description": "Controls model’s internal reasoning effort"
18+
}
19+
}
20+
}
21+
},
22+
"built_in_tools": [
23+
{"id": "web_search", "description": "Performs a web search.", "tool_config": {"type": "web_search", "search_context_size": "auto"}},
24+
# {"id": "code_interpreter", "description": "Executes code snippets in a secure environment.", "tool_config": {"type": "code_interpreter","container": {"type": "auto"}}}
25+
# {"id": "image_generation", "description": "Generates images via the GPT Image tool.", "tool_config": {"type": "gpt_image"}} # No way to recover images yet
26+
]
27+
},
28+
"gpt-5-mini": {
29+
"api_style": "responses",
30+
"returns_thoughts": True,
31+
"parameters": {
32+
"reasoning": {
33+
"type": "object",
34+
"properties": {
35+
"effort": {
36+
"type": "choice",
37+
"default": "low",
38+
"choices": ["disable", "low", "medium", "high"],
39+
"description": "Reasoning effort (can be disabled)"
40+
}
41+
}
42+
}
43+
},
44+
"built_in_tools": [
45+
{"id": "web_search", "description": "Performs a web search.", "tool_config": {"type": "web_search", "search_context_size": "auto"}},
46+
# {"id": "code_interpreter", "description": "Executes code snippets in a secure environment.", "tool_config": {"type": "code_interpreter","container": {"type": "auto"}}}
47+
# {"id": "image_generation", "description": "Generates images via the GPT Image tool.", "tool_config": {"type": "gpt_image"}} # No way to recover images yet
48+
]
49+
},
50+
"gpt-5-nano": {
51+
"api_style": "responses",
52+
"returns_thoughts": False,
53+
"parameters": {
54+
},
55+
"built_in_tools": [
56+
{"id": "web_search", "description": "Performs a web search.", "tool_config": {"type": "web_search", "search_context_size": "auto"}},
57+
# {"id": "code_interpreter", "description": "Executes code snippets in a secure environment.", "tool_config": {"type": "code_interpreter","container": {"type": "auto"}}}
58+
]
59+
},
60+
61+
# === O-series (reasoning) ===
62+
"o4-mini": {
63+
"api_style": "responses",
64+
"returns_thoughts": True,
65+
"parameters": {
66+
"temperature": {"type": "float", "default": 0.6, "min": 0.0, "max": 2.0},
67+
68+
"reasoning": {
69+
"type": "object",
70+
"properties": {
71+
"effort": {"type": "choice", "default": "medium", "choices": ["low", "medium", "high"]}
72+
}
73+
}
74+
},
75+
"built_in_tools": [
76+
{"id": "web_search", "description": "Performs a web search.", "tool_config": {"type": "web_search", "search_context_size": "auto"}},
77+
# {"id": "code_interpreter", "description": "Executes code snippets in a secure environment.", "tool_config": {"type": "code_interpreter","container": {"type": "auto"}}}
78+
]
79+
},
80+
"o3-mini": {
81+
"api_style": "responses",
82+
"returns_thoughts": True,
83+
"parameters": {
84+
"temperature": {"type": "float", "default": 0.6, "min": 0.0, "max": 2.0},
85+
"reasoning": {
86+
"type": "object",
87+
"properties": {
88+
"effort": {"type": "choice", "default": "low", "choices": ["low", "medium", "high"]}
89+
}
90+
}
91+
},
92+
"built_in_tools": [
93+
{"id": "web_search", "description": "Performs a web search.", "tool_config": {"type": "web_search", "search_context_size": "auto"}},
94+
# {"id": "code_interpreter", "description": "Executes code snippets in a secure environment.", "tool_config": {"type": "code_interpreter","container": {"type": "auto"}}}
95+
]
96+
},
97+
98+
# === GPT-4.x family still available via API ===
99+
"gpt-4.1": {
100+
"api_style": "responses",
101+
"returns_thoughts": False,
102+
"parameters": {
103+
"temperature": {"type": "float", "default": 0.7, "min": 0.0, "max": 2.0},
104+
},
105+
"built_in_tools": [
106+
{"id": "web_search", "description": "Performs a web search.", "tool_config": {"type": "web_search_preview", "search_context_size": "low"}},
107+
{"id": "image_generation", "description": "Generates images via the GPT Image tool.", "tool_config": {"type": "gpt_image"}}
108+
]
109+
},
110+
"gpt-4.1-mini": {
111+
"api_style": "responses",
112+
"returns_thoughts": False,
113+
"parameters": {
114+
"temperature": {"type": "float", "default": 0.7, "min": 0.0, "max": 2.0},
115+
},
116+
"built_in_tools": [
117+
{"id": "web_search", "description": "Performs a web search.", "tool_config": {"type": "web_search", "search_context_size": "auto"}},
118+
# {"id": "code_interpreter", "description": "Executes code snippets in a secure environment.", "tool_config": {"type": "code_interpreter","container": {"type": "auto"}}}
119+
]
120+
},
121+
"gpt-4o": {
122+
"api_style": "responses",
123+
"returns_thoughts": False,
124+
"parameters": {
125+
"temperature": {"type": "float", "default": 0.7, "min": 0.0, "max": 2.0},
126+
},
127+
"built_in_tools": [
128+
{"id": "web_search", "description": "Performs a web search.", "tool_config": {"type": "web_search", "search_context_size": "auto"}},
129+
# {"id": "code_interpreter", "description": "Executes code snippets in a secure environment.", "tool_config": {"type": "code_interpreter","container": {"type": "auto"}}}
130+
]
131+
},
132+
"gpt-4o-mini": {
133+
"api_style": "responses",
134+
"returns_thoughts": False,
135+
"parameters": {
136+
"temperature": {"type": "float", "default": 0.7, "min": 0.0, "max": 2.0},
137+
},
138+
"built_in_tools": [
139+
{"id": "web_search", "description": "Performs a web search.", "tool_config": {"type": "web_search_preview", "search_context_size": "low"}},
140+
# {"id": "image_generation", "description": "Generates images via the GPT Image tool.", "tool_config": {"type": "gpt_image"}},
141+
# {"id": "code_interpreter", "description": "Executes code snippets in a secure environment.", "tool_config": {"type": "code_interpreter","container": {"type": "auto"}}}
142+
]
143+
},
144+
145+
}

0 commit comments

Comments
 (0)