View Source AI behaviour (fnord v0.4.15)

AI is a behavior module that defines the interface for interacting with OpenAI's API. It provides a common interface for the various OpenAI-powered operations used by the application.

Summary

Functions

See AI.EmbeddingsAgent.get_embeddings/2.

See AI.FileSummaryAgent.get_summary/3.

Create a new AI instance. Instances share the same client connection.

Callbacks

Link to this callback

get_embeddings(struct, t)

View Source
@callback get_embeddings(
  struct(),
  String.t()
) :: {:ok, [String.t()]} | {:error, term()}
Link to this callback

get_summary(struct, t, t)

View Source
@callback get_summary(struct(), String.t(), String.t()) ::
  {:ok, String.t()} | {:error, term()}
@callback new() :: struct()

Functions

Link to this function

get_embeddings(ai, text)

View Source

See AI.EmbeddingsAgent.get_embeddings/2.

Link to this function

get_summary(ai, file, text)

View Source

See AI.FileSummaryAgent.get_summary/3.

Create a new AI instance. Instances share the same client connection.