UNPKG

@juspay/neurolink

Version:

The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002

134 lines • 5.19 kB
import { AIProviderName } from "../../constants/enums.js"; /** * Master schema for all text generation options. * This object provides metadata for validation and help text in the CLI loop. * It is derived from the main TextGenerationOptions interface to ensure consistency. */ export const textGenerationOptionsSchema = { provider: { type: "string", description: "The AI provider to use.", allowedValues: Object.values(AIProviderName) .filter((p) => typeof p === "string") .filter((p) => p !== AIProviderName.AUTO), }, model: { type: "string", description: "The specific model to use from the provider.", }, temperature: { type: "number", description: "Controls randomness of the output (e.g., 0.2, 0.8).", }, maxTokens: { type: "number", description: "The maximum number of tokens to generate.", }, compactionThreshold: { type: "number", description: "Fraction of the context window (0-1) at which history is compacted. Default 0.8.", }, topP: { type: "number", description: "Top-p (nucleus) sampling parameter. Controls diversity of generated tokens (0.0-1.0).", }, topK: { type: "number", description: "Top-k sampling parameter. Limits the number of tokens considered (Google/Gemini models only).", }, stopSequences: { type: "string", description: "Stop sequences that will halt generation when encountered (comma-separated).", }, output: { type: "string", description: "AI response format - specify just the format value (e.g., 'json', 'structured'). Note: This is automatically transformed to { format: value } for the API.", allowedValues: ["text", "json", "structured", "none"], }, systemPrompt: { type: "string", description: "The system prompt to guide the AI's behavior.", }, timeout: { type: "number", description: "Timeout for the generation request in milliseconds.", }, turnTimeoutMs: { type: "number", description: "Wall-clock cap for the whole agentic turn in milliseconds (all steps + tool executions).", }, stallTimeoutMs: { type: "number", description: "Maximum time with no progress (no chunk, no tool activity) before the turn ends as stalled, in milliseconds.", }, wrapupTimeLeadMs: { type: "number", description: "Remaining-turn-time threshold that triggers a wrap-up nudge to the model, in milliseconds.", }, toolTimeoutMs: { type: "number", description: "Per-tool-execution timeout in milliseconds (default 300000). A timed-out tool fails that step; the turn continues.", }, disableTools: { type: "boolean", description: "Disable all tool usage for the AI.", }, enabledToolNames: { type: "string", description: 'Comma-separated list of tool names to enable (e.g., "read,write,search").', }, maxSteps: { type: "number", description: "Maximum number of tool execution steps.", }, enableAnalytics: { type: "boolean", description: "Enable or disable analytics for responses.", }, enableEvaluation: { type: "boolean", description: "Enable or disable AI-powered evaluation of responses.", }, evaluationDomain: { type: "string", description: 'Domain expertise for evaluation (e.g., "general AI assistant").', }, toolUsageContext: { type: "string", description: "Context about tools/MCPs used in the interaction.", }, enableSummarization: { type: "boolean", description: "Enable or disable automatic conversation summarization for this request.", }, thinking: { type: "boolean", description: "Enable extended thinking/reasoning capability.", }, thinkingBudget: { type: "number", description: "Token budget for thinking (Anthropic models: 5000-100000).", }, thinkingLevel: { type: "string", description: "Thinking level for Gemini 3 models: minimal, low, medium, high.", allowedValues: ["minimal", "low", "medium", "high"], }, skipToolPromptInjection: { type: "boolean", description: "Skip injecting tool descriptions into the system prompt. Useful when tool info is already provided.", }, disableToolCache: { type: "boolean", description: "Disable tool result caching for this request (overrides global mcp.cache.enabled).", }, disableInternalFallback: { type: "boolean", description: "Own fallback order yourself: skip NeuroLink's provider-priority walk and the catalog model fallback, so an invalid model or unavailable provider surfaces as its own error.", }, disableToolCallRepair: { type: "boolean", description: "Disable the schema-driven tool call repair mechanism (near-miss tool names, mis-typed arguments). Repair is enabled by default.", }, }; //# sourceMappingURL=optionsSchema.js.map