Skip to content

Commit

Permalink
feat(default chat model): send empty string in chat request if user i…
Browse files Browse the repository at this point in the history
…s using the default model
  • Loading branch information
MarcMcIntosh committed Mar 21, 2024
1 parent 281c5ab commit fdecb9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/features/Chat.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe("Chat", () => {
payload: {
id: "foo",
messages: [["user", "hello\n"]],
model: "gpt-3.5-turbo",
model: "", // not added because it's default
title: "",
attach_file: false,
},
Expand Down
8 changes: 2 additions & 6 deletions src/hooks/useEventBusForChat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,6 @@ export function reducer(postMessage: typeof window.postMessage) {
return {
...state,
error,
chat: {
...state.chat,
model: state.chat.model || default_cap,
},
caps: {
fetching: false,
default_cap: default_cap || available_caps[0] || "",
Expand Down Expand Up @@ -635,12 +631,12 @@ export const useEventBusForChat = () => {
type: EVENT_NAMES_TO_CHAT.SET_CHAT_MODEL,
payload: {
id: state.chat.id,
model,
model: model === state.caps.default_cap ? "" : model,
},
};
dispatch(action);
},
[state.chat.id],
[state.chat.id, state.caps.default_cap],
);

const stopStreaming = useCallback(() => {
Expand Down

0 comments on commit fdecb9d

Please sign in to comment.