View Source AI.Response (fnord v0.4.42)

This module sends a request to the model and handles the response. It is able to handle tool calls and responses. If the caller includes an on_event function, it will be called whenever a tool call is performed or if a tool call results in an error.

Summary

Types

context_window_usage()

@type context_window_usage() :: {String.t(), String.t()}

response()

@type response() :: {:ok, String.t(), context_window_usage()}

Functions

get(ai, opts)

@spec get(
  AI.t(),
  keyword()
) :: response()

get_completion(state)

handle_tool_call(state, map)