Skip to content

feat: support responses api in kagent harness - #2369

Merged
EItanya merged 6 commits into
kagent-dev:mainfrom
supreme-gg-gg:feat/responses-api
Jul 31, 2026
Merged

EItanya merged 6 commits into
kagent-dev:mainfrom
supreme-gg-gg:feat/responses-api

Conversation

@supreme-gg-gg

@supreme-gg-gg supreme-gg-gg commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Users can now use the Responses API either directly with OpenAI or via a gateway like AgentGateway. Here's an example with agent gateway.

apiVersion: kagent.dev/v1alpha2
kind: ModelConfig
metadata:
  name: openai-responses
  namespace: kagent
spec:
  provider: OpenAI
  model: gpt-5.4-mini
  apiKeyPassthrough: true
  openAI:
    baseUrl: http://agentgateway-proxy.agentgateway-system.svc/openai
    apiFormat: responses # NEW! <- If not provided, uses chat completions API

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.

Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 30, 2026
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
@supreme-gg-gg
supreme-gg-gg marked this pull request as ready for review July 31, 2026 15:55
@supreme-gg-gg
supreme-gg-gg requested a review from a team as a code owner July 31, 2026 15:55
Copilot AI review requested due to automatic review settings July 31, 2026 15:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.


// OpenAI API format values (ModelConfig openAI.apiFormat).
const (
OpenAIAPIFormatChatCompletions = "chatCompletions"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just call this completions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately OpenAI has a deprecated API called "completions" which is the legacy version of "chat completions", so it might be a bit confusing

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok cool, I didn’t know that

type OpenAIAPIFormat string

const (
OpenAIAPIFormatChatCompletions OpenAIAPIFormat = "chatCompletions"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment

@@ -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] {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be separate structs since they don't really share much?

@supreme-gg-gg supreme-gg-gg Jul 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@EItanya
EItanya enabled auto-merge (squash) July 31, 2026 19:21
@EItanya
EItanya merged commit fad2d0c into kagent-dev:main Jul 31, 2026
44 of 56 checks passed
EItanya pushed a commit that referenced this pull request Jul 31, 2026
#2369

Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
onematchfox added a commit to onematchfox/kagent that referenced this pull request Sep 3, 2026
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>
onematchfox added a commit to onematchfox/kagent that referenced this pull request Sep 3, 2026
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>
onematchfox added a commit to onematchfox/kagent that referenced this pull request Sep 4, 2026
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>
onematchfox added a commit to onematchfox/kagent that referenced this pull request Sep 4, 2026
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>
EItanya added a commit that referenced this pull request Sep 4, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

⌂ 换网址