/** * MiniMax Adapter * * Integrates MiniMax LLM API (OpenAI-compatible chat completions) with * the SwarmOrchestrator. Supports MiniMax-M2.5 and MiniMax-M2.5-highspeed * models with 204K context window. * * Usage — built-in fetch: * const adapter = new MiniMaxAdapter(); * adapter.registerAgent('analyst', { * model: 'MiniMax-M2.5', * apiKey: process.env.MINIMAX_API_KEY, * systemPrompt: 'You are an expert analyst.', * }); * * Usage — bring-your-own client (any OpenAI-compatible SDK): * adapter.registerAgent('fast', { * model: 'MiniMax-M2.5-highspeed', * client: openaiCompatibleInstance.chat.completions, * }); * * @module MiniMaxAdapter * @version 1.0.0 */ import { BaseAdapter } from './base-adapter'; import type { AdapterCapabilities, AgentPayload, AgentContext, AgentResult } from '../types/agent-adapter'; /** * Minimal interface for an OpenAI-compatible chat completions client. * Users supply their own SDK instance; no hard dependency. */ export interface MiniMaxChatClient { create(params: { model: string; messages: Array<{ role: string; content: string; }>; max_tokens?: number; temperature?: number; stop?: string[]; }): Promise<{ choices: Array<{ message?: { content?: string | null; }; text?: string; }>; usage?: { prompt_tokens: number; completion_tokens: number; total_tokens: number; }; }>; } /** Configuration for a registered MiniMax agent */ export interface MiniMaxAgentConfig { /** Model name — e.g. 'MiniMax-M2.5', 'MiniMax-M2.5-highspeed' */ model?: string; /** MiniMax API key — falls back to MINIMAX_API_KEY env var */ apiKey?: string; /** Base URL override (default: 'https://api.minimax.io/v1') */ baseUrl?: string; /** System-level prompt prepended to every request */ systemPrompt?: string; /** Maximum tokens in the completion */ maxTokens?: number; /** Temperature — must be in (0.0, 1.0]. MiniMax rejects 0. Default: 0.7 */ temperature?: number; /** Stop sequences */ stop?: string[]; /** * Bring-your-own OpenAI-compatible chat completions instance. * If supplied, apiKey / baseUrl are ignored and this client is used directly. */ client?: MiniMaxChatClient; /** Additional headers to send with fetch-based requests */ headers?: Record; /** Request timeout in milliseconds (default: 120000) */ timeout?: number; } /** * Adapter that connects MiniMax LLM models to the SwarmOrchestrator. * Uses MiniMax's OpenAI-compatible chat completions API. * * Available models: * - MiniMax-M2.5 — flagship model with 204K context * - MiniMax-M2.5-highspeed — faster variant optimised for throughput */ export declare class MiniMaxAdapter extends BaseAdapter { readonly name = "minimax"; readonly version = "1.0.0"; private agents; get capabilities(): AdapterCapabilities; /** * Register a MiniMax-powered agent. * * @param agentId Unique identifier used in `delegateTask` calls. * @param config MiniMax agent configuration. */ registerAgent(agentId: string, config?: MiniMaxAgentConfig): void; executeAgent(agentId: string, payload: AgentPayload, context: AgentContext): Promise; private _executeChat; } //# sourceMappingURL=minimax-adapter.d.ts.map