Mnemosyne.ModelCall (mnemosyne v0.4.0)

Copy Markdown View Source

Emits repository-attributed telemetry around model adapter calls.

Summary

Functions

Invokes an LLM chat call with optional repository-attributed telemetry.

Invokes a structured LLM chat call with optional repository-attributed telemetry.

Invokes one embedding call with optional repository-attributed telemetry.

Invokes a batched embedding call with optional repository-attributed telemetry.

Functions

chat(context, adapter, step, messages, opts)

@spec chat(
  Mnemosyne.ModelCall.Context.t() | nil,
  module(),
  atom(),
  [Mnemosyne.LLM.message()],
  keyword()
) :: {:ok, Mnemosyne.LLM.Response.t()} | {:error, term()}

Invokes an LLM chat call with optional repository-attributed telemetry.

chat_structured(context, adapter, step, messages, schema, opts)

@spec chat_structured(
  Mnemosyne.ModelCall.Context.t() | nil,
  module(),
  atom(),
  [Mnemosyne.LLM.message()],
  term(),
  keyword()
) :: {:ok, Mnemosyne.LLM.Response.t()} | {:error, term()}

Invokes a structured LLM chat call with optional repository-attributed telemetry.

embed(context, adapter, step, text, opts)

@spec embed(
  Mnemosyne.ModelCall.Context.t() | nil,
  module(),
  atom(),
  String.t(),
  keyword()
) ::
  {:ok, Mnemosyne.Embedding.Response.t()} | {:error, term()}

Invokes one embedding call with optional repository-attributed telemetry.

embed_batch(context, adapter, step, texts, opts)

@spec embed_batch(
  Mnemosyne.ModelCall.Context.t() | nil,
  module(),
  atom(),
  [String.t()],
  keyword()
) ::
  {:ok, Mnemosyne.Embedding.Response.t()} | {:error, term()}

Invokes a batched embedding call with optional repository-attributed telemetry.