Skip to content

Function: encodeGatewayResponse()

encodeGatewayResponse(protocol, model, generation): Record<string, unknown>

Encode a completed AI SDK generation as one protocol-native JSON response.

"openai-responses" | "openai-chat" | "anthropic-messages" | "openai-embeddings"

string

CompletedGeneration

Record<string, unknown>