import { Context } from 'koishi'; import { ClientConfig, ClientConfigPool } from 'koishi-plugin-chatluna/llm-core/platform/config'; import { ChatLunaBaseEmbeddings, ChatLunaChatModel } from 'koishi-plugin-chatluna/llm-core/platform/model'; import { ChatLunaReranker } from 'koishi-plugin-chatluna/llm-core/platform/rerank'; import { FileHandlingConfig, ModelInfo, PlatformClientNames } from 'koishi-plugin-chatluna/llm-core/platform/types'; import { RunnableConfig } from '@langchain/core/runnables'; import { type ModelUsageReporter } from 'koishi-plugin-chatluna/llm-core/platform/usage'; export type { FileHandlingConfig }; export declare abstract class BasePlatformClient { ctx: Context; configPool: ClientConfigPool; private _modelPool; private _reports; protected _modelInfos: Record; private _lock; abstract platform: PlatformClientNames; constructor(ctx: Context, configPool: ClientConfigPool); isAvailable(config?: RunnableConfig): Promise; get config(): T | undefined; getModels(config?: RunnableConfig): Promise; init(config?: RunnableConfig): Promise; abstract refreshModels(config?: RunnableConfig): Promise; /** * Returns file handling configuration for this platform, or `null` if the * platform does not support inline file uploads beyond basic image input. * * Override in subclasses to provide platform-specific MIME types, size * limits, and inline data support. */ getFileHandlingConfig(): FileHandlingConfig | null; protected abstract _createModel(model: string, report: ModelUsageReporter): R; createModel(model: string): R; } export declare abstract class PlatformModelClient extends BasePlatformClient { clearContext(): Promise; } export declare abstract class PlatformEmbeddingsClient extends BasePlatformClient { } export declare abstract class PlatformModelAndEmbeddingsClient extends BasePlatformClient { } export declare abstract class PlatformRerankerClient extends BasePlatformClient { } export declare abstract class PlatformModelEmbeddingsAndRerankerClient extends BasePlatformClient { }