66 GeminiInput ,
77 LLamaReplicateInput ,
88 MistralInput ,
9+ AnthropicInput ,
910 ProxyHelper ,
1011} from 'intellinode' ;
1112import { ChatProvider } from './types' ;
@@ -17,10 +18,13 @@ import {
1718 googleType ,
1819 googleValidator ,
1920 mistralValidator ,
21+ mistralType ,
2022 openAIType ,
2123 openAIValidator ,
2224 replicateType ,
2325 replicateValidator ,
26+ anthropicType ,
27+ anthropicValidator ,
2428} from './validators' ;
2529
2630// We can use this function to get the default provider key if onekey is provided and starts with 'in'
@@ -40,6 +44,8 @@ export function getDefaultProviderKey(provider: ChatProvider, oneKey?: string) {
4044 return process . env . INTELLI_COHERE_API_KEY ;
4145 case 'google' :
4246 return process . env . INTELLI_GOOGLE_API_KEY ;
47+ case 'anthropic' :
48+ return process . env . INTELLI_Anthropic_API_KEY ;
4349 default :
4450 return null ;
4551 }
@@ -59,6 +65,8 @@ export function getChatProviderKey(provider: ChatProvider) {
5965 return process . env . GOOGLE_API_KEY ;
6066 case 'mistral' :
6167 return process . env . MISTRAL_API_KEY ;
68+ case 'anthropic' :
69+ return process . env . Anthropic_API_KEY ;
6270 default :
6371 return null ;
6472 }
@@ -126,7 +134,7 @@ type getChatResponseParams = {
126134 role : 'user' | 'assistant' ;
127135 content : string ;
128136 } [ ] ;
129- provider ?: openAIType | replicateType | cohereType | googleType ;
137+ provider ?: openAIType | replicateType | cohereType | googleType | mistralType | anthropicType ;
130138 withContext : boolean ;
131139 n : number ;
132140 contextKey ?: string | null ;
@@ -146,6 +154,8 @@ const validateProvider = (name: string) => {
146154 return googleValidator ;
147155 case 'mistral' :
148156 return mistralValidator ;
157+ case 'anthropic' :
158+ return anthropicValidator ;
149159 default :
150160 throw new Error ( 'provider is not supported' ) ;
151161 }
@@ -218,6 +228,8 @@ function getChatInput(provider: string, model: string, systemMessage: string) {
218228 return new GeminiInput ( systemMessage , { model, attachReference : true } ) ;
219229 case 'mistral' :
220230 return new MistralInput ( systemMessage , { model, attachReference : true } ) ;
231+ case 'anthropic' :
232+ return new AnthropicInput ( systemMessage , { model, attachReference : true } ) ;
221233 default :
222234 throw new Error ( 'provider is not supported' ) ;
223235 }
0 commit comments