Skip to content

AI SDK embedding requests use a language model and fail before sending #13370

Open

Description

@fhgffy

Embedding requests through the AI SDK adapter fail with TypeError: model.doEmbed is not a function.

On main (5522c6f), construct AiSdkApi with model: "openai/text-embedding-3-small" and call embed({ model: "text-embedding-3-small", input: "hello" }). The adapter gets a language model from the provider's callable interface and passes it to the SDK embedding function. The request fails before reaching the endpoint.

I reproduced this locally with the installed AI SDK. As a control, provider.embeddingModel("text-embedding-3-small") sends the expected /embeddings request and returns the embedding using a mock fetch response.

I plan to select the provider's embedding model with the configured model ID and add single-input and batch regression tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions