feat(responses): support hosted file_search on Chat Completions backends - #915
Open
leseb wants to merge 4 commits into
Open
feat(responses): support hosted file_search on Chat Completions backends#915leseb wants to merge 4 commits into
leseb wants to merge 4 commits into
Conversation
OpenAI Responses requests that use the hosted file_search tool can now target backends that only implement /v1/chat/completions. The new responses_to_chat_completions filter privately synthesizes file_search into a chat function tool and forces tool_choice on the first round; the existing file-search callout executes the returned call against the vector store, and one more finite inference round produces the answer. The synthesized function never leaks to the client -- it is normalized back to a hosted file_search_call in the final Responses output, and the original tool_choice is preserved on ResponsesState across the loop. Adds the file-search-chat-completions example pipeline, a functional example test, a live OGX + vLLM integration test, an inference-fixture scenario with a synthetic recording, and updates the coverage manifest and generated documentation. Refs praxis-proxy#296 Signed-off-by: Sébastien Han <seb@redhat.com>
…xamples Rebasing onto main picked up praxis-proxy#700, which renamed the responses_to_chat_completions body cap from max_body_bytes to max_rewritten_body_bytes. Update the file-search-chat-completions example and its inference-fixture config to the new field name so the pipeline builds under deny_unknown_fields. Refs praxis-proxy#296 Signed-off-by: Sébastien Han <seb@redhat.com>
…fixture The file_search_chat_proxy fixture called _wait_for_proxy(port) with a single argument, but the helper requires (port, proc, log_path) to detect early process exit and surface the proxy log tail on failure. The missing arguments raised TypeError during vLLM integration setup, failing both vllm-responses and vllm-responses-postgres. Align the call with the other three call sites. Signed-off-by: Sébastien Han <seb@redhat.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OpenAI Responses requests that use the hosted
file_searchtool can now target backends that only implement/v1/chat/completions. Theresponses_to_chat_completionstranslation privately synthesizesfile_searchinto a chatfunctionand forcestool_choiceon the first round; the existing file-search callout runs the returned call against the vector store, then one more finite inference round produces the answer. The synthesized function never leaks to the client — it is normalized back to a hostedfile_search_callin the final Responses output, and the originaltool_choiceis preserved onResponsesStateacross the loop. This is the smallest complete change because it reuses the existing callout and iterative-request-router loop, adding only the private translation plus its example pipeline, tests, and inference-fixture coverage.Related issue
Closes #296
Validation
cargo test -p praxis-ai-apis(2664 passed)cargo test -p praxis-tests-integration file_search_chat(3 functional example tests, using mock chat + search backends); new live OGX + vLLM SDK testTestFileSearchChatCompletionsVLLM(runs in the vLLM Integration workflow);cargo xtask check-inferenceandmake test-inference-fixtures(inference-fixture replay).make lint(andmake build)Checklist
Signed-off-bytrailer.Breaking changes
None. The behavior is opt-in via the
responses_to_chat_completionsfilter in a dedicated example pipeline; existing pipelines are unaffected.