Skip to content

Commit 7fe0dec

Browse files
authored
GPT-5.1-Codex and a rearranging the OpenAI models sections (#1146)
<!-- Thank you for opening a pull request! Please add a brief description of the proposed change here. Also, please tick the appropriate points in the checklist below. --> ## Motivation and Context <!-- Why is this change needed? What problem does it solve? --> [KG-562](https://youtrack.jetbrains.com/issue/KG-562) Add GPT-5.1-Codex profile 1. Add GPT-5.1-Codex to the OpenAI models. 2. Add NONE as a reasoning effort for reasoning-capable LLM profiles. 3. Place the newest reasoning models out of the Chat section. 4. Update docs and tests. Sources of truth: - https://platform.openai.com/docs/api-reference/responses/create - https://platform.openai.com/docs/models/gpt-5.1-codex ## Breaking Changes <!-- Will users need to update their code or configurations? --> GPT-5-Codex and GPT-5.1 LLM profiles now belong not to Chat but to the Reasoning section. --- #### Type of the changes - [x] New feature (non-breaking change which adds functionality) - [ ] Bug fix (non-breaking change which fixes an issue) - [x] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Tests improvement - [ ] Refactoring #### Checklist - [x] The pull request has a description of the proposed change - [x] I read the [Contributing Guidelines](https://github.com/JetBrains/koog/blob/main/CONTRIBUTING.md) before opening the pull request - [x] The pull request uses **`develop`** as the base branch - [x] Tests for the changes have been added - [x] All new and existing tests passed ##### Additional steps for pull requests adding a new feature - [x] An issue describing the proposed change exists - [x] The pull request includes a link to the issue - [x] The change was discussed and approved in the issue - [x] Docs have been added / updated
1 parent 3cc8aa5 commit 7fe0dec

File tree

48 files changed

+380
-356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+380
-356
lines changed

agents/agents-core/src/commonTest/kotlin/ai/koog/agents/core/agent/session/AIAgentLLMSessionStructuredOutputTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class AIAgentLLMSessionStructuredOutputTest : AgentTestBase() {
4848
val llmContext = AIAgentLLMContext(
4949
tools = emptyList(),
5050
prompt = prompt,
51-
model = OpenAIModels.CostOptimized.GPT4oMini,
51+
model = OpenAIModels.Chat.GPT4oMini,
5252
promptExecutor = mockExecutor,
5353
environment = createTestEnvironment(),
5454
config = createTestConfig(),
@@ -101,7 +101,7 @@ class AIAgentLLMSessionStructuredOutputTest : AgentTestBase() {
101101
val llmContext = AIAgentLLMContext(
102102
tools = emptyList(),
103103
prompt = prompt,
104-
model = OpenAIModels.CostOptimized.GPT4oMini,
104+
model = OpenAIModels.Chat.GPT4oMini,
105105
promptExecutor = mockExecutor,
106106
environment = createTestEnvironment(),
107107
config = createTestConfig(),
@@ -171,7 +171,7 @@ class AIAgentLLMSessionStructuredOutputTest : AgentTestBase() {
171171
val llmContext = AIAgentLLMContext(
172172
tools = emptyList(),
173173
prompt = prompt,
174-
model = OpenAIModels.CostOptimized.GPT4oMini,
174+
model = OpenAIModels.Chat.GPT4oMini,
175175
promptExecutor = mockExecutor,
176176
environment = createTestEnvironment(),
177177
config = createTestConfig(),

agents/agents-core/src/commonTest/kotlin/ai/koog/agents/core/dsl/extension/AIAgentNodesTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class AIAgentNodesTest {
7171

7272
@Test
7373
fun testNodeLLMCompressHistoryWithCustomModel() = runTest {
74-
val customModel = OpenAIModels.CostOptimized.O3Mini
74+
val customModel = OpenAIModels.Chat.O3Mini
7575
val originalModel = OllamaModels.Meta.LLAMA_3_2
7676

7777
val results = mutableListOf<Any?>()
@@ -179,7 +179,7 @@ class AIAgentNodesTest {
179179

180180
val agentConfig = AIAgentConfig(
181181
prompt = prompt("test") {},
182-
model = OpenAIModels.CostOptimized.GPT4oMini,
182+
model = OpenAIModels.Chat.GPT4oMini,
183183
maxAgentIterations = 5
184184
)
185185

@@ -223,7 +223,7 @@ class AIAgentNodesTest {
223223
strategy = nativeStrategy,
224224
agentConfig = AIAgentConfig(
225225
prompt = prompt("test") {},
226-
model = OpenAIModels.CostOptimized.GPT4oMini,
226+
model = OpenAIModels.Chat.GPT4oMini,
227227
maxAgentIterations = 5
228228
),
229229
toolRegistry = ToolRegistry { }

agents/agents-ext/src/commonMain/kotlin/ai/koog/agents/ext/agent/LLMAsAJudge.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public inline fun <reified T> AIAgentSubgraphBuilderBase<*, *>.llmAsAJudge(
109109
),
110110
// optional field -- recommented for reliability of the format
111111
fixingParser = StructureFixingParser(
112-
model = OpenAIModels.CostOptimized.GPT4oMini,
112+
model = OpenAIModels.Chat.GPT4oMini,
113113
retries = 3,
114114
)
115115
).getOrThrow().data

agents/agents-ext/src/commonTest/kotlin/ai/koog/agents/ext/agent/StructuredOutputWithToolsIntegrationTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class StructuredOutputWithToolsIntegrationTest {
152152
""".trimIndent()
153153
)
154154
},
155-
model = OpenAIModels.CostOptimized.GPT4oMini,
155+
model = OpenAIModels.Chat.GPT4oMini,
156156
maxAgentIterations = 10
157157
)
158158

@@ -227,7 +227,7 @@ class StructuredOutputWithToolsIntegrationTest {
227227
""".trimIndent()
228228
)
229229
},
230-
model = OpenAIModels.CostOptimized.GPT4oMini,
230+
model = OpenAIModels.Chat.GPT4oMini,
231231
maxAgentIterations = 10
232232
)
233233

@@ -291,7 +291,7 @@ class StructuredOutputWithToolsIntegrationTest {
291291
prompt = prompt("weather-agent-no-tools") {
292292
system("Generate weather data without using tools.")
293293
},
294-
model = OpenAIModels.CostOptimized.GPT4oMini,
294+
model = OpenAIModels.Chat.GPT4oMini,
295295
maxAgentIterations = 10
296296
)
297297

agents/agents-features/agents-features-memory/src/jvmTest/kotlin/ai/koog/agents/memory/AIAgentMemoryTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ class AIAgentMemoryTest {
348348

349349
@Test
350350
fun testSaveFactsFromHistoryWithCustomModel() = runTest {
351-
val customModel = OpenAIModels.CostOptimized.O3Mini
351+
val customModel = OpenAIModels.Chat.O3Mini
352352
val originalModel = testModel
353353

354354
val memoryProvider = mockk<AgentMemoryProvider>()

agents/agents-features/agents-features-memory/src/jvmTest/kotlin/ai/koog/agents/memory/MemoryNodesTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ class MemoryNodesTest {
270270

271271
@Test
272272
fun testNodeSaveToMemoryWithCustomModel() = runTest {
273-
val customModel = OpenAIModels.CostOptimized.O3Mini
273+
val customModel = OpenAIModels.Chat.O3Mini
274274
val originalModel = OllamaModels.Meta.LLAMA_3_2
275275

276276
val concept = Concept(

agents/agents-test/src/jvmTest/kotlin/ai/koog/agents/test/SimpleAgentMockedTest.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class SimpleAgentMockedTest {
157157
fun ` test AIAgent doesn't call tools by default`() = runBlocking {
158158
val agent = AIAgent(
159159
systemPrompt = systemPrompt,
160-
llmModel = OpenAIModels.CostOptimized.GPT4oMini,
160+
llmModel = OpenAIModels.Chat.GPT4oMini,
161161
temperature = 1.0,
162162
maxIterations = 10,
163163
promptExecutor = testExecutor,
@@ -183,7 +183,7 @@ class SimpleAgentMockedTest {
183183

184184
val agent = AIAgent(
185185
systemPrompt = systemPrompt,
186-
llmModel = OpenAIModels.CostOptimized.GPT4oMini,
186+
llmModel = OpenAIModels.Chat.GPT4oMini,
187187
temperature = 1.0,
188188
toolRegistry = toolRegistry,
189189
maxIterations = 10,
@@ -207,7 +207,7 @@ class SimpleAgentMockedTest {
207207
fun `test simpleSingleRunAgent handles non-registered tools`(toolRegistry: ToolRegistry) = runBlocking {
208208
val agent = AIAgent(
209209
systemPrompt = systemPrompt,
210-
llmModel = OpenAIModels.CostOptimized.GPT4oMini,
210+
llmModel = OpenAIModels.Chat.GPT4oMini,
211211
temperature = 1.0,
212212
toolRegistry = toolRegistry,
213213
maxIterations = 10,
@@ -248,7 +248,7 @@ class SimpleAgentMockedTest {
248248

249249
val agent = AIAgent(
250250
systemPrompt = systemPrompt,
251-
llmModel = OpenAIModels.CostOptimized.GPT4oMini,
251+
llmModel = OpenAIModels.Chat.GPT4oMini,
252252
temperature = 1.0,
253253
toolRegistry = toolRegistry,
254254
maxIterations = 10,
@@ -278,7 +278,7 @@ class SimpleAgentMockedTest {
278278

279279
val successAgent = AIAgent(
280280
systemPrompt = systemPrompt,
281-
llmModel = OpenAIModels.CostOptimized.GPT4oMini,
281+
llmModel = OpenAIModels.Chat.GPT4oMini,
282282
temperature = 1.0,
283283
toolRegistry = toolRegistry,
284284
maxIterations = 10,
@@ -306,7 +306,7 @@ class SimpleAgentMockedTest {
306306

307307
val agent = AIAgent(
308308
systemPrompt = systemPrompt,
309-
llmModel = OpenAIModels.CostOptimized.GPT4oMini,
309+
llmModel = OpenAIModels.Chat.GPT4oMini,
310310
temperature = 1.0,
311311
toolRegistry = toolRegistry,
312312
maxIterations = 2,

agents/agents-test/src/jvmTest/kotlin/ai/koog/agents/test/TokenCountTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class TokenCountTest {
105105

106106
AIAgent(
107107
systemPrompt = systemPrompt,
108-
llmModel = OpenAIModels.CostOptimized.GPT4oMini,
108+
llmModel = OpenAIModels.Chat.GPT4oMini,
109109
temperature = 0.0,
110110
maxIterations = 3,
111111
promptExecutor = testExecutor,
@@ -138,7 +138,7 @@ class TokenCountTest {
138138

139139
AIAgent(
140140
systemPrompt = systemPrompt,
141-
llmModel = OpenAIModels.CostOptimized.GPT4oMini,
141+
llmModel = OpenAIModels.Chat.GPT4oMini,
142142
temperature = 0.0,
143143
toolRegistry = toolRegistry,
144144
maxIterations = 5,
@@ -174,7 +174,7 @@ class TokenCountTest {
174174

175175
AIAgent(
176176
systemPrompt = systemPrompt,
177-
llmModel = OpenAIModels.CostOptimized.GPT4oMini,
177+
llmModel = OpenAIModels.Chat.GPT4oMini,
178178
temperature = 0.0,
179179
toolRegistry = toolRegistry,
180180
maxIterations = 5,
@@ -216,7 +216,7 @@ class TokenCountTest {
216216

217217
AIAgent(
218218
systemPrompt = systemPrompt,
219-
llmModel = OpenAIModels.CostOptimized.GPT4oMini,
219+
llmModel = OpenAIModels.Chat.GPT4oMini,
220220
temperature = 0.0,
221221
toolRegistry = toolRegistry,
222222
maxIterations = 5,

docs/docs/examples/Banking.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ import kotlinx.coroutines.runBlocking
207207

208208
val transferAgentService = AIAgentService(
209209
executor = openAIExecutor,
210-
llmModel = OpenAIModels.Reasoning.GPT4oMini,
210+
llmModel = OpenAIModels.Chat.GPT4oMini,
211211
systemPrompt = bankingAssistantSystemPrompt,
212212
temperature = 0.0, // Use deterministic responses for financial operations
213213
toolRegistry = ToolRegistry {
@@ -436,7 +436,7 @@ class TransactionAnalysisTools : ToolSet {
436436
```kotlin
437437
val analysisAgentService = AIAgentService(
438438
executor = openAIExecutor,
439-
llmModel = OpenAIModels.Reasoning.GPT4oMini,
439+
llmModel = OpenAIModels.Chat.GPT4oMini,
440440
systemPrompt = "$bankingAssistantSystemPrompt\n$transactionAnalysisPrompt",
441441
temperature = 0.0,
442442
toolRegistry = ToolRegistry {
@@ -543,7 +543,7 @@ val strategy = strategy<String, String>("banking assistant") {
543543
)
544544
),
545545
fixingParser = StructureFixingParser(
546-
model = OpenAIModels.CostOptimized.GPT4oMini,
546+
model = OpenAIModels.Chat.GPT4oMini,
547547
retries = 2,
548548
)
549549
)
@@ -689,7 +689,7 @@ import ai.koog.agents.core.tools.ToolParameterType
689689

690690
val classifierAgent = AIAgent(
691691
executor = openAIExecutor,
692-
llmModel = OpenAIModels.Reasoning.GPT4oMini,
692+
llmModel = OpenAIModels.Chat.GPT4oMini,
693693
toolRegistry = ToolRegistry {
694694
tool(AskUser)
695695

docs/docs/examples/Chess.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ val toolRegistry = ToolRegistry { tools(listOf(Move(game))) }
380380
val agent = AIAgent(
381381
executor = baseExecutor,
382382
strategy = strategy,
383-
llmModel = OpenAIModels.Reasoning.O3Mini,
383+
llmModel = OpenAIModels.Chat.O3Mini,
384384
systemPrompt = """
385385
You are an agent who plays chess.
386386
You should always propose a move in response to the "Your move!" message.
@@ -398,7 +398,8 @@ val agent = AIAgent(
398398
Here we assemble all components into a functional chess-playing agent:
399399

400400
**Key Configuration:**
401-
- **Model Choice**: Using `OpenAIModels.Reasoning.O3Mini` for high-quality chess play
401+
402+
- **Model Choice**: Using `OpenAIModels.Chat.O3Mini` for high-quality chess play
402403
- **Temperature**: Set to 0.0 for deterministic, strategic moves
403404
- **System Prompt**: Carefully crafted instructions emphasizing legal moves and proper behavior
404405
- **Tool Registry**: Provides the agent access to the Move tool
@@ -615,7 +616,7 @@ val toolRegistry = ToolRegistry { tools(listOf(Move(game))) }
615616
val agent = AIAgent(
616617
executor = promptExecutor,
617618
strategy = strategy,
618-
llmModel = OpenAIModels.Reasoning.O3Mini,
619+
llmModel = OpenAIModels.Chat.O3Mini,
619620
systemPrompt = """
620621
You are an agent who plays chess.
621622
You should always propose a move in response to the "Your move!" message.
@@ -760,7 +761,7 @@ val toolRegistry = ToolRegistry { tools(listOf(Move(game))) }
760761
val agent = AIAgent(
761762
executor = baseExecutor,
762763
strategy = strategy,
763-
llmModel = OpenAIModels.Reasoning.O3Mini,
764+
llmModel = OpenAIModels.Chat.O3Mini,
764765
systemPrompt = """
765766
You are an agent who plays chess.
766767
You should always propose a move in response to the "Your move!" message.

0 commit comments

Comments
 (0)