Function: encodeGatewayResponse()
encodeGatewayResponse(
protocol,model,generation):Record<string,unknown>
Encode a completed AI SDK generation as one protocol-native JSON response.
Parameters
Section titled “Parameters”protocol
Section titled “protocol”"openai-responses" | "openai-chat" | "anthropic-messages" | "openai-embeddings"
string
generation
Section titled “generation”Returns
Section titled “Returns”Record<string, unknown>