AxiomAi.Client (AxiomAI v0.1.9)

View Source

Client struct and core functionality for AxiomAI.

Summary

Functions

Sends a chat message using the configured provider.

Sends a chat message with system prompt, history, and user prompt using the configured provider.

Generates a completion using the configured provider.

Streams a chat message using the configured provider.

Streams a chat message with system prompt, history, and user prompt using the configured provider.

Types

t()

@type t() :: %AxiomAi.Client{config: map(), provider: atom()}

Functions

chat(client, message)

@spec chat(t(), String.t()) :: {:ok, map()} | {:error, any()}

Sends a chat message using the configured provider.

chat(client, system_prompt, history, prompt)

@spec chat(t(), String.t(), list(), String.t()) :: {:ok, map()} | {:error, any()}

Sends a chat message with system prompt, history, and user prompt using the configured provider.

complete(client, prompt, options)

@spec complete(t(), String.t(), map()) :: {:ok, map()} | {:error, any()}

Generates a completion using the configured provider.

stream(client, message)

@spec stream(t(), String.t()) :: {:ok, Enumerable.t()} | {:error, any()}

Streams a chat message using the configured provider.

stream(client, system_prompt, history, prompt)

@spec stream(t(), String.t(), list(), String.t()) ::
  {:ok, Enumerable.t()} | {:error, any()}

Streams a chat message with system prompt, history, and user prompt using the configured provider.