From d1d0e3d6ed02512489b42fa4a8a2176df7187207 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 22 Jun 2023 13:56:48 -0700 Subject: update global config with default model toggle --- extension/react-app/src/hooks/ContinueGUIClientProtocol.ts | 2 +- extension/react-app/src/hooks/useContinueGUIProtocol.ts | 4 ++-- extension/react-app/src/tabs/gui.tsx | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'extension') diff --git a/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts b/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts index 6d9d1fdd..3d8e0a38 100644 --- a/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts +++ b/extension/react-app/src/hooks/ContinueGUIClientProtocol.ts @@ -13,7 +13,7 @@ abstract class AbstractContinueGUIClientProtocol { callback: (commands: { name: string; description: string }[]) => void ): void; - abstract changeDefaultModel(): void; + abstract changeDefaultModel(model: string): void; abstract sendClear(): void; diff --git a/extension/react-app/src/hooks/useContinueGUIProtocol.ts b/extension/react-app/src/hooks/useContinueGUIProtocol.ts index 4eb68046..f43a66ff 100644 --- a/extension/react-app/src/hooks/useContinueGUIProtocol.ts +++ b/extension/react-app/src/hooks/useContinueGUIProtocol.ts @@ -55,8 +55,8 @@ class ContinueGUIClientProtocol extends AbstractContinueGUIClientProtocol { }); } - changeDefaultModel() { - this.messenger.send("change_default_model", {}); + changeDefaultModel(model: string) { + this.messenger.send("change_default_model", { model }); } sendClear() { diff --git a/extension/react-app/src/tabs/gui.tsx b/extension/react-app/src/tabs/gui.tsx index 16c950ef..f47371ee 100644 --- a/extension/react-app/src/tabs/gui.tsx +++ b/extension/react-app/src/tabs/gui.tsx @@ -427,9 +427,9 @@ function GUI(props: GUIProps) { }} hidden={!showDataSharingInfo} > - By turning on this switch, you signal that you would - contribute this software development data to a publicly - accessible, open-source dataset in the future. + By turning on this switch, you signal that you would contribute this + software development data to a publicly accessible, open-source dataset + in the future.

@@ -473,8 +473,10 @@ function GUI(props: GUIProps) { { + client?.changeDefaultModel( + usingFastModel ? "gpt-4" : "gpt-3.5-turbo" + ); setUsingFastModel((prev) => !prev); - client?.changeDefaultModel(); }} text={usingFastModel ? "gpt-3.5-turbo" : "gpt-4"} > -- cgit v1.2.3-70-g09d2