From adcdc8efdfcf6224999af7dc1d37b681a03728cd Mon Sep 17 00:00:00 2001 From: KevIsDev Date: Fri, 18 Apr 2025 13:45:11 +0100 Subject: [PATCH] feat(llm): add new models for xAI and Google providers Add 'grok-3-beta' to xAI provider and 'gemini-2.5-flash-preview-04-17' to Google provider. Also, ensure file saving when content is updated in WorkbenchStore and update streaming indicator styling in chat messages. --- app/components/chat/Messages.client.tsx | 2 +- app/lib/modules/llm/providers/google.ts | 6 ++++++ app/lib/modules/llm/providers/xai.ts | 1 + app/lib/stores/workbench.ts | 4 ++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/components/chat/Messages.client.tsx b/app/components/chat/Messages.client.tsx index 47e28274..0ce2f3fe 100644 --- a/app/components/chat/Messages.client.tsx +++ b/app/components/chat/Messages.client.tsx @@ -102,7 +102,7 @@ export const Messages = forwardRef( }) : null} {isStreaming && ( -
+
)} ); diff --git a/app/lib/modules/llm/providers/google.ts b/app/lib/modules/llm/providers/google.ts index 67043bad..b62ad82e 100644 --- a/app/lib/modules/llm/providers/google.ts +++ b/app/lib/modules/llm/providers/google.ts @@ -13,6 +13,12 @@ export default class GoogleProvider extends BaseProvider { }; staticModels: ModelInfo[] = [ + { + name: 'gemini-2.5-flash-preview-04-17', + label: 'Gemini 2.5 Pro Flash', + provider: 'Google', + maxTokenAllowed: 65536, + }, { name: 'gemini-1.5-flash-latest', label: 'Gemini 1.5 Flash', provider: 'Google', maxTokenAllowed: 8192 }, { name: 'gemini-2.0-flash-thinking-exp-01-21', diff --git a/app/lib/modules/llm/providers/xai.ts b/app/lib/modules/llm/providers/xai.ts index 032b01bf..64191d2e 100644 --- a/app/lib/modules/llm/providers/xai.ts +++ b/app/lib/modules/llm/providers/xai.ts @@ -13,6 +13,7 @@ export default class XAIProvider extends BaseProvider { }; staticModels: ModelInfo[] = [ + { name: 'grok-3-beta', label: 'xAI Grok 3 Beta', provider: 'xAI', maxTokenAllowed: 8000 }, { name: 'grok-beta', label: 'xAI Grok Beta', provider: 'xAI', maxTokenAllowed: 8000 }, { name: 'grok-2-1212', label: 'xAI Grok2 1212', provider: 'xAI', maxTokenAllowed: 8000 }, ]; diff --git a/app/lib/stores/workbench.ts b/app/lib/stores/workbench.ts index 6dda32a1..88f7dddb 100644 --- a/app/lib/stores/workbench.ts +++ b/app/lib/stores/workbench.ts @@ -513,6 +513,10 @@ export class WorkbenchStore { this.#editorStore.updateFile(fullPath, data.action.content); + if (!isStreaming && data.action.content) { + await this.saveFile(fullPath); + } + if (!isStreaming) { await artifact.runner.runAction(data); this.resetAllFileModifications();