Skip to content

fix: introduce create_tools_json() and share it with chat_completions.rs#1177

Merged
bolinfest merged 1 commit intomainfrom
pr1177
May 30, 2025
Merged

fix: introduce create_tools_json() and share it with chat_completions.rs#1177
bolinfest merged 1 commit intomainfrom
pr1177

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented May 30, 2025

The main motivator behind this PR is that stream_chat_completions() was not adding the "tools" entry to the payload posted to the /chat/completions endpoint. This (1) refactors the existing logic to build up the "tools" JSON from client.rs into openai_tools.rs, and (2) updates the use of responses API (client.rs) and chat completions API (chat_completions.rs) to both use it.

Note this PR alone is not sufficient to get tool calling from chat completions working: that is done in #1167.


Stack created with Sapling. Best reviewed with ReviewStack.

@bolinfest bolinfest merged commit 1bf8205 into main May 30, 2025
18 checks passed
@bolinfest bolinfest deleted the pr1177 branch May 30, 2025 21:07
@github-actions github-actions Bot locked and limited conversation to collaborators May 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant