Skip to main content
Version: 2.6

@operaide/ai

This library provides aktors to integrate Large Language Models (LLMs) into your Reaktor.

Available Aktors

Here's a short reference of the available aktors from the @operaide/ai library:

AI Interaction Aktors

  • aktorAICall: Calls an AI model with messages and returns the response. Supports both streaming and non-streaming modes.
  • aktorAIEmbedding: Generates embeddings for text using an AI provider.
  • aktorAISettingProviderModel: A setting aktor for the AI provider model with default values.
  • aktorExtractEmbedding: Extracts and stringifies the embedding from an EmbedResult.

Message Formatting Aktors

  • aktorPatchMessages: Adds a system message to the beginning of a message array.
  • aktorSystemPromptAsHistory: Converts a system prompt into a message array with a single system message.
  • aktorUserPromptAsHistory: Converts a user prompt into a message array with a single user message.
  • aktorMessagesFromSystemAndUser: Creates a message array from system and user prompts.

Prompt Handling Aktors

  • aktorCompletePrompt: Fills in a template string with variables, replacing placeholders like {{variable}} with their values.

Tool Integration Aktors

  • aktorToolSet: Creates a toolset by combining multiple tools for use with AI models that support function calling.
  • aktorTool: Internal aktor used to integrate existing tools into the aktor framework.
  • aktorToTool: Converts an aktor to a tool that can be used with aktorToolSet and aktorAICall, returning an Aktor.
  • websearchAiTool: A tool for performing web searches using the Firecrawl API.

Registration Utilities

  • registerChatReaktorDefinition: A utility function for registering chat-compatible reaktor definitions with standardized input and output schemas.

For more detailed information on each aktor, explore the Library using IntelliSense in your IDE!

To view the latest version, please take a look at the Registry