Skip to content

Commit

Permalink
1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrankov committed Jan 11, 2024
1 parent 7009ede commit 68d2819
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "local-gpt",
"name": "Local GPT",
"version": "1.5.0",
"version": "1.6.0",
"minAppVersion": "0.15.0",
"description": "Local GPT assistance for maximum privacy and offline access",
"author": "Pavel Frankov",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-local-gpt",
"version": "1.5.0",
"version": "1.6.0",
"description": "Local GPT assistance for maximum privacy and offline access",
"main": "main.js",
"scripts": {
Expand Down
6 changes: 6 additions & 0 deletions src/LocalGPTSettingTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,17 @@ export class LocalGPTSettingTab extends PluginSettingTab {
};

if (this.plugin.settings.defaultProvider === Providers.OLLAMA) {
// @ts-ignore
delete fallbackProviders[Providers.OLLAMA];
// @ts-ignore
fallbackProviders[Providers.OLLAMA_FALLBACK] = "2️⃣ Ollama";
}
if (
this.plugin.settings.defaultProvider === Providers.OPENAI_COMPATIBLE
) {
// @ts-ignore
delete fallbackProviders[Providers.OPENAI_COMPATIBLE];
// @ts-ignore
fallbackProviders[Providers.OPENAI_COMPATIBLE_FALLBACK] =
"2️⃣ OpenAI compatible servers";
}
Expand All @@ -62,6 +66,7 @@ export class LocalGPTSettingTab extends PluginSettingTab {
this.selectedProvider = value;

if (this.useFallback) {
// @ts-ignore
this.plugin.settings.fallbackProvider = Object.keys(
mainProviders,
).find((key) => key !== value);
Expand Down Expand Up @@ -236,6 +241,7 @@ export class LocalGPTSettingTab extends PluginSettingTab {
.addText((text) =>
text
.setPlaceholder("")
// @ts-ignore
.setValue(selectedProviderConfig.apiKey)
.onChange(async (value) => {
selectedProviderConfig.apiKey = value;
Expand Down
2 changes: 0 additions & 2 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ export const enum Providers {
OPENAI_COMPATIBLE_FALLBACK = "openaiCompatible_fallback",
}

export type ProviderType = keyof typeof Providers;

export type OllamaProvider = {
ollamaUrl: string;
defaultModel: string;
Expand Down
1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export default class LocalGPT extends Plugin {
needToSave = true;
// @ts-ignore
loadedData.defaultProvider =
// @ts-ignore
loadedData.selectedProvider ||
DEFAULT_SETTINGS.defaultProvider;
// @ts-ignore
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"1.4.0": "0.15.0",
"1.4.1": "0.15.0",
"1.4.2": "0.15.0",
"1.5.0": "0.15.0"
"1.5.0": "0.15.0",
"1.6.0": "0.15.0"
}

0 comments on commit 68d2819

Please sign in to comment.