Packages@robojs/ai
DIRECTORY
API reference for @robojs/ai
@robojs/ai
API reference documentation for @robojs/ai.
Classes
BaseEngine- Abstract base class to be extended by AI engine implementations.OpenAiEngine- Coordinates OpenAI powered chat, tool calling, voice, and media capabilities for Robo.js.TokenLimitError- Error thrown when ablockmode limit has been exceeded.
Interfaces
ChatFunctionCall- Invocation payload provided when an engine requests tool execution.ChatFunctionParameters- JSON schema snippet describing function parameters accepted by a chat tool.ChatFunctionProperty- Schema fragment representing a property definition within ChatFunctionParameters.ChatFunction- Definition describing an available tool or function call that an engine may invoke.ChatHookContext- Hook function invoked during message orchestration.ChatMessage- Normalized representation of a chat message exchanged with an engine.ChatOptions- Options controlling a chat invocation.ChatReply- Represents a reply generated by the chat engine, including optional Discord payloads.ChatResult- Normalized chat response structure returned by engines.ConversationInput- Optional conversation metadata supplied when invoking BaseEngine.chat.ConversationState- Snapshot describing an active or previous conversation.EngineSupportedFeatures- Enumerates feature flags describing the optional capabilities an engine exposes.GenerateImageOptions- Parameters accepted by BaseEngine.generateImage requests.GenerateImageResult- Result returned by BaseEngine.generateImage.McpCallMcpTool- Configuration for an MCP (Model Context Protocol) server tool.OpenAiEngineOptionsPluginOptions- Plugin configuration structure resolved during initialization.PluginUsageOptions- Token usage configuration including limit rules and hooks.ReplyHookContextTokenLedgerConfiguration- Configuration object applied when initializing or reconfiguring the ledger.TokenLedgerHooks- Optional hook callbacks invoked during ledger operations.TokenLimitBreach- Snapshot describing how a limit was breached.TokenLimitConfig- Token limit configuration keyed by model identifier.TokenLimitErrorContext- Context supplied when constructing a TokenLimitError.TokenLimitRule- Configuration describing a single token limit rule.TokenLimitState- Snapshot describing the real-time state of token limits for a model.TokenRecordOptions- Options accepted by recordUsage when logging token consumption.TokenRecordResult- Response returned after successfully recording usage.TokenSummaryQuery- Parameters controlling usage summary retrieval.TokenSummaryResult- Result structure produced by getSummary.TokenUsageEntry- Individual token usage record persisted to Flashcore.TokenWindowTotals- Aggregate token counts for a given window.UsageLimitEvent- Event payload emitted when usage breaches at least one limit.UsageRecordedEvent- Event payload describing recorded usage and updated totals.VoiceChatMetadata- Supplemental metadata describing a voice interaction.VoiceChatOptions- Additional configuration applied when orchestrating a voice-enabled chat.VoiceChatResult- Voice-specific response envelope accompanying chat results.VoiceInputFrame- Audio frame delivered to the engine when streaming microphone input.VoicePlaybackDelta- Delta describing audio playback data streamed to the caller.VoiceSessionHandle- Handle returned by BaseEngine.startVoiceSession to control an active session.VoiceSessionStartOptions- Configuration structure used when starting a managed voice session.VoiceTranscriptSegment- Transcription segment produced during a voice session.
Type Aliases
ChatHookChatMessageContent- Union representing plain text or an array of structured content entries.HookEventHookReplyHookTokenLimitMode- Mode applied when a usage limit is reached.TokenSummaryWindow- Sliding windows used when summarizing token usage.TokenWindow- Token window identifiers including lifetime totals for aggregate queries.UsageEventListener- Listener signature for ledger usage events.UsageEventName- Usage event identifiers emitted by the ledger.VoiceEndpointingStrategy- Strategy describing how voice endpointing should occur.
Variables
Ai- Primary runtime facade for the Robo AI plugin.TokenLedger- High-level facade exposing token accounting utilities, aggregation helpers, and limit.
