|
import platform from './provider'; |
|
|
|
export type SearchFunc = (...args: any[]) => Promise<any[]>; |
|
|
|
export enum ESearchEngine { |
|
GOOGLE = 'GOOGLE', |
|
BING = 'BING', |
|
SOGOU = 'SOGOU', |
|
SEARXNG = 'SEARXNG', |
|
CHATGLM = 'CHATGLM' |
|
} |
|
|
|
export type ChatRoleType = 'user' | 'assistant' | 'system'; |
|
export interface IChatInputMessage { |
|
content: string; |
|
role: ChatRoleType; |
|
} |
|
|
|
export type Provider = 'ollama' | 'lmstudio'; |
|
|
|
export interface IChatResponse { |
|
text: string; |
|
usage?: { |
|
outputTokens: number; |
|
inputTokens: number; |
|
}; |
|
} |
|
|
|
export interface IModelInfo { |
|
platform: keyof typeof platform; |
|
type: string; |
|
models: string[]; |
|
} |
|
|
|
|
|
export interface IStreamHandler { |
|
(message: string | null, done: boolean): void |
|
} |
|
|
|
|
|
export interface ISearchResponseResult { |
|
name: string; |
|
url: string; |
|
snippet: string; |
|
thumbnail?: string; |
|
img?: string; |
|
source?: string; |
|
[key: string]: string | undefined; |
|
} |
|
|
|
export type TMode = 'simple' | 'deep' | 'research' |
|
|