Skip to content

Commit 63b4713

Browse files
authored
Merge pull request #73 from beekeeper-studio/fix/ollama-error
fix ollama error message
2 parents 9b2d56a + 43d0d92 commit 63b4713

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/components/configuration/ApiInfo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<p class="api-info">
33
<span class="material-symbols-outlined icon">info</span>
44
<span>
5-
Your API keys are stored only on your device and are never shared with any
5+
Your API keys are encrypted and stored only on your device and are never shared with any
66
server except the selected AI providers.
77
</span>
88
</p>

src/components/configuration/ProvidersConfiguration.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232
<h3>Ollama</h3>
3333
<div v-for="(error, index) in ollamaErrors" :key="index" class="error-message">
3434
<template v-if="error.includes('[1]')">
35-
We couldn’t reach Ollama. The server may not be running or CORS might be blocking the request.
35+
Ollama is unreachable. It may not be running or CORS may be blocking
36+
the request. Check out our
37+
<ExternalLink
38+
href="https://docs.beekeeperstudio.io/user_guide/sql-ai-shell/#problem-fetching-ollama"
39+
>troubleshooting docs</ExternalLink>.
3640
</template>
3741
<template v-else>{{ error }}</template>
3842
</div>
@@ -53,6 +57,7 @@ import { useConfigurationStore } from "@/stores/configuration";
5357
import { mapState, mapActions } from "pinia";
5458
import { AvailableProvidersWithDynamicModels } from "@/config";
5559
import { useChatStore } from "@/stores/chat";
60+
import ExternalLink from "../common/ExternalLink.vue";
5661
5762
export default {
5863
name: "ProvidersConfiguration",
@@ -62,6 +67,7 @@ export default {
6267
ApiInfo,
6368
BaseInput,
6469
ToggleFormArea,
70+
ExternalLink,
6571
},
6672
6773
computed: {

src/providers/BaseProvider.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ export abstract class BaseProvider {
8484
} else if (APICallError.isInstance(error)) {
8585
if (
8686
error.data?.error?.code === "invalid_api_key" ||
87-
error.data?.error?.message === "invalid x-api-key" ||
88-
error.data?.error?.code === 400
87+
error.data?.error?.message === "invalid x-api-key"
8988
) {
9089
return `The API key is invalid.`;
9190
}

0 commit comments

Comments
 (0)