Skip to content

LLM Wiki is a cross-platform desktop application that turns your documents into an organized, interlinked knowledge base — automatically. Instead of traditional RAG (retrieve-and-answer from scratch every time), the LLM incrementally builds and maintains a persistent wiki from your sources。

TypeScript

Fix code style: use AZURE_OPENAI_API_VERSION constant and fix import order

thinkinbig76c23ed79bc3
diff --git a/src/components/settings/preset-resolver.ts b/src/components/settings/preset-resolver.ts
index 043423e5..e86af74c 100644
--- a/src/components/settings/preset-resolver.ts
+++ b/src/components/settings/preset-resolver.ts
@@ -1,5 +1,6 @@
import type { LlmConfig } from "@/stores/wiki-store"
import type { ProviderOverride } from "@/stores/wiki-store"
+import { AZURE_OPENAI_API_VERSION } from "@/lib/llm-config-normalize"
import type { LlmPreset } from "./llm-presets"
/**
@@ -51,7 +52,7 @@ export function resolveConfig(
model,
ollamaUrl: fallback.ollamaUrl,
customEndpoint: ov.baseUrl ?? preset.baseUrl ?? "",
- azureApiVersion: ov.azureApiVersion ?? preset.azureApiVersion ?? "2024-10-21",
+ azureApiVersion: ov.azureApiVersion ?? preset.azureApiVersion ?? AZURE_OPENAI_API_VERSION,
maxContextSize,
reasoning,
}
diff --git a/src/components/settings/sections/llm-provider-section.tsx b/src/components/settings/sections/llm-provider-section.tsx
index debeb538..edabeaa0 100644
--- a/src/components/settings/sections/llm-provider-section.tsx
+++ b/src/components/settings/sections/llm-provider-section.tsx
@@ -9,6 +9,7 @@ import { LLM_PRESETS, type LlmPreset } from "../llm-presets"
import { ContextSizeSelector } from "../context-size-selector"
import { resolveConfig } from "../preset-resolver"
import { normalizeEndpoint } from "@/lib/endpoint-normalizer"
+import { AZURE_OPENAI_API_VERSION } from "@/lib/llm-config-normalize"
export function LlmProviderSection() {
const { t } = useTranslation()
@@ -117,7 +118,7 @@ function PresetRow({
const apiKey = ov.apiKey ?? ""
const apiMode = ov.apiMode ?? preset.apiMode ?? "chat_completions"
const baseUrl = ov.baseUrl ?? preset.baseUrl ?? ""
- const azureApiVersion = ov.azureApiVersion ?? preset.azureApiVersion ?? "2024-10-21"
+ const azureApiVersion = ov.azureApiVersion ?? preset.azureApiVersion ?? AZURE_OPENAI_API_VERSION
const context = ov.maxContextSize ?? preset.suggestedContextSize ?? 131072
const reasoning = ov.reasoning ?? { mode: "auto" as const }
const hasConfig = !!apiKey || !!ov.baseUrl || !!ov.model || !!ov.azureApiVersion
diff --git a/src/lib/llm-config-normalize.test.ts b/src/lib/llm-config-normalize.test.ts
index 5a56fef0..fc73378a 100644
--- a/src/lib/llm-config-normalize.test.ts
+++ b/src/lib/llm-config-normalize.test.ts
@@ -1,4 +1,4 @@
-import { describe, expect, it } from "vitest"
+import { describe, it, expect } from "vitest"
import {
buildAzureOpenAiUrl,
normalizeActivePresetId,