feat(model/openai): add Responses API ChatModel - #1002
Open
jesse-engineer wants to merge 2 commits into
Open
jesse-engineer wants to merge 2 commits into
jesse-engineer wants to merge 2 commits into
Conversation
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.
What type of PR is this?
feat
Check the PR title.
Detailed description
Applications using
schema.MessageandToolCallingChatModelcurrently need a custom adapter to call/v1/responses. This addsNewResponsesChatModelandResponsesChatModelConfigtocomponents/model/openai, so these applications can use Responses with their existing message history and middleware.NewChatModelcontinues to use Chat Completions.The new adapter supports generation and streaming, text/image inputs, custom function calls and tool choice, Eino callbacks, response/request IDs, token usage, and optional stored-response continuation. Encrypted reasoning items are retained in
Message.Extraand restored after session serialization. Failed/cancelled responses and truncated streams return errors; refusals and output limits retain meaningful finish reasons. SDK retries are disabled for application/ADK retry ownership.An optional
StreamEventHandlerlets applications classify gateway-specific SSE events using their own error types. Immediate errors stop and close the stream; incomplete-stream errors apply only when no terminal response arrives. Standard terminal responses and SDK/transport errors retain precedence, and fallback state is isolated per stream. No gateway-specific event handling is built into the component.agenticopenairemains the provider-nativeAgenticMessageimplementation. This proposal addresses the classic-message compatibility use case discussed in #758 and #782; it does not expose hosted tools or arbitrary native content blocks.Compatibility: the official SDK dependency is
github.com/openai/openai-go/v3 v3.35.0, matching the version currently used byagenticopenaion main. This raises this module's minimum Go version from 1.18 to 1.22. The Eino dependency remains v0.7.13.Validation
go test -race -gcflags="all=-N -l" .pass.govet,ineffassign,unused): 0 issues; goimports and git whitespace checks pass.