Skip to content

feat(arkruntime): Responses API pre-serialized JSON body helpers#151

Open
jesse-engineer wants to merge 1 commit into
volcengine:masterfrom
jesse-engineer:feat/arkruntime-responses-json-body
Open

feat(arkruntime): Responses API pre-serialized JSON body helpers#151
jesse-engineer wants to merge 1 commit into
volcengine:masterfrom
jesse-engineer:feat/arkruntime-responses-json-body

Conversation

@jesse-engineer
Copy link
Copy Markdown

Summary

Adds exported helpers for callers that need to send a pre-built JSON body to the Responses API (for example after merging vendor-specific top-level fields that are not modeled on *responses.ResponsesRequest).

Changes

  • PreprocessResponsesRequest: wraps existing multimodal preprocessing (preprocessResponseInput) so callers can preprocess, then serialize, then send custom JSON.
  • CreateResponsesFromJSON / CreateResponsesStreamFromJSON: POST the given JSON bytes using the same auth, URL, and retry path as existing CreateResponses.

Motivation

Downstream (for example cloudwego/eino-ext ark chat model) needs WithExtraFields-style behavior: merge extra keys into the wire JSON after the request struct is built and after file uploads run.

Notes

Streaming JSON must include stream: true before calling CreateResponsesStreamFromJSON.

Made with Cursor

Add requestOption WithResponsesExtraFields to shallow-merge top-level keys into the wire JSON when the body is *responses.ResponsesRequest. Merge runs in newRequest after all setters, so multimodal preprocessing is included.

CreateResponses / CreateResponsesStream usage is unchanged.

Made-with: Cursor
@jesse-engineer jesse-engineer force-pushed the feat/arkruntime-responses-json-body branch from 5ca1476 to d3ac2be Compare April 28, 2026 15:20
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.

1 participant