2024-09-17 18:44:21 +08:00
|
|
|
// just for develop
|
|
|
|
|
|
|
|
{{range .LLMList}}
|
|
|
|
let {{.}}: LLM
|
2024-09-18 18:29:21 +08:00
|
|
|
{{- end}}
|
2024-09-17 18:44:21 +08:00
|
|
|
|
|
|
|
export default {
|
2024-09-29 21:20:28 +08:00
|
|
|
similarity,
|
2024-09-18 18:29:21 +08:00
|
|
|
{{- range .LLMList}}
|
2024-09-17 18:44:21 +08:00
|
|
|
{{.}},
|
2024-09-18 18:29:21 +08:00
|
|
|
{{- end}}
|
2024-09-17 18:44:21 +08:00
|
|
|
}
|
|
|
|
|
2024-09-29 21:20:28 +08:00
|
|
|
function similarity(a: any, b: any): number{return 0}
|
|
|
|
|
2024-09-18 18:29:21 +08:00
|
|
|
interface ChatConfig {
|
2024-09-17 18:44:21 +08:00
|
|
|
model: string
|
|
|
|
ratio: number
|
|
|
|
maxTokens: number
|
|
|
|
temperature: number
|
|
|
|
topP: number
|
|
|
|
tools: Object
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ChatResult {
|
|
|
|
result: string
|
|
|
|
askTokens: number
|
|
|
|
answerTokens: number
|
|
|
|
totalTokens: number
|
2024-09-29 21:20:28 +08:00
|
|
|
usedTime: number
|
2024-09-17 18:44:21 +08:00
|
|
|
}
|
|
|
|
|
2024-09-18 18:29:21 +08:00
|
|
|
interface GCConfig {
|
|
|
|
model: string
|
|
|
|
size: string
|
|
|
|
ref: string
|
|
|
|
}
|
|
|
|
|
2024-09-17 18:44:21 +08:00
|
|
|
interface GCResult {
|
|
|
|
result: string
|
|
|
|
preview: string
|
|
|
|
results: Array<string>
|
|
|
|
previews: Array<string>
|
2024-09-29 21:20:28 +08:00
|
|
|
usedTime: number
|
|
|
|
}
|
|
|
|
|
|
|
|
interface EmbeddingResult {
|
|
|
|
result: string
|
|
|
|
askTokens: number
|
|
|
|
answerTokens: number
|
|
|
|
totalTokens: number
|
|
|
|
usedTime: number
|
2024-09-17 18:44:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
interface Support {
|
|
|
|
ask: boolean
|
|
|
|
askWithImage: boolean
|
|
|
|
askWithVideo: boolean
|
|
|
|
askWithCodeInterpreter: boolean
|
|
|
|
askWithWebSearch: boolean
|
|
|
|
makeImage: boolean
|
|
|
|
makeVideo: boolean
|
|
|
|
models: Array<string>
|
|
|
|
}
|
|
|
|
|
|
|
|
interface LLM {
|
2024-09-18 18:29:21 +08:00
|
|
|
ask(messages: any, config?: ChatConfig, callback?: (answer: string) => void): ChatResult
|
2024-09-17 18:44:21 +08:00
|
|
|
fastAsk(messages: any, callback?: (answer: string) => void): ChatResult
|
|
|
|
longAsk(messages: any, callback?: (answer: string) => void): ChatResult
|
|
|
|
batterAsk(messages: any, callback?: (answer: string) => void): ChatResult
|
|
|
|
bestAsk(messages: any, callback?: (answer: string) => void): ChatResult
|
|
|
|
multiAsk(messages: any, callback?: (answer: string) => void): ChatResult
|
|
|
|
bestMultiAsk(messages: any, callback?: (answer: string) => void): ChatResult
|
|
|
|
codeInterpreterAsk(messages: any, callback?: (answer: string) => void): ChatResult
|
|
|
|
webSearchAsk(messages: any, callback?: (answer: string) => void): ChatResult
|
2024-09-18 18:29:21 +08:00
|
|
|
makeImage(prompt: string, config?: GCConfig): GCResult
|
|
|
|
fastMakeImage(prompt: string, config?: GCConfig): GCResult
|
|
|
|
bestMakeImage(prompt: string, config?: GCConfig): GCResult
|
|
|
|
makeVideo(prompt: string, config?: GCConfig): GCResult
|
|
|
|
fastMakeVideo(prompt: string, config?: GCConfig): GCResult
|
|
|
|
bestMakeVideo(prompt: string, config?: GCConfig): GCResult
|
2024-09-29 21:20:28 +08:00
|
|
|
embedding(text: string, model: string): EmbeddingResult
|
|
|
|
fastEmbedding(text: string): EmbeddingResult
|
|
|
|
bestEmbedding(text: string): EmbeddingResult
|
2024-09-17 18:44:21 +08:00
|
|
|
support: Support
|
|
|
|
}
|