import type { BotonicContext, ResolvedPlugins } from '@botonic/core'; import type { AgenticOutputMessage, AiAgentArgs, BotonicSessionUserContactInfoItem, GuardrailRule, InferenceResponse, RunResult, UserExtraData } from '@botonic/shared'; import type { Agent, AgentInputItem, AgentOutputType, RunContext as OpenAIRunContext, Tool as OpenAITool } from '@openai/agents'; import type { ZodType } from 'zod'; import type { OutputSchema } from './structured-output'; export interface AiAgentContext { sourceIds: string[]; knowledgeUsed: { query: string; sourceIds: string[]; chunksIds: string[]; chunkTexts: string[]; }; botonicContext: BotonicContext; } export type RunContext = OpenAIRunContext>; export interface CustomTool { name: string; description: string; schema: ZodType; func: (input?: any, runContext?: RunContext) => Promise; } export interface Chunk { id: string; text: string; } export type ContactInfo = BotonicSessionUserContactInfoItem; export type Tool = OpenAITool>; export type AIAgent = Agent, AgentOutputType>; export interface MemoryOptions { maxMessages: number; includeToolCalls: boolean; maxFullToolResults: number; debugMode: boolean; } export interface PluginAiAgentOptions { customTools?: CustomTool[]; timeout?: number; maxRetries?: number; memory?: Partial; enableDebug?: boolean; provider?: 'openai' | 'azure'; } export interface ResultRawResponse { usage: { inputTokens: number; outputTokens: number; }; providerData?: Record; } export type AgenticInputMessage = AgentInputItem; export type { AgenticOutputMessage, AiAgentArgs, GuardrailRule, InferenceResponse, RunResult, };