Skip to content

Support the OpenAI Responses API (output[]) in the provider adapter #5

Description

@glamberson

Summary

The OpenAI adapter parses Chat Completions (choices[].message) only — see parse_openai_response in laminate/src/provider/openai.rs. The newer Responses API returns a typed output[] array of heterogeneous items (message / reasoning / function_call) with no choices wrapper.

Proposal

Add parsing for the Responses API shape (e.g. parse_openai_responses_response) that produces the same NormalizedResponse, handling the output[] item array and the renamed usage fields (input_tokens/output_tokens). Keep the Chat Completions path intact.

Acceptance

  • Responses-API bodies parse into NormalizedResponse.
  • Tests for message, function_call, and usage. Targets 0.2.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions