-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.ts
56 lines (50 loc) · 1.58 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { ChatAnthropic } from '@langchain/anthropic';
import { ChromeAI } from '@langchain/community/experimental/llms/chrome_ai';
import { ChatGroq } from '@langchain/groq';
import { ChatMistralAI } from '@langchain/mistralai';
import { ChatOpenAI } from '@langchain/openai';
import { AnthropicCompleter } from './anthropic-completer';
import { CodestralCompleter } from './codestral-completer';
import { ChromeCompleter } from './chrome-completer';
import { OpenAICompleter } from './openai-completer';
import { instructions } from '../settings/instructions';
import { ProviderSettings } from '../settings/schemas';
import { IAIProvider } from '../tokens';
export * from './base-completer';
const AIProviders: IAIProvider[] = [
{
name: 'Anthropic',
chatModel: ChatAnthropic,
completer: AnthropicCompleter,
settingsSchema: ProviderSettings.Anthropic,
errorMessage: (error: any) => error.error.error.message
},
{
name: 'ChromeAI',
// TODO: fix
// @ts-expect-error: missing properties
chatModel: ChromeAI,
completer: ChromeCompleter,
instructions: instructions.ChromeAI,
settingsSchema: ProviderSettings.ChromeAI
},
{
name: 'Groq',
chatModel: ChatGroq,
settingsSchema: ProviderSettings.Groq
},
{
name: 'MistralAI',
chatModel: ChatMistralAI,
completer: CodestralCompleter,
instructions: instructions.MistralAI,
settingsSchema: ProviderSettings.MistralAI
},
{
name: 'OpenAI',
chatModel: ChatOpenAI,
completer: OpenAICompleter,
settingsSchema: ProviderSettings.OpenAI
}
];
export { AIProviders };