Chris Mahoney
commited on
Commit
·
7fa0661
1
Parent(s):
57c0236
Removing console log of provider info
Browse files
app/components/chat/BaseChat.tsx
CHANGED
@@ -33,7 +33,7 @@ const ModelSelector = ({ model, setModel, provider, setProvider, modelList, prov
|
|
33 |
<select
|
34 |
value={provider?.name}
|
35 |
onChange={(e) => {
|
36 |
-
setProvider(providerList.find(p => p.name === e.target.value));
|
37 |
const firstModel = [...modelList].find((m) => m.provider == e.target.value);
|
38 |
setModel(firstModel ? firstModel.name : '');
|
39 |
}}
|
@@ -49,7 +49,7 @@ const ModelSelector = ({ model, setModel, provider, setProvider, modelList, prov
|
|
49 |
key={provider?.name}
|
50 |
value={model}
|
51 |
onChange={(e) => setModel(e.target.value)}
|
52 |
-
style={{maxWidth:
|
53 |
className="flex-1 p-2 rounded-lg border border-bolt-elements-borderColor bg-bolt-elements-prompt-background text-bolt-elements-textPrimary focus:outline-none focus:ring-2 focus:ring-bolt-elements-focus transition-all"
|
54 |
>
|
55 |
{[...modelList]
|
@@ -111,12 +111,10 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
|
|
111 |
},
|
112 |
ref,
|
113 |
) => {
|
114 |
-
console.log(provider);
|
115 |
const TEXTAREA_MAX_HEIGHT = chatStarted ? 400 : 200;
|
116 |
const [apiKeys, setApiKeys] = useState<Record<string, string>>({});
|
117 |
const [modelList, setModelList] = useState(MODEL_LIST);
|
118 |
|
119 |
-
|
120 |
useEffect(() => {
|
121 |
// Load API keys from cookies on component mount
|
122 |
try {
|
@@ -133,7 +131,7 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
|
|
133 |
Cookies.remove('apiKeys');
|
134 |
}
|
135 |
|
136 |
-
initializeModelList().then(modelList => {
|
137 |
setModelList(modelList);
|
138 |
});
|
139 |
}, []);
|
@@ -207,12 +205,13 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
|
|
207 |
setProvider={setProvider}
|
208 |
providerList={PROVIDER_LIST}
|
209 |
/>
|
210 |
-
{provider &&
|
211 |
<APIKeyManager
|
212 |
provider={provider}
|
213 |
apiKey={apiKeys[provider.name] || ''}
|
214 |
setApiKey={(key) => updateApiKey(provider.name, key)}
|
215 |
-
/>
|
|
|
216 |
<div
|
217 |
className={classNames(
|
218 |
'shadow-lg border border-bolt-elements-borderColor bg-bolt-elements-prompt-background backdrop-filter backdrop-blur-[8px] rounded-lg overflow-hidden transition-all',
|
|
|
33 |
<select
|
34 |
value={provider?.name}
|
35 |
onChange={(e) => {
|
36 |
+
setProvider(providerList.find((p) => p.name === e.target.value));
|
37 |
const firstModel = [...modelList].find((m) => m.provider == e.target.value);
|
38 |
setModel(firstModel ? firstModel.name : '');
|
39 |
}}
|
|
|
49 |
key={provider?.name}
|
50 |
value={model}
|
51 |
onChange={(e) => setModel(e.target.value)}
|
52 |
+
style={{ maxWidth: '70%' }}
|
53 |
className="flex-1 p-2 rounded-lg border border-bolt-elements-borderColor bg-bolt-elements-prompt-background text-bolt-elements-textPrimary focus:outline-none focus:ring-2 focus:ring-bolt-elements-focus transition-all"
|
54 |
>
|
55 |
{[...modelList]
|
|
|
111 |
},
|
112 |
ref,
|
113 |
) => {
|
|
|
114 |
const TEXTAREA_MAX_HEIGHT = chatStarted ? 400 : 200;
|
115 |
const [apiKeys, setApiKeys] = useState<Record<string, string>>({});
|
116 |
const [modelList, setModelList] = useState(MODEL_LIST);
|
117 |
|
|
|
118 |
useEffect(() => {
|
119 |
// Load API keys from cookies on component mount
|
120 |
try {
|
|
|
131 |
Cookies.remove('apiKeys');
|
132 |
}
|
133 |
|
134 |
+
initializeModelList().then((modelList) => {
|
135 |
setModelList(modelList);
|
136 |
});
|
137 |
}, []);
|
|
|
205 |
setProvider={setProvider}
|
206 |
providerList={PROVIDER_LIST}
|
207 |
/>
|
208 |
+
{provider && (
|
209 |
<APIKeyManager
|
210 |
provider={provider}
|
211 |
apiKey={apiKeys[provider.name] || ''}
|
212 |
setApiKey={(key) => updateApiKey(provider.name, key)}
|
213 |
+
/>
|
214 |
+
)}
|
215 |
<div
|
216 |
className={classNames(
|
217 |
'shadow-lg border border-bolt-elements-borderColor bg-bolt-elements-prompt-background backdrop-filter backdrop-blur-[8px] rounded-lg overflow-hidden transition-all',
|