Specify tools array when calling /chat/completions endpoint #3705
freddygv
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently tool usage seems to only be specified via prompts.
That differs from how OpenAI expects function calling to happen, where tools are specified in a tools array:
https://platform.openai.com/docs/guides/function-calling?api-mode=chat&example=get-weather
This is likely leading to the issues where otherwise very smart models like o3 end up being awful at tool usage, despite OpenAI having trained them on it.
Calls to these endpoints should specify available tools with a JSON schema, as is done in the Codex CLI:
https://github.com/openai/codex/blob/f3bde217594e8be956a6583fde237f89fe2dd7c0/codex-cli/src/utils/responses.ts#L249-L289
Some open questions as someone not familiar with the codebase:
Beta Was this translation helpful? Give feedback.
All reactions