import type { generateText } from "ai"; import type { streamText } from "ai"; import type { LanguageModel } from "ai"; import type { FlexibleSchema, ToolSet } from "ai"; export interface IAiSdkModel { id: string; name: string; } export interface IAiSdk { languageModel(modelId: string): LanguageModel; } /** A single AI SDK instance (e.g. OpenAI, Anthropic) that resolves model instances. */ export declare const AiSdk: import("@webiny/di").Abstraction; export declare namespace AiSdk { type Interface = IAiSdk; } export interface IAiSdkFactory { readonly id: string; readonly name: string; readonly models: readonly IAiSdkModel[]; execute(apiKey?: string): Promise; } /** Factory that asynchronously initialises an AI SDK. Register one per provider namespace. */ export declare const AiSdkFactory: import("@webiny/di").Abstraction; export declare namespace AiSdkFactory { type Interface = IAiSdkFactory; } export interface IAiConnectionInline { readonly sdkName: string; readonly apiKey?: string; } export interface IAiConnection extends IAiConnectionInline { readonly id: string; } export interface IAiConnectionFactory { execute(): Promise; } /** Factory that asynchronously produces an AiConnection. */ export declare const AiConnectionFactory: import("@webiny/di").Abstraction; export declare namespace AiConnectionFactory { type Interface = IAiConnectionFactory; } type SDKGenerateTextParams = Parameters[0]; type SDKStreamTextParams = Parameters[0]; export type AiGenerateTextParams = Omit & { model: string; connection?: string | IAiConnectionInline; }; export type AiStreamTextParams = Omit & { model: string; connection?: string | IAiConnectionInline; }; export interface AiModel { providerId: string; providerName: string; modelId: string; modelName: string; } export interface IAi { generateText(params: AiGenerateTextParams): ReturnType; streamText(params: AiStreamTextParams): Promise>; listModels(): Promise; listModelsByConnections(): Promise; listModelsByConnection(connection: string | IAiConnectionInline): Promise; } /** Interact with AI language models using registered providers. */ export declare const Ai: import("@webiny/di").Abstraction; export declare namespace Ai { type Interface = IAi; type GenerateTextParams = AiGenerateTextParams; type StreamTextParams = AiStreamTextParams; } export interface IAiSdkTool { readonly name: string; readonly description: string; readonly inputSchema: FlexibleSchema; execute(input: TInput): Promise; } /** A single tool that can be provided to AI generateText/streamText calls. */ export declare const AiSdkTool: import("@webiny/di").Abstraction>; export declare namespace AiSdkTool { type Interface = IAiSdkTool; } export interface IAiSdkTools { getToolSet(): ToolSet; } /** Collection of AI SDK tools. Returns a ready-to-use ToolSet for generateText/streamText. */ export declare const AiSdkTools: import("@webiny/di").Abstraction; export declare namespace AiSdkTools { type Interface = IAiSdkTools; } export {};