Merge pull request #4062 from pczekaj/o3-mini-tools

Add tools support for o3-mini
This commit is contained in:
Nate Sesti 2025-02-10 21:19:40 -08:00 • committed by GitHub
commit 732eb248b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -267,7 +267,7 @@ class OpenAI extends BaseLLM {
body.max_completion_tokens = undefined;
}
if (body.tools?.length) {
if (body.tools?.length && !body.model?.startsWith("o3")) {
// To ensure schema adherence: https://platform.openai.com/docs/guides/function-calling#parallel-function-calling-and-structured-outputs
// In practice, setting this to true and asking for multiple tool calls
// leads to "arguments" being something like '{"file": "test.ts"}{"file": "test.js"}'

View file

@ -13,7 +13,7 @@ export const PROVIDER_TOOL_SUPPORT: Record<
},
openai: (model) => {
// https://platform.openai.com/docs/guides/function-calling#models-supporting-function-calling
if (model.toLowerCase().startsWith("gpt-4")) {
if (model.toLowerCase().startsWith("gpt-4") || model.toLowerCase().startsWith("o3")) {
return true;
}
},