Skip to content

Handle provider error-response shapes in the normalized adapters #7

Description

@glamberson

Summary

Some providers return an error-shaped body where a success body is expected (e.g. Ollama returns { "error": ... } instead of { model, ..., done }). The normalized response types (NormalizedResponse / ContentBlock in laminate/src/provider/mod.rs) have no error representation, so an error body fails to parse as a normal response with an unhelpful message.

Proposal

Add a representation for provider error responses (e.g. a ContentBlock::Error { message } variant or a typed error result), and detect the common error shapes in the adapters so callers get a clear, typed signal.

Acceptance

  • Error-shaped bodies parse into a clear error representation rather than a generic deserialize failure.
  • Tests for at least the Ollama error shape. 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