Skip to content

feat(responses): support hosted file_search on Chat Completions backends - #915

Open
leseb wants to merge 4 commits into
praxis-proxy:mainfrom
leseb:leseb/issue-296-fix
Open

feat(responses): support hosted file_search on Chat Completions backends#915
leseb wants to merge 4 commits into
praxis-proxy:mainfrom
leseb:leseb/issue-296-fix

Conversation

@leseb

@leseb leseb commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

OpenAI Responses requests that use the hosted file_search tool can now target backends that only implement /v1/chat/completions. The responses_to_chat_completions translation privately synthesizes file_search into a chat function and forces tool_choice on 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 hosted file_search_call in the final Responses output, and the original tool_choice is preserved on ResponsesState across 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

  • Unit tests — cargo test -p praxis-ai-apis (2664 passed)
  • Integration or functional tests — cargo test -p praxis-tests-integration file_search_chat (3 functional example tests, using mock chat + search backends); new live OGX + vLLM SDK test TestFileSearchChatCompletionsVLLM (runs in the vLLM Integration workflow); cargo xtask check-inference and make test-inference-fixtures (inference-fixture replay).
  • make lint (and make build)

Checklist

  • I reviewed every changed line and can explain the change.
  • New capabilities include an example config and functional example test.
  • User-facing behavior and generated documentation are updated.
  • Performance-sensitive changes include appropriate benchmark or load-test evidence. — N/A: finite, non-streaming path only; no performance-sensitive change.
  • Commits are signed and include a Signed-off-by trailer.

Breaking changes

None. The behavior is opt-in via the responses_to_chat_completions filter in a dedicated example pipeline; existing pipelines are unaffected.

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>
@leseb
leseb requested review from a team and nerdalert September 3, 2026 13:23
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(openai): synthesize file_search for Chat Completions backends

1 participant