Cole Medin commited on
Commit
d7bda6f
·
1 Parent(s): c31c37f

Fixing up codebase after merging pull requests

Browse files
.env.example CHANGED
@@ -18,7 +18,7 @@ ANTHROPIC_API_KEY=
18
  # Get your OpenRouter API Key in your account settings -
19
  # https://openrouter.ai/settings/keys
20
  # You only need this environment variable set if you want to use OpenRouter models
21
- OPEN_ROUTER_API_KEY=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
22
 
23
  # Get your Google Generative AI API Key by following these instructions -
24
  # https://console.cloud.google.com/apis/credentials
 
18
  # Get your OpenRouter API Key in your account settings -
19
  # https://openrouter.ai/settings/keys
20
  # You only need this environment variable set if you want to use OpenRouter models
21
+ OPEN_ROUTER_API_KEY=
22
 
23
  # Get your Google Generative AI API Key by following these instructions -
24
  # https://console.cloud.google.com/apis/credentials
app/components/chat/BaseChat.tsx CHANGED
@@ -30,7 +30,11 @@ const ModelSelector = ({ model, setModel, modelList, providerList }) => {
30
  <div className="mb-2">
31
  <select
32
  value={provider}
33
- onChange={(e) => setProvider(e.target.value)}
 
 
 
 
34
  className="w-full p-2 rounded-lg border border-bolt-elements-borderColor bg-bolt-elements-prompt-background text-bolt-elements-textPrimary focus:outline-none"
35
  >
36
  {providerList.map((provider) => (
@@ -38,23 +42,24 @@ const ModelSelector = ({ model, setModel, modelList, providerList }) => {
38
  {provider}
39
  </option>
40
  ))}
41
-
 
 
42
  </select>
43
  <select
44
  value={model}
45
- provider={provider}
46
  onChange={(e) => setModel(e.target.value)}
47
  className="w-full p-2 rounded-lg border border-bolt-elements-borderColor bg-bolt-elements-prompt-background text-bolt-elements-textPrimary focus:outline-none"
48
  >
49
- {[...modelList].filter( e => e.provider == provider ).map((modelOption) => (
50
  <option key={modelOption.name} value={modelOption.name}>
51
  {modelOption.label}
52
  </option>
53
  ))}
54
  </select>
55
  </div>
56
- )
57
- }
58
 
59
  const TEXTAREA_MIN_HEIGHT = 76;
60
 
 
30
  <div className="mb-2">
31
  <select
32
  value={provider}
33
+ onChange={(e) => {
34
+ setProvider(e.target.value);
35
+ const firstModel = [...modelList].find(m => m.provider == e.target.value);
36
+ setModel(firstModel ? firstModel.name : '');
37
+ }}
38
  className="w-full p-2 rounded-lg border border-bolt-elements-borderColor bg-bolt-elements-prompt-background text-bolt-elements-textPrimary focus:outline-none"
39
  >
40
  {providerList.map((provider) => (
 
42
  {provider}
43
  </option>
44
  ))}
45
+ <option key="Ollama" value="Ollama">
46
+ Ollama
47
+ </option>
48
  </select>
49
  <select
50
  value={model}
 
51
  onChange={(e) => setModel(e.target.value)}
52
  className="w-full p-2 rounded-lg border border-bolt-elements-borderColor bg-bolt-elements-prompt-background text-bolt-elements-textPrimary focus:outline-none"
53
  >
54
+ {[...modelList].filter(e => e.provider == provider && e.name).map((modelOption) => (
55
  <option key={modelOption.name} value={modelOption.name}>
56
  {modelOption.label}
57
  </option>
58
  ))}
59
  </select>
60
  </div>
61
+ );
62
+ };
63
 
64
  const TEXTAREA_MIN_HEIGHT = 76;
65
 
package.json CHANGED
@@ -24,6 +24,7 @@
24
  },
25
  "dependencies": {
26
  "@ai-sdk/anthropic": "^0.0.39",
 
27
  "@ai-sdk/openai": "^0.0.66",
28
  "@codemirror/autocomplete": "^6.17.0",
29
  "@codemirror/commands": "^6.6.0",
 
24
  },
25
  "dependencies": {
26
  "@ai-sdk/anthropic": "^0.0.39",
27
+ "@ai-sdk/google": "^0.0.52",
28
  "@ai-sdk/openai": "^0.0.66",
29
  "@codemirror/autocomplete": "^6.17.0",
30
  "@codemirror/commands": "^6.6.0",
pnpm-lock.yaml CHANGED
@@ -14,6 +14,9 @@ importers:
14
  '@ai-sdk/anthropic':
15
  specifier: ^0.0.39
16
  version: 0.0.39([email protected])
 
 
 
17
  '@ai-sdk/openai':
18
  specifier: ^0.0.66
19
  version: 0.0.66([email protected])
@@ -255,6 +258,12 @@ packages:
255
  peerDependencies:
256
  zod: ^3.0.0
257
 
 
 
 
 
 
 
258
  '@ai-sdk/[email protected]':
259
  resolution: {integrity: sha512-V4XeDnlNl5/AY3GB3ozJUjqnBLU5pK3DacKTbCNH3zH8/MggJoH6B8wRGdLUPVFMcsMz60mtvh4DC9JsIVFrKw==}
260
  engines: {node: '>=18'}
@@ -5371,6 +5380,13 @@ snapshots:
5371
  '@ai-sdk/provider-utils': 1.0.9([email protected])
5372
  zod: 3.23.8
5373
 
 
 
 
 
 
 
 
5374
5375
  dependencies:
5376
  '@ai-sdk/provider': 0.0.24
 
14
  '@ai-sdk/anthropic':
15
  specifier: ^0.0.39
16
  version: 0.0.39([email protected])
17
+ '@ai-sdk/google':
18
+ specifier: ^0.0.52
19
+ version: 0.0.52([email protected])
20
  '@ai-sdk/openai':
21
  specifier: ^0.0.66
22
  version: 0.0.66([email protected])
 
258
  peerDependencies:
259
  zod: ^3.0.0
260
 
261
+ '@ai-sdk/[email protected]':
262
+ resolution: {integrity: sha512-bfsA/1Ae0SQ6NfLwWKs5SU4MBwlzJjVhK6bTVBicYFjUxg9liK/W76P1Tq/qK9OlrODACz3i1STOIWsFPpIOuQ==}
263
+ engines: {node: '>=18'}
264
+ peerDependencies:
265
+ zod: ^3.0.0
266
+
267
  '@ai-sdk/[email protected]':
268
  resolution: {integrity: sha512-V4XeDnlNl5/AY3GB3ozJUjqnBLU5pK3DacKTbCNH3zH8/MggJoH6B8wRGdLUPVFMcsMz60mtvh4DC9JsIVFrKw==}
269
  engines: {node: '>=18'}
 
5380
  '@ai-sdk/provider-utils': 1.0.9([email protected])
5381
  zod: 3.23.8
5382
 
5383
5384
+ dependencies:
5385
+ '@ai-sdk/provider': 0.0.24
5386
+ '@ai-sdk/provider-utils': 1.0.20([email protected])
5387
+ json-schema: 0.4.0
5388
+ zod: 3.23.8
5389
+
5390
5391
  dependencies:
5392
  '@ai-sdk/provider': 0.0.24