Skip to content

fix: add oneOf override for EmbedByTypeResponse embeddings field#693

Open
fern-support wants to merge 1 commit intomainfrom
fern-support/fix-embeddings-spec
Open

fix: add oneOf override for EmbedByTypeResponse embeddings field#693
fern-support wants to merge 1 commit intomainfrom
fern-support/fix-embeddings-spec

Conversation

@fern-support
Copy link
Collaborator

The embeddings field in EmbedByTypeResponse was defined as type: object with a stray items key that was ignored by spec-compliant parsers. When the API returns embeddings as a flat array (when embedding_types is omitted), the SDK crashes with TypeError because it only models the object shape.

This adds an OpenAPI overrides file that replaces the embeddings field with a oneOf union (EmbedByTypeResponseEmbeddingsUnion) supporting both:

  • The existing object shape (EmbedByTypeResponseEmbeddings) with typed keys
  • A flat array of number arrays

Addresses cohere-ai/cohere-python#719

The embeddings field in EmbedByTypeResponse was defined as type: object
with a stray `items` key that was ignored by spec-compliant parsers.
When the API returns embeddings as a flat array (when embedding_types
is omitted), the SDK crashes with TypeError because it only models
the object shape.

This adds an OpenAPI overrides file that replaces the embeddings field
with a oneOf union (EmbedByTypeResponseEmbeddingsUnion) supporting both:
- The existing object shape (EmbedByTypeResponseEmbeddings) with typed keys
- A flat array of number arrays

Fixes cohere-ai/cohere-python#719

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link

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