AI.CompletionAPI (fnord v0.8.27)

View Source

Summary

Types

model()

@type model() :: AI.Model.t()

msg_response()

@type msg_response() :: {:ok, :msg, binary(), usage()}

msgs()

@type msgs() :: [map()]

response()

@type response() ::
  msg_response()
  | tool_response()
  | {:error, map()}
  | {:error, :api_unavailable}
  | {:error, :context_length_exceeded}

response_format()

@type response_format() :: nil | map()

tool_response()

@type tool_response() :: {:ok, :tool, [map()]}

tools()

@type tools() :: nil | [AI.Tools.tool_spec()]

usage()

@type usage() :: integer()

Functions

get(model, msgs, tools \\ nil, response_format \\ nil)

@spec get(model(), msgs(), tools(), response_format()) :: response()