Normandy.Agents.Model protocol (normandy v0.2.0)

View Source

Protocol for LLM model interactions.

Defines the interface for conversing with language models, supporting both structured outputs and tool calling capabilities.

Summary

Types

t()

All the types that implement this protocol.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

completitions(config, model, temperature, max_tokens, messages, response_model)

@spec completitions(
  t(),
  String.t(),
  float(),
  integer(),
  binary(),
  struct()
) :: struct()

converse(config, model, temperature, max_tokens, messages, response_model, opts \\ [])

@spec converse(t(), String.t(), float(), integer(), list(), struct(), keyword()) ::
  struct()

Converse with the model, optionally providing tool schemas.

Parameters

  • config: Model client configuration
  • model: Model identifier
  • temperature: Sampling temperature (0.0-1.0)
  • max_tokens: Maximum tokens to generate
  • messages: List of conversation messages
  • response_model: Expected response schema
  • opts: Optional keyword list with :tools key for tool schemas

Returns

Structured response conforming to response_model