Repository navigation
feat: support responses api in kagent harness - #2369
Conversation
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
|
|
||
| // OpenAI API format values (ModelConfig openAI.apiFormat). | ||
| const ( | ||
| OpenAIAPIFormatChatCompletions = "chatCompletions" |
There was a problem hiding this comment.
Can we just call this completions?
There was a problem hiding this comment.
Unfortunately OpenAI has a deprecated API called "completions" which is the legacy version of "chat completions", so it might be a bit confusing
There was a problem hiding this comment.
Ok cool, I didn’t know that
| type OpenAIAPIFormat string | ||
|
|
||
| const ( | ||
| OpenAIAPIFormatChatCompletions OpenAIAPIFormat = "chatCompletions" |
| @@ -128,7 +128,6 @@ func (m *OpenAIModel) Name() string { | |||
| // GenerateContent implements model.LLM. Uses only ADK/genai types. | |||
| func (m *OpenAIModel) GenerateContent(ctx context.Context, req *model.LLMRequest, stream bool) iter.Seq2[*model.LLMResponse, error] { | |||
There was a problem hiding this comment.
Should these be separate structs since they don't really share much?
There was a problem hiding this comment.
the OpenAIModel struct contains shared config, client, logging setup (in openai.go), and this structure represents a "model provider" so imo there should only be one of it, and it would handle the response formats internally. I've made a change to make the api format handling cleaner in b36dd6f
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
#2369 Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
Responses API is required in order to use reasoning effort with newer Open AI models. kagent-dev#2369 (backported to `v0.10.x` in kagent-dev#2375) introduced support for use of the Responses API (configured via ModelConfig). However, that PR was strictly limited to golang agents and at present Python agents completely ignore the configuration and as such requests to a new model configured with reasoning effort will fail. This PR completes kagent-dev#2369 by ensuring that Python ADK agents also make use of the Responses API as per model configuration. Signed-off-by: Brian Fox <878612+onematchfox@users.noreply.github.com>
Responses API is required in order to use reasoning effort with newer Open AI models. kagent-dev#2369 (backported to `v0.10.x` in kagent-dev#2375) introduced support for use of the Responses API (configured via ModelConfig). However, that PR was strictly limited to golang agents and at present Python agents completely ignore the configuration and as such requests to a new model configured with reasoning effort will fail. This PR completes kagent-dev#2369 by ensuring that Python ADK agents also make use of the Responses API as per model configuration. Signed-off-by: Brian Fox <878612+onematchfox@users.noreply.github.com>
Responses API is required in order to use reasoning effort with newer Open AI models. kagent-dev#2369 (backported to `v0.10.x` in kagent-dev#2375) introduced support for use of the Responses API (configured via ModelConfig). However, that PR was strictly limited to golang agents and at present Python agents completely ignore the configuration and as such requests to a new model configured with reasoning effort will fail. This PR completes kagent-dev#2369 by ensuring that Python ADK agents also make use of the Responses API as per model configuration. Signed-off-by: Brian Fox <878612+onematchfox@users.noreply.github.com>
Responses API is required in order to use reasoning effort with newer Open AI models. kagent-dev#2369 (backported to `v0.10.x` in kagent-dev#2375) introduced support for use of the Responses API (configured via ModelConfig). However, that PR was strictly limited to golang agents and at present Python agents completely ignore the configuration and as such requests to a new model configured with reasoning effort will fail. This PR completes kagent-dev#2369 by ensuring that Python ADK agents also make use of the Responses API as per model configuration. Signed-off-by: Brian Fox <878612+onematchfox@users.noreply.github.com>
Responses API is required in order to use reasoning effort with newer Open AI models. #2369 (backported to `v0.10.x` in #2375) introduced support for use of the Responses API (configured via ModelConfig). However, that PR was strictly limited to golang agents and at present Python agents completely ignore the configuration and as such requests to a new model configured with reasoning effort will fail. This PR completes #2369 by ensuring that Python ADK agents also make use of the Responses API as per model configuration. Signed-off-by: Brian Fox <878612+onematchfox@users.noreply.github.com> Co-authored-by: Eitan Yarmush <eitan.yarmush@solo.io>
Users can now use the Responses API either directly with OpenAI or via a gateway like AgentGateway. Here's an example with agent gateway.
Note that certain features from Responses API like native tools and stateful chaining are not supported for now since they're only available when using with OpenAI's servers. For those interested, it can be a follow up to add those features in kagent harness.