From 074e2f3016706a87ea72b7f58c720bf9f4f4f1d8 Mon Sep 17 00:00:00 2001 From: Tommy Date: Wed, 6 Nov 2024 11:10:08 +0100 Subject: [PATCH] Moved provider and setProvider variables to the higher level component so that it can be accessed in sendMessage. Added provider to message queue in sendMessage. Changed streamText to extract both model and provider. --- app/components/chat/BaseChat.tsx | 9 ++++-- app/components/chat/Chat.client.tsx | 9 ++++-- app/lib/.server/llm/stream-text.ts | 47 +++++++++++++++++------------ 3 files changed, 41 insertions(+), 24 deletions(-) diff --git a/app/components/chat/BaseChat.tsx b/app/components/chat/BaseChat.tsx index c1175f700..a47b6adfd 100644 --- a/app/components/chat/BaseChat.tsx +++ b/app/components/chat/BaseChat.tsx @@ -24,8 +24,7 @@ const EXAMPLE_PROMPTS = [ const providerList = [...new Set(MODEL_LIST.map((model) => model.provider))] -const ModelSelector = ({ model, setModel, modelList, providerList }) => { - const [provider, setProvider] = useState(DEFAULT_PROVIDER); +const ModelSelector = ({ model, setModel, provider, setProvider, modelList, providerList }) => { return (