summaryrefslogtreecommitdiff
path: root/extension/react-app/src/tabs
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-06-25 12:24:45 -0700
committerNate Sesti <sestinj@gmail.com>2023-06-25 12:24:45 -0700
commit54048d3e7bda9c39cc08888b37e0c7dc0716a713 (patch)
tree3ff7254f755e4b3b28a523d652b78dd1f61f868d /extension/react-app/src/tabs
parent82ead52472d4e2a2e291aa5f17ea8522fc11f236 (diff)
parentad462728afc4e6a9e1402aff295010ced9cf2f7a (diff)
downloadsncontinue-54048d3e7bda9c39cc08888b37e0c7dc0716a713.tar.gz
sncontinue-54048d3e7bda9c39cc08888b37e0c7dc0716a713.tar.bz2
sncontinue-54048d3e7bda9c39cc08888b37e0c7dc0716a713.zip
Merge branch 'main' into function-calling
Diffstat (limited to 'extension/react-app/src/tabs')
-rw-r--r--extension/react-app/src/tabs/gui.tsx30
1 files changed, 18 insertions, 12 deletions
diff --git a/extension/react-app/src/tabs/gui.tsx b/extension/react-app/src/tabs/gui.tsx
index d6131174..5001fe4b 100644
--- a/extension/react-app/src/tabs/gui.tsx
+++ b/extension/react-app/src/tabs/gui.tsx
@@ -215,7 +215,7 @@ function GUI(props: GUIProps) {
useEffect(() => {
const listener = (e: any) => {
// Cmd + J to toggle fast model
- if (e.key === "j" && e.metaKey) {
+ if (e.key === "i" && e.metaKey && e.shiftKey) {
setUsingFastModel((prev) => !prev);
}
};
@@ -230,21 +230,24 @@ function GUI(props: GUIProps) {
console.log("CLIENT ON STATE UPDATE: ", client, client?.onStateUpdate);
client?.onStateUpdate((state) => {
// Scroll only if user is at very bottom of the window.
+ setUsingFastModel(state.default_model === "gpt-3.5-turbo");
const shouldScrollToBottom =
topGuiDivRef.current &&
topGuiDivRef.current?.offsetHeight - window.scrollY < 100;
setWaitingForSteps(state.active);
setHistory(state.history);
setUserInputQueue(state.user_input_queue);
- const nextStepsOpen = [...stepsOpen];
- for (
- let i = nextStepsOpen.length;
- i < state.history.timeline.length;
- i++
- ) {
- nextStepsOpen.push(true);
- }
- setStepsOpen(nextStepsOpen);
+ setStepsOpen((prev) => {
+ const nextStepsOpen = [...prev];
+ for (
+ let i = nextStepsOpen.length;
+ i < state.history.timeline.length;
+ i++
+ ) {
+ nextStepsOpen.push(true);
+ }
+ return nextStepsOpen;
+ });
if (shouldScrollToBottom) {
scrollToBottom();
@@ -470,8 +473,11 @@ function GUI(props: GUIProps) {
Contribute Data
</span>
</div>
- {/* <HeaderButtonWithText
+ <HeaderButtonWithText
onClick={() => {
+ client?.changeDefaultModel(
+ usingFastModel ? "gpt-4" : "gpt-3.5-turbo"
+ );
setUsingFastModel((prev) => !prev);
}}
text={usingFastModel ? "gpt-3.5-turbo" : "gpt-4"}
@@ -481,7 +487,7 @@ function GUI(props: GUIProps) {
>
{usingFastModel ? "⚡" : "🧠"}
</div>
- </HeaderButtonWithText> */}
+ </HeaderButtonWithText>
<HeaderButtonWithText
onClick={() => {
client?.sendClear();