@@ -19,10 +19,14 @@ export type SettingsType = {
1919 llm_backend : string ;
2020 llm_model : string ;
2121 openai_model : string ;
22+ gemini_model ?: string ;
23+ claude_model ?: string ;
2224 voice : boolean ;
2325 streaming : boolean ;
2426 secured_streaming : boolean ;
25- openai_api_key : string ;
27+ openai_api_key ?: string ;
28+ gemini_api_key ?: string ;
29+ claude_api_key ?: string ;
2630}
2731
2832export type AppSettings = {
@@ -71,6 +75,8 @@ export interface UserPrivacy {
7175export interface LLMOptions {
7276 ollama : string [ ] ;
7377 openai : string [ ] ;
78+ gemini ?: string [ ] ;
79+ claude ?: string [ ] ;
7480}
7581
7682export interface UserSession {
@@ -311,18 +317,19 @@ export function ChatProvider({
311317
312318 const sendMessage = async (
313319 input : string ,
314- backend = 'ollama' ,
320+ backend ?: string ,
315321 mode ?: string ,
316322 project_path ?: string
317323 ) => {
324+ const effectiveBackend = backend ?? settings ?. settings . llm_backend ?? 'ollama' ;
318325 const data = await fetchWithKey ( `${ BASE_URL } /query` , apiKey , setError , {
319326 method : 'POST' ,
320327 headers : {
321328 'Content-Type' : 'application/json' ,
322329 } ,
323330 body : JSON . stringify ( {
324331 input,
325- backend,
332+ backend : effectiveBackend ,
326333 conversation_id : conversationId ,
327334 mode,
328335 project_path
@@ -337,10 +344,11 @@ export function ChatProvider({
337344 const sendStreamingMessage = async (
338345 input : string ,
339346 onToken : ( token : string ) => void ,
340- backend = 'ollama' ,
347+ backend ?: string ,
341348 mode ?: string ,
342349 project_path ?: string
343350 ) => {
351+ const effectiveBackend = backend ?? settings ?. settings . llm_backend ?? 'ollama' ;
344352 const res = await fetch ( `${ BASE_URL } /query/stream` , {
345353 method : 'POST' ,
346354 headers : {
@@ -349,7 +357,7 @@ export function ChatProvider({
349357 } ,
350358 body : JSON . stringify ( {
351359 input,
352- backend,
360+ backend : effectiveBackend ,
353361 conversation_id : conversationId ,
354362 mode,
355363 project_path
@@ -370,21 +378,22 @@ export function ChatProvider({
370378 const sendSecuredStreamingMessage = (
371379 input : string ,
372380 onToken : ( token : string ) => void ,
373- backend = 'ollama' ,
381+ backend ?: string ,
374382 mode ?: string ,
375383 project_path ?: string
376384 ) => {
377385 if ( messages . length === 0 ) {
378386 addTemporaryConversation ( input )
379387 }
388+ const effectiveBackend = backend ?? settings ?. settings . llm_backend ?? 'ollama' ;
380389 return consumeEncryptedStream (
381390 `${ BASE_URL } /query/secure_stream` ,
382391 apiKey ,
383392 conversationId ,
384393 onToken ,
385394 JSON . stringify ( {
386395 input,
387- backend,
396+ backend : effectiveBackend ,
388397 conversation_id : conversationId ,
389398 mode,
390399 project_path
0 commit comments