mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-15 05:23:42 +08:00
feat: 支持全局配置插件
This commit is contained in:
@@ -23,6 +23,11 @@ export interface LLMConfig {
|
||||
frequency_penalty?: number;
|
||||
}
|
||||
|
||||
export interface LLMAgentConfig {
|
||||
maxIterations: number;
|
||||
returnIntermediateSteps: boolean;
|
||||
}
|
||||
|
||||
export interface ChatOptions {
|
||||
messages: RequestMessage[];
|
||||
config: LLMConfig;
|
||||
@@ -33,6 +38,17 @@ export interface ChatOptions {
|
||||
onController?: (controller: AbortController) => void;
|
||||
}
|
||||
|
||||
export interface AgentChatOptions {
|
||||
messages: RequestMessage[];
|
||||
config: LLMConfig;
|
||||
agentConfig: LLMAgentConfig;
|
||||
onToolUpdate?: (toolName: string, toolInput: string) => void;
|
||||
onUpdate?: (message: string, chunk: string) => void;
|
||||
onFinish: (message: string) => void;
|
||||
onError?: (err: Error) => void;
|
||||
onController?: (controller: AbortController) => void;
|
||||
}
|
||||
|
||||
export interface LLMUsage {
|
||||
used: number;
|
||||
total: number;
|
||||
@@ -45,7 +61,7 @@ export interface LLMModel {
|
||||
|
||||
export abstract class LLMApi {
|
||||
abstract chat(options: ChatOptions): Promise<void>;
|
||||
abstract toolAgentChat(options: ChatOptions): Promise<void>;
|
||||
abstract toolAgentChat(options: AgentChatOptions): Promise<void>;
|
||||
abstract usage(): Promise<LLMUsage>;
|
||||
abstract models(): Promise<LLMModel[]>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user