embed


Description:

public async Embed embed (string model, string input, int dimensions = -1, bool truncate = false, Options? options = null, Cancellable? cancellable = null) throws Error

Generates embeddings for the input text.

Creates vector embeddings representing the input text using the specified model. Returns a single Response.Embed object containing the embeddings and metadata.

Parameters:

model

The model name to use for generating embeddings

input

The text to generate embeddings for

dimensions

Optional number of dimensions to generate embeddings for (default: -1, not set)

truncate

Optional whether to truncate inputs that exceed context window (default: false)

options

Optional Call.Options for the embed request

cancellable

Optional cancellable for cancelling the request

Returns:

Response.Embed object with embeddings and timing information

Since:

1.0