OllamaClient.embed

Generates an embedding vector for a single text input.

  1. JSONValue embed(string model, string input, string keepAlive)
    class OllamaClient
    @safe
    JSONValue
    embed
    (
    string model
    ,
    string input
    ,
    string keepAlive = null
    )
  2. JSONValue embed(string model, string[] inputs, string keepAlive)

Parameters

model string

Embedding model name (e.g. "nomic-embed-text").

input string

Text to embed.

keepAlive string

How long to keep the model loaded.

Return Value

Type: JSONValue

A JSONValue with an "embeddings" array containing one vector.

Meta