View Source AI behaviour (fnord v0.4.1)
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
Get embeddings for the given text. The text is split into chunks of 8192 tokens to avoid exceeding the model's input limit. Returns a list of embeddings for each chunk.
Get a summary of the given text. The text is truncated to 128k tokens to avoid exceeding the model's input limit. Returns a summary of the text.
Create a new AI instance. Instances share the same client connection.
Callbacks
Functions
Get embeddings for the given text. The text is split into chunks of 8192 tokens to avoid exceeding the model's input limit. Returns a list of embeddings for each chunk.
Get a summary of the given text. The text is truncated to 128k tokens to avoid exceeding the model's input limit. Returns a summary of the text.
Create a new AI instance. Instances share the same client connection.