ExAgent.Services.OpenAIEmbedService (ExAgent v0.4.1)

Copy Markdown View Source

HTTP service for the OpenAI embeddings API.

OpenAI supports :dimensions but has no notion of a task type. A non-nil :task is rejected rather than dropped - a silently discarded task produces vectors that look fine and retrieve badly.

Summary

Functions

Generates embeddings for inputs.

Returns the task atoms this service accepts - none.

Functions

embed(provider, inputs, opts \\ [])

Generates embeddings for inputs.

Options

  • :model - defaults to "text-embedding-3-small"
  • :dimensions - truncate output to this many dimensions
  • :task - unsupported; any non-nil value returns an error
  • :args - encoding_format ("float" or "base64") and user; any other key is rejected
  • :receive_timeout - milliseconds to wait for the response; defaults to the provider's :receive_timeout

tasks()

@spec tasks() :: [ExAgent.Embeddings.task()]

Returns the task atoms this service accepts - none.