feat: Configable Ollama embedding timeout (#5733)

i18n: Add Ollama timeout configuration localization for all languages (by AI)
This commit is contained in:
KagurazakaNyaa 2025-12-06 13:49:17 +08:00
parent dd92453276
commit ebb28f5f14
30 changed files with 298 additions and 22 deletions

View file

@ -50,6 +50,9 @@ export const codebaseIndexConfigSchema = z.object({
codebaseIndexBedrockProfile: z.string().optional(),
// OpenRouter specific fields
codebaseIndexOpenRouterSpecificProvider: z.string().optional(),
// Ollama specific timeout fields
codebaseIndexOllamaEmbeddingTimeoutMs: z.number().int().optional(),
codebaseIndexOllamaValidationTimeoutMs: z.number().int().optional(),
})
export type CodebaseIndexConfig = z.infer<typeof codebaseIndexConfigSchema>

View file

@ -265,6 +265,8 @@ const ollamaSchema = baseProviderSettingsSchema.extend({
ollamaModelId: z.string().optional(),
ollamaBaseUrl: z.string().optional(),
ollamaApiKey: z.string().optional(),
ollamaEmbeddingTimeoutMs: z.number().int().optional(),
ollamaValidationTimeoutMs: z.number().int().optional(),
ollamaNumCtx: z.number().int().min(128).optional(),
})

View file

@ -2074,6 +2074,8 @@ export class ClineProvider
codebaseIndexEmbedderBaseUrl: codebaseIndexConfig?.codebaseIndexEmbedderBaseUrl ?? "",
codebaseIndexEmbedderModelId: codebaseIndexConfig?.codebaseIndexEmbedderModelId ?? "",
codebaseIndexEmbedderModelDimension: codebaseIndexConfig?.codebaseIndexEmbedderModelDimension ?? 1536,
codebaseIndexOllamaEmbeddingTimeoutMs: codebaseIndexConfig?.codebaseIndexOllamaEmbeddingTimeoutMs,
codebaseIndexOllamaValidationTimeoutMs: codebaseIndexConfig?.codebaseIndexOllamaValidationTimeoutMs,
codebaseIndexOpenAiCompatibleBaseUrl: codebaseIndexConfig?.codebaseIndexOpenAiCompatibleBaseUrl,
codebaseIndexSearchMaxResults: codebaseIndexConfig?.codebaseIndexSearchMaxResults,
codebaseIndexSearchMinScore: codebaseIndexConfig?.codebaseIndexSearchMinScore,
@ -2305,6 +2307,10 @@ export class ClineProvider
codebaseIndexEmbedderModelId: stateValues.codebaseIndexConfig?.codebaseIndexEmbedderModelId ?? "",
codebaseIndexEmbedderModelDimension:
stateValues.codebaseIndexConfig?.codebaseIndexEmbedderModelDimension,
codebaseIndexOllamaEmbeddingTimeoutMs:
stateValues.codebaseIndexConfig?.codebaseIndexOllamaEmbeddingTimeoutMs,
codebaseIndexOllamaValidationTimeoutMs:
stateValues.codebaseIndexConfig?.codebaseIndexOllamaValidationTimeoutMs,
codebaseIndexOpenAiCompatibleBaseUrl:
stateValues.codebaseIndexConfig?.codebaseIndexOpenAiCompatibleBaseUrl,
codebaseIndexSearchMaxResults: stateValues.codebaseIndexConfig?.codebaseIndexSearchMaxResults,

View file

@ -2363,6 +2363,8 @@ export const webviewMessageHandler = async (
codebaseIndexEmbedderBaseUrl: settings.codebaseIndexEmbedderBaseUrl,
codebaseIndexEmbedderModelId: settings.codebaseIndexEmbedderModelId,
codebaseIndexEmbedderModelDimension: settings.codebaseIndexEmbedderModelDimension, // Generic dimension
codebaseIndexOllamaEmbeddingTimeoutMs: settings.codebaseIndexOllamaEmbeddingTimeoutMs,
codebaseIndexOllamaValidationTimeoutMs: settings.codebaseIndexOllamaValidationTimeoutMs,
codebaseIndexOpenAiCompatibleBaseUrl: settings.codebaseIndexOpenAiCompatibleBaseUrl,
codebaseIndexBedrockRegion: settings.codebaseIndexBedrockRegion,
codebaseIndexBedrockProfile: settings.codebaseIndexBedrockProfile,

View file

@ -103,7 +103,11 @@ describe("CodeIndexConfigManager", () => {
embedderProvider: "openai",
modelId: undefined,
openAiOptions: { openAiNativeApiKey: "" },
ollamaOptions: { ollamaBaseUrl: "" },
ollamaOptions: {
ollamaBaseUrl: "",
ollamaEmbeddingTimeoutMs: undefined,
ollamaValidationTimeoutMs: undefined,
},
bedrockOptions: { region: "us-east-1", profile: undefined },
qdrantUrl: "http://localhost:6333",
qdrantApiKey: "",
@ -135,7 +139,11 @@ describe("CodeIndexConfigManager", () => {
embedderProvider: "openai",
modelId: "text-embedding-3-large",
openAiOptions: { openAiNativeApiKey: "test-openai-key" },
ollamaOptions: { ollamaBaseUrl: "" },
ollamaOptions: {
ollamaBaseUrl: "",
ollamaEmbeddingTimeoutMs: undefined,
ollamaValidationTimeoutMs: undefined,
},
qdrantUrl: "http://qdrant.local",
qdrantApiKey: "test-qdrant-key",
searchMinScore: 0.4,
@ -168,7 +176,11 @@ describe("CodeIndexConfigManager", () => {
embedderProvider: "openai-compatible",
modelId: "text-embedding-3-large",
openAiOptions: { openAiNativeApiKey: "" },
ollamaOptions: { ollamaBaseUrl: "" },
ollamaOptions: {
ollamaBaseUrl: "",
ollamaEmbeddingTimeoutMs: undefined,
ollamaValidationTimeoutMs: undefined,
},
openAiCompatibleOptions: {
baseUrl: "https://api.example.com/v1",
apiKey: "test-openai-compatible-key",
@ -206,7 +218,11 @@ describe("CodeIndexConfigManager", () => {
modelId: "custom-model",
modelDimension: 1024,
openAiOptions: { openAiNativeApiKey: "" },
ollamaOptions: { ollamaBaseUrl: "" },
ollamaOptions: {
ollamaBaseUrl: "",
ollamaEmbeddingTimeoutMs: undefined,
ollamaValidationTimeoutMs: undefined,
},
openAiCompatibleOptions: {
baseUrl: "https://api.example.com/v1",
apiKey: "test-openai-compatible-key",
@ -243,7 +259,11 @@ describe("CodeIndexConfigManager", () => {
embedderProvider: "openai-compatible",
modelId: "custom-model",
openAiOptions: { openAiNativeApiKey: "" },
ollamaOptions: { ollamaBaseUrl: "" },
ollamaOptions: {
ollamaBaseUrl: "",
ollamaEmbeddingTimeoutMs: undefined,
ollamaValidationTimeoutMs: undefined,
},
openAiCompatibleOptions: {
baseUrl: "https://api.example.com/v1",
apiKey: "test-openai-compatible-key",
@ -282,7 +302,11 @@ describe("CodeIndexConfigManager", () => {
modelId: "custom-model",
modelDimension: undefined, // Invalid dimension is converted to undefined
openAiOptions: { openAiNativeApiKey: "" },
ollamaOptions: { ollamaBaseUrl: "" },
ollamaOptions: {
ollamaBaseUrl: "",
ollamaEmbeddingTimeoutMs: undefined,
ollamaValidationTimeoutMs: undefined,
},
openAiCompatibleOptions: {
baseUrl: "https://api.example.com/v1",
apiKey: "test-openai-compatible-key",
@ -1292,7 +1316,11 @@ describe("CodeIndexConfigManager", () => {
embedderProvider: "openai",
modelId: "text-embedding-3-large",
openAiOptions: { openAiNativeApiKey: "test-openai-key" },
ollamaOptions: { ollamaBaseUrl: undefined },
ollamaOptions: {
ollamaBaseUrl: undefined,
ollamaEmbeddingTimeoutMs: undefined,
ollamaValidationTimeoutMs: undefined,
},
geminiOptions: undefined,
openAiCompatibleOptions: undefined,
qdrantUrl: "http://qdrant.local",

View file

@ -87,6 +87,8 @@ describe("CodeIndexServiceFactory", () => {
modelId: testModelId,
ollamaOptions: {
ollamaBaseUrl: "http://localhost:11434",
ollamaEmbeddingTimeoutMs: undefined,
ollamaValidationTimeoutMs: undefined,
},
}
mockConfigManager.getConfig.mockReturnValue(testConfig as any)
@ -129,6 +131,8 @@ describe("CodeIndexServiceFactory", () => {
modelId: undefined,
ollamaOptions: {
ollamaBaseUrl: "http://localhost:11434",
ollamaEmbeddingTimeoutMs: undefined,
ollamaValidationTimeoutMs: undefined,
},
}
mockConfigManager.getConfig.mockReturnValue(testConfig as any)
@ -165,6 +169,8 @@ describe("CodeIndexServiceFactory", () => {
modelId: "nomic-embed-text:latest",
ollamaOptions: {
ollamaBaseUrl: undefined,
ollamaEmbeddingTimeoutMs: undefined,
ollamaValidationTimeoutMs: undefined,
},
}
mockConfigManager.getConfig.mockReturnValue(testConfig as any)
@ -726,6 +732,8 @@ describe("CodeIndexServiceFactory", () => {
modelId: "nomic-embed-text",
ollamaOptions: {
ollamaBaseUrl: "http://localhost:11434",
ollamaEmbeddingTimeoutMs: undefined,
ollamaValidationTimeoutMs: undefined,
},
}
mockConfigManager.getConfig.mockReturnValue(testConfig as any)

View file

@ -55,6 +55,8 @@ export class CodeIndexConfigManager {
codebaseIndexSearchMaxResults: undefined,
codebaseIndexBedrockRegion: "us-east-1",
codebaseIndexBedrockProfile: "",
codebaseIndexOllamaEmbeddingTimeoutMs: undefined,
codebaseIndexOllamaValidationTimeoutMs: undefined,
}
const {
@ -128,6 +130,8 @@ export class CodeIndexConfigManager {
this.ollamaOptions = {
ollamaBaseUrl: codebaseIndexEmbedderBaseUrl,
ollamaEmbeddingTimeoutMs: codebaseIndexConfig.codebaseIndexOllamaEmbeddingTimeoutMs,
ollamaValidationTimeoutMs: codebaseIndexConfig.codebaseIndexOllamaValidationTimeoutMs,
}
this.openAiCompatibleOptions =
@ -183,6 +187,8 @@ export class CodeIndexConfigManager {
modelDimension: this.modelDimension,
openAiKey: this.openAiOptions?.openAiNativeApiKey ?? "",
ollamaBaseUrl: this.ollamaOptions?.ollamaBaseUrl ?? "",
ollamaEmbeddingTimeoutMs: this.ollamaOptions?.ollamaEmbeddingTimeoutMs,
ollamaValidationTimeoutMs: this.ollamaOptions?.ollamaValidationTimeoutMs,
openAiCompatibleBaseUrl: this.openAiCompatibleOptions?.baseUrl ?? "",
openAiCompatibleApiKey: this.openAiCompatibleOptions?.apiKey ?? "",
geminiApiKey: this.geminiOptions?.apiKey ?? "",
@ -301,6 +307,8 @@ export class CodeIndexConfigManager {
const prevProvider = prev?.embedderProvider ?? "openai"
const prevOpenAiKey = prev?.openAiKey ?? ""
const prevOllamaBaseUrl = prev?.ollamaBaseUrl ?? ""
const prevOllamaEmbeddingTimeoutMs = prev?.ollamaEmbeddingTimeoutMs
const prevOllamaValidationTimeoutMs = prev?.ollamaValidationTimeoutMs
const prevOpenAiCompatibleBaseUrl = prev?.openAiCompatibleBaseUrl ?? ""
const prevOpenAiCompatibleApiKey = prev?.openAiCompatibleApiKey ?? ""
const prevModelDimension = prev?.modelDimension
@ -343,6 +351,8 @@ export class CodeIndexConfigManager {
// Authentication changes (API keys)
const currentOpenAiKey = this.openAiOptions?.openAiNativeApiKey ?? ""
const currentOllamaBaseUrl = this.ollamaOptions?.ollamaBaseUrl ?? ""
const currentOllamaEmbeddingTimeoutMs = this.ollamaOptions?.ollamaEmbeddingTimeoutMs
const currentOllamaValidationTimeoutMs = this.ollamaOptions?.ollamaValidationTimeoutMs
const currentOpenAiCompatibleBaseUrl = this.openAiCompatibleOptions?.baseUrl ?? ""
const currentOpenAiCompatibleApiKey = this.openAiCompatibleOptions?.apiKey ?? ""
const currentModelDimension = this.modelDimension
@ -363,6 +373,12 @@ export class CodeIndexConfigManager {
if (prevOllamaBaseUrl !== currentOllamaBaseUrl) {
return true
}
if (
prevOllamaEmbeddingTimeoutMs !== currentOllamaEmbeddingTimeoutMs ||
prevOllamaValidationTimeoutMs !== currentOllamaValidationTimeoutMs
) {
return true
}
if (
prevOpenAiCompatibleBaseUrl !== currentOpenAiCompatibleBaseUrl ||

View file

@ -166,6 +166,52 @@ describe("CodeIndexOllamaEmbedder", () => {
})
})
describe("timeout configuration", () => {
it("should use custom embedding timeout when provided", () => {
const embedderWithCustomTimeout = new CodeIndexOllamaEmbedder({
ollamaBaseUrl: "http://localhost:11434",
ollamaModelId: "nomic-embed-text",
ollamaEmbeddingTimeoutMs: 120000, // 2 minutes
})
// The timeout should be set to the custom value
expect(embedderWithCustomTimeout).toBeDefined()
})
it("should use custom validation timeout when provided", () => {
const embedderWithCustomTimeout = new CodeIndexOllamaEmbedder({
ollamaBaseUrl: "http://localhost:11434",
ollamaModelId: "nomic-embed-text",
ollamaValidationTimeoutMs: 60000, // 1 minute
})
// The timeout should be set to the custom value
expect(embedderWithCustomTimeout).toBeDefined()
})
it("should use default timeouts when not provided", () => {
const embedderWithDefaults = new CodeIndexOllamaEmbedder({
ollamaBaseUrl: "http://localhost:11434",
ollamaModelId: "nomic-embed-text",
})
// Should use default timeouts
expect(embedderWithDefaults).toBeDefined()
})
it("should handle -1 timeout to disable timeout", () => {
const embedderWithNoTimeout = new CodeIndexOllamaEmbedder({
ollamaBaseUrl: "http://localhost:11434",
ollamaModelId: "nomic-embed-text",
ollamaEmbeddingTimeoutMs: -1,
ollamaValidationTimeoutMs: -1,
})
// Should handle -1 as no timeout
expect(embedderWithNoTimeout).toBeDefined()
})
})
describe("validateConfiguration", () => {
it("should validate successfully when service is available and model exists", async () => {
// Mock successful /api/tags call

View file

@ -10,23 +10,30 @@ import { TelemetryEventName } from "@roo-code/types"
// Timeout constants for Ollama API requests
const OLLAMA_EMBEDDING_TIMEOUT_MS = 60000 // 60 seconds for embedding requests
const OLLAMA_VALIDATION_TIMEOUT_MS = 30000 // 30 seconds for validation requests
const OLLAMA_BASE_URL = "http://localhost:11434"
const OLLAMA_DEFAULT_MODEL_ID = "nomic-embed-text:latest"
/**
* Implements the IEmbedder interface using a local Ollama instance.
*/
export class CodeIndexOllamaEmbedder implements IEmbedder {
private readonly baseUrl: string
private readonly defaultModelId: string
private readonly modelId: string
private readonly embeddingTimeoutMs: number
private readonly validationTimeoutMs: number
constructor(options: ApiHandlerOptions) {
// Ensure ollamaBaseUrl and ollamaModelId exist on ApiHandlerOptions or add defaults
let baseUrl = options.ollamaBaseUrl || "http://localhost:11434"
let baseUrl = options.ollamaBaseUrl || OLLAMA_BASE_URL
// Normalize the baseUrl by removing all trailing slashes
baseUrl = baseUrl.replace(/\/+$/, "")
this.baseUrl = baseUrl
this.defaultModelId = options.ollamaModelId || "nomic-embed-text:latest"
this.modelId = options.ollamaModelId || OLLAMA_DEFAULT_MODEL_ID
this.embeddingTimeoutMs = options.ollamaEmbeddingTimeoutMs || OLLAMA_EMBEDDING_TIMEOUT_MS
this.validationTimeoutMs = options.ollamaValidationTimeoutMs || OLLAMA_VALIDATION_TIMEOUT_MS
}
/**
@ -36,7 +43,7 @@ export class CodeIndexOllamaEmbedder implements IEmbedder {
* @returns A promise that resolves to an EmbeddingResponse containing the embeddings and usage data.
*/
async createEmbeddings(texts: string[], model?: string): Promise<EmbeddingResponse> {
const modelToUse = model || this.defaultModelId
const modelToUse = model || this.modelId
const url = `${this.baseUrl}/api/embed` // Endpoint as specified
// Apply model-specific query prefix if required
@ -70,7 +77,10 @@ export class CodeIndexOllamaEmbedder implements IEmbedder {
// Add timeout to prevent indefinite hanging
const controller = new AbortController()
const timeoutId = setTimeout(() => controller.abort(), OLLAMA_EMBEDDING_TIMEOUT_MS)
let embeddingTimeoutId = undefined
if (this.embeddingTimeoutMs > 0) {
embeddingTimeoutId = setTimeout(() => controller.abort(), this.embeddingTimeoutMs)
}
const response = await fetch(url, {
method: "POST",
@ -83,7 +93,7 @@ export class CodeIndexOllamaEmbedder implements IEmbedder {
}),
signal: controller.signal,
})
clearTimeout(timeoutId)
clearTimeout(embeddingTimeoutId)
if (!response.ok) {
let errorBody = t("embeddings:ollama.couldNotReadErrorBody")
@ -149,7 +159,10 @@ export class CodeIndexOllamaEmbedder implements IEmbedder {
// Add timeout to prevent indefinite hanging
const controller = new AbortController()
const timeoutId = setTimeout(() => controller.abort(), OLLAMA_VALIDATION_TIMEOUT_MS)
let validationTimeoutId = undefined
if (this.validationTimeoutMs > 0) {
validationTimeoutId = setTimeout(() => controller.abort(), this.validationTimeoutMs)
}
const modelsResponse = await fetch(modelsUrl, {
method: "GET",
@ -158,7 +171,7 @@ export class CodeIndexOllamaEmbedder implements IEmbedder {
},
signal: controller.signal,
})
clearTimeout(timeoutId)
clearTimeout(validationTimeoutId)
if (!modelsResponse.ok) {
if (modelsResponse.status === 404) {
@ -184,9 +197,9 @@ export class CodeIndexOllamaEmbedder implements IEmbedder {
const modelExists = models.some((m: any) => {
const modelName = m.name || ""
return (
modelName === this.defaultModelId ||
modelName === `${this.defaultModelId}:latest` ||
modelName === this.defaultModelId.replace(":latest", "")
modelName === this.modelId ||
modelName === `${this.modelId}:latest` ||
modelName === this.modelId.replace(":latest", "")
)
})
@ -195,7 +208,7 @@ export class CodeIndexOllamaEmbedder implements IEmbedder {
return {
valid: false,
error: t("embeddings:ollama.modelNotFound", {
modelId: this.defaultModelId,
modelId: this.modelId,
availableModels,
}),
}
@ -206,7 +219,10 @@ export class CodeIndexOllamaEmbedder implements IEmbedder {
// Add timeout for test request too
const testController = new AbortController()
const testTimeoutId = setTimeout(() => testController.abort(), OLLAMA_VALIDATION_TIMEOUT_MS)
let testTimeoutId = undefined
if (this.validationTimeoutMs > 0) {
testTimeoutId = setTimeout(() => testController.abort(), this.validationTimeoutMs)
}
const testResponse = await fetch(testUrl, {
method: "POST",
@ -214,7 +230,7 @@ export class CodeIndexOllamaEmbedder implements IEmbedder {
"Content-Type": "application/json",
},
body: JSON.stringify({
model: this.defaultModelId,
model: this.modelId,
input: ["test"],
}),
signal: testController.signal,
@ -224,7 +240,7 @@ export class CodeIndexOllamaEmbedder implements IEmbedder {
if (!testResponse.ok) {
return {
valid: false,
error: t("embeddings:ollama.modelNotEmbeddingCapable", { modelId: this.defaultModelId }),
error: t("embeddings:ollama.modelNotEmbeddingCapable", { modelId: this.modelId }),
}
}

View file

@ -34,6 +34,8 @@ export type PreviousConfigSnapshot = {
modelDimension?: number // Generic dimension property
openAiKey?: string
ollamaBaseUrl?: string
ollamaEmbeddingTimeoutMs?: number
ollamaValidationTimeoutMs?: number
openAiCompatibleBaseUrl?: string
openAiCompatibleApiKey?: string
geminiApiKey?: string

View file

@ -250,6 +250,9 @@ export interface WebviewMessage {
codebaseIndexSearchMinScore?: number
codebaseIndexOpenRouterSpecificProvider?: string // OpenRouter provider routing
codebaseIndexOllamaEmbeddingTimeoutMs?: number
codebaseIndexOllamaValidationTimeoutMs?: number
// Secret settings
codeIndexOpenAiKey?: string
codeIndexQdrantApiKey?: string

View file

@ -74,6 +74,10 @@ interface LocalCodeIndexSettings {
codebaseIndexBedrockRegion?: string
codebaseIndexBedrockProfile?: string
// Ollama-specific settings
codebaseIndexOllamaEmbeddingTimeoutMs?: number
codebaseIndexOllamaValidationTimeoutMs?: number
// Secret settings (start empty, will be loaded separately)
codeIndexOpenAiKey?: string
codeIndexQdrantApiKey?: string
@ -113,6 +117,8 @@ const createValidationSchema = (provider: EmbedderProvider, t: any) => {
.min(1, t("settings:codeIndex.validation.ollamaBaseUrlRequired"))
.url(t("settings:codeIndex.validation.invalidOllamaUrl")),
codebaseIndexEmbedderModelId: z.string().min(1, t("settings:codeIndex.validation.modelIdRequired")),
codebaseIndexOllamaEmbeddingTimeoutMs: z.number().optional(),
codebaseIndexOllamaValidationTimeoutMs: z.number().optional(),
codebaseIndexEmbedderModelDimension: z
.number()
.min(1, t("settings:codeIndex.validation.modelDimensionRequired"))
@ -219,6 +225,8 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
codebaseIndexSearchMinScore: CODEBASE_INDEX_DEFAULTS.DEFAULT_SEARCH_MIN_SCORE,
codebaseIndexBedrockRegion: "",
codebaseIndexBedrockProfile: "",
codebaseIndexOllamaEmbeddingTimeoutMs: undefined,
codebaseIndexOllamaValidationTimeoutMs: undefined,
codeIndexOpenAiKey: "",
codeIndexQdrantApiKey: "",
codebaseIndexOpenAiCompatibleBaseUrl: "",
@ -258,6 +266,10 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
codebaseIndexConfig.codebaseIndexSearchMinScore ?? CODEBASE_INDEX_DEFAULTS.DEFAULT_SEARCH_MIN_SCORE,
codebaseIndexBedrockRegion: codebaseIndexConfig.codebaseIndexBedrockRegion || "",
codebaseIndexBedrockProfile: codebaseIndexConfig.codebaseIndexBedrockProfile || "",
codebaseIndexOllamaEmbeddingTimeoutMs:
codebaseIndexConfig.codebaseIndexOllamaEmbeddingTimeoutMs || undefined,
codebaseIndexOllamaValidationTimeoutMs:
codebaseIndexConfig.codebaseIndexOllamaValidationTimeoutMs || undefined,
codeIndexOpenAiKey: "",
codeIndexQdrantApiKey: "",
codebaseIndexOpenAiCompatibleBaseUrl: codebaseIndexConfig.codebaseIndexOpenAiCompatibleBaseUrl || "",
@ -888,6 +900,66 @@ export const CodeIndexPopover: React.FC<CodeIndexPopoverProps> = ({
)}
</div>
<div className="space-y-2">
<label className="text-sm font-medium">
{t("settings:codeIndex.ollamaEmbeddingTimeoutMsLabel")}
</label>
<VSCodeTextField
value={
currentSettings.codebaseIndexOllamaEmbeddingTimeoutMs?.toString() ||
""
}
onInput={(e: any) => {
const value = e.target.value
? parseInt(e.target.value, 10) || undefined
: undefined
updateSetting("codebaseIndexOllamaEmbeddingTimeoutMs", value)
}}
placeholder={t(
"settings:codeIndex.ollamaEmbeddingTimeoutMsPlaceholder",
)}
className={cn("w-full", {
"border-red-500":
formErrors.codebaseIndexOllamaEmbeddingTimeoutMs,
})}
/>
{formErrors.codebaseIndexOllamaEmbeddingTimeoutMs && (
<p className="text-xs text-vscode-errorForeground mt-1 mb-0">
{formErrors.codebaseIndexOllamaEmbeddingTimeoutMs}
</p>
)}
</div>
<div className="space-y-2">
<label className="text-sm font-medium">
{t("settings:codeIndex.ollamaValidationTimeoutMsLabel")}
</label>
<VSCodeTextField
value={
currentSettings.codebaseIndexOllamaValidationTimeoutMs?.toString() ||
""
}
onInput={(e: any) => {
const value = e.target.value
? parseInt(e.target.value, 10) || undefined
: undefined
updateSetting("codebaseIndexOllamaValidationTimeoutMs", value)
}}
placeholder={t(
"settings:codeIndex.ollamaValidationTimeoutMsPlaceholder",
)}
className={cn("w-full", {
"border-red-500":
formErrors.codebaseIndexOllamaValidationTimeoutMs,
})}
/>
{formErrors.codebaseIndexOllamaValidationTimeoutMs && (
<p className="text-xs text-vscode-errorForeground mt-1 mb-0">
{formErrors.codebaseIndexOllamaValidationTimeoutMs}
</p>
)}
</div>
<div className="space-y-2">
<label className="text-sm font-medium">
{t("settings:codeIndex.modelDimensionLabel")}

View file

@ -104,6 +104,10 @@
"modelLabel": "Model",
"selectModelPlaceholder": "Seleccionar model",
"ollamaUrlLabel": "URL d'Ollama:",
"ollamaEmbeddingTimeoutMsLabel": "Temps d'espera de la sol·licitud d'embedding (ms)",
"ollamaEmbeddingTimeoutMsPlaceholder": "p. ex. 30000",
"ollamaValidationTimeoutMsLabel": "Temps d'espera de la sol·licitud de validació (ms)",
"ollamaValidationTimeoutMsPlaceholder": "p. ex. 10000",
"qdrantUrlLabel": "URL de Qdrant",
"qdrantKeyLabel": "Clau de Qdrant:",
"startIndexingButton": "Iniciar",

View file

@ -112,6 +112,10 @@
"selectModelPlaceholder": "Modell auswählen",
"ollamaUrlLabel": "Ollama-URL:",
"ollamaBaseUrlLabel": "Ollama Basis-URL",
"ollamaEmbeddingTimeoutMsLabel": "Embedding-Anfrage-Timeout (ms)",
"ollamaEmbeddingTimeoutMsPlaceholder": "60000",
"ollamaValidationTimeoutMsLabel": "Validierungs-Anfrage-Timeout (ms)",
"ollamaValidationTimeoutMsPlaceholder": "30000",
"qdrantUrlLabel": "Qdrant-URL",
"qdrantKeyLabel": "Qdrant-Schlüssel:",
"qdrantApiKeyLabel": "Qdrant API-Schlüssel",

View file

@ -118,6 +118,10 @@
"selectModelPlaceholder": "Select model",
"ollamaUrlLabel": "Ollama URL:",
"ollamaBaseUrlLabel": "Ollama Base URL",
"ollamaEmbeddingTimeoutMsLabel": "Embedding Request Timeout (ms)",
"ollamaEmbeddingTimeoutMsPlaceholder": "60000",
"ollamaValidationTimeoutMsLabel": "Validation Request Timeout (ms)",
"ollamaValidationTimeoutMsPlaceholder": "30000",
"qdrantUrlLabel": "Qdrant URL",
"qdrantKeyLabel": "Qdrant Key:",
"qdrantApiKeyLabel": "Qdrant API Key",

View file

@ -112,6 +112,10 @@
"selectModelPlaceholder": "Seleccionar modelo",
"ollamaUrlLabel": "URL de Ollama:",
"ollamaBaseUrlLabel": "URL base de Ollama",
"ollamaEmbeddingTimeoutMsLabel": "Tiempo de espera de solicitud de embedding (ms)",
"ollamaEmbeddingTimeoutMsPlaceholder": "60000",
"ollamaValidationTimeoutMsLabel": "Tiempo de espera de solicitud de validación (ms)",
"ollamaValidationTimeoutMsPlaceholder": "30000",
"qdrantUrlLabel": "URL de Qdrant",
"qdrantKeyLabel": "Clave de Qdrant:",
"qdrantApiKeyLabel": "Clave API de Qdrant",

View file

@ -112,6 +112,10 @@
"selectModelPlaceholder": "Sélectionner un modèle",
"ollamaUrlLabel": "URL Ollama :",
"ollamaBaseUrlLabel": "URL de base Ollama",
"ollamaEmbeddingTimeoutMsLabel": "Délai d'expiration de la requête d'embedding (ms)",
"ollamaEmbeddingTimeoutMsPlaceholder": "60000",
"ollamaValidationTimeoutMsLabel": "Délai d'expiration de la requête de validation (ms)",
"ollamaValidationTimeoutMsPlaceholder": "30000",
"qdrantUrlLabel": "URL Qdrant",
"qdrantKeyLabel": "Clé Qdrant :",
"qdrantApiKeyLabel": "Clé API Qdrant",

View file

@ -104,6 +104,10 @@
"modelLabel": "मॉडल",
"selectModelPlaceholder": "मॉडल चुनें",
"ollamaUrlLabel": "Ollama URL:",
"ollamaEmbeddingTimeoutMsLabel": "एम्बेडिंग अनुरोध टाइमआउट (ms)",
"ollamaEmbeddingTimeoutMsPlaceholder": "जैसे, 30000",
"ollamaValidationTimeoutMsLabel": "सत्यापन अनुरोध टाइमआउट (ms)",
"ollamaValidationTimeoutMsPlaceholder": "जैसे, 10000",
"qdrantUrlLabel": "Qdrant URL",
"qdrantKeyLabel": "Qdrant कुंजी:",
"startIndexingButton": "शुरू करें",

View file

@ -104,6 +104,10 @@
"modelLabel": "Model",
"selectModelPlaceholder": "Pilih model",
"ollamaUrlLabel": "Ollama URL:",
"ollamaEmbeddingTimeoutMsLabel": "Timeout permintaan embedding (ms)",
"ollamaEmbeddingTimeoutMsPlaceholder": "contoh: 30000",
"ollamaValidationTimeoutMsLabel": "Timeout permintaan validasi (ms)",
"ollamaValidationTimeoutMsPlaceholder": "contoh: 10000",
"qdrantUrlLabel": "Qdrant URL",
"qdrantKeyLabel": "Qdrant Key:",
"startIndexingButton": "Mulai",

View file

@ -104,6 +104,10 @@
"modelLabel": "Modello",
"selectModelPlaceholder": "Seleziona modello",
"ollamaUrlLabel": "URL Ollama:",
"ollamaEmbeddingTimeoutMsLabel": "Timeout richiesta embedding (ms)",
"ollamaEmbeddingTimeoutMsPlaceholder": "es., 30000",
"ollamaValidationTimeoutMsLabel": "Timeout richiesta validazione (ms)",
"ollamaValidationTimeoutMsPlaceholder": "es., 10000",
"qdrantUrlLabel": "URL Qdrant",
"qdrantKeyLabel": "Chiave Qdrant:",
"startIndexingButton": "Avvia",

View file

@ -104,6 +104,10 @@
"modelLabel": "モデル",
"selectModelPlaceholder": "モデルを選択",
"ollamaUrlLabel": "Ollama URL",
"ollamaEmbeddingTimeoutMsLabel": "埋め込みリクエストタイムアウト (ms)",
"ollamaEmbeddingTimeoutMsPlaceholder": "例、30000",
"ollamaValidationTimeoutMsLabel": "検証リクエストタイムアウト (ms)",
"ollamaValidationTimeoutMsPlaceholder": "例、10000",
"qdrantUrlLabel": "Qdrant URL",
"qdrantKeyLabel": "Qdrantキー",
"startIndexingButton": "開始",

View file

@ -104,6 +104,10 @@
"modelLabel": "모델",
"selectModelPlaceholder": "모델 선택",
"ollamaUrlLabel": "Ollama URL:",
"ollamaEmbeddingTimeoutMsLabel": "임베딩 요청 시간 초과 (ms)",
"ollamaEmbeddingTimeoutMsPlaceholder": "예, 30000",
"ollamaValidationTimeoutMsLabel": "검증 요청 시간 초과 (ms)",
"ollamaValidationTimeoutMsPlaceholder": "예, 10000",
"qdrantUrlLabel": "Qdrant URL",
"qdrantKeyLabel": "Qdrant 키:",
"startIndexingButton": "시작",

View file

@ -104,6 +104,10 @@
"modelLabel": "Model",
"selectModelPlaceholder": "Selecteer model",
"ollamaUrlLabel": "Ollama URL:",
"ollamaEmbeddingTimeoutMsLabel": "Embedding verzoek timeout (ms)",
"ollamaEmbeddingTimeoutMsPlaceholder": "bijv. 30000",
"ollamaValidationTimeoutMsLabel": "Validatie verzoek timeout (ms)",
"ollamaValidationTimeoutMsPlaceholder": "bijv. 10000",
"qdrantUrlLabel": "Qdrant URL",
"qdrantKeyLabel": "Qdrant-sleutel:",
"startIndexingButton": "Start",

View file

@ -104,6 +104,10 @@
"modelLabel": "Model",
"selectModelPlaceholder": "Wybierz model",
"ollamaUrlLabel": "URL Ollama:",
"ollamaEmbeddingTimeoutMsLabel": "Limit czasu żądania osadzania (ms)",
"ollamaEmbeddingTimeoutMsPlaceholder": "np. 30000",
"ollamaValidationTimeoutMsLabel": "Limit czasu żądania walidacji (ms)",
"ollamaValidationTimeoutMsPlaceholder": "np. 10000",
"qdrantUrlLabel": "URL Qdrant",
"qdrantKeyLabel": "Klucz Qdrant:",
"startIndexingButton": "Rozpocznij",

View file

@ -104,6 +104,10 @@
"modelLabel": "Modelo",
"selectModelPlaceholder": "Selecionar modelo",
"ollamaUrlLabel": "URL Ollama:",
"ollamaEmbeddingTimeoutMsLabel": "Timeout da requisição de embedding (ms)",
"ollamaEmbeddingTimeoutMsPlaceholder": "ex: 30000",
"ollamaValidationTimeoutMsLabel": "Timeout da requisição de validação (ms)",
"ollamaValidationTimeoutMsPlaceholder": "ex: 10000",
"qdrantUrlLabel": "URL Qdrant",
"qdrantKeyLabel": "Chave Qdrant:",
"startIndexingButton": "Iniciar",

View file

@ -104,6 +104,10 @@
"modelLabel": "Модель",
"selectModelPlaceholder": "Выберите модель",
"ollamaUrlLabel": "URL Ollama:",
"ollamaEmbeddingTimeoutMsLabel": "Тайм-аут запроса встраивания (мс)",
"ollamaEmbeddingTimeoutMsPlaceholder": "например, 30000",
"ollamaValidationTimeoutMsLabel": "Тайм-аут запроса валидации (мс)",
"ollamaValidationTimeoutMsPlaceholder": "например, 10000",
"qdrantUrlLabel": "URL Qdrant",
"qdrantKeyLabel": "Ключ Qdrant:",
"startIndexingButton": "Начать",

View file

@ -104,6 +104,10 @@
"modelLabel": "Model",
"selectModelPlaceholder": "Model seç",
"ollamaUrlLabel": "Ollama URL:",
"ollamaEmbeddingTimeoutMsLabel": "Embedding isteği zaman aşımı (ms)",
"ollamaEmbeddingTimeoutMsPlaceholder": "örn. 30000",
"ollamaValidationTimeoutMsLabel": "Doğrulama isteği zaman aşımı (ms)",
"ollamaValidationTimeoutMsPlaceholder": "örn. 10000",
"qdrantUrlLabel": "Qdrant URL",
"qdrantKeyLabel": "Qdrant Anahtarı:",
"startIndexingButton": "Başlat",

View file

@ -104,6 +104,10 @@
"modelLabel": "Mô hình",
"selectModelPlaceholder": "Chọn mô hình",
"ollamaUrlLabel": "URL Ollama:",
"ollamaEmbeddingTimeoutMsLabel": "Thời gian chờ yêu cầu embedding (ms)",
"ollamaEmbeddingTimeoutMsPlaceholder": "ví dụ: 30000",
"ollamaValidationTimeoutMsLabel": "Thời gian chờ yêu cầu xác thực (ms)",
"ollamaValidationTimeoutMsPlaceholder": "ví dụ: 10000",
"qdrantUrlLabel": "URL Qdrant",
"qdrantKeyLabel": "Khóa Qdrant:",
"startIndexingButton": "Bắt đầu",

View file

@ -112,6 +112,10 @@
"selectModelPlaceholder": "选择模型",
"ollamaUrlLabel": "Ollama URL",
"ollamaBaseUrlLabel": "Ollama 基础 URL",
"ollamaEmbeddingTimeoutMsLabel": "嵌入请求超时时间 (毫秒)",
"ollamaEmbeddingTimeoutMsPlaceholder": "60000",
"ollamaValidationTimeoutMsLabel": "验证请求超时时间 (毫秒)",
"ollamaValidationTimeoutMsPlaceholder": "30000",
"qdrantUrlLabel": "Qdrant URL",
"qdrantKeyLabel": "Qdrant 密钥:",
"qdrantApiKeyLabel": "Qdrant API 密钥",

View file

@ -123,6 +123,10 @@
"modelPlaceholder": "輸入模型名稱",
"selectModel": "選擇模型",
"ollamaBaseUrlLabel": "Ollama 基礎 URL",
"ollamaEmbeddingTimeoutMsLabel": "嵌入請求超時時間 (毫秒)",
"ollamaEmbeddingTimeoutMsPlaceholder": "60000",
"ollamaValidationTimeoutMsLabel": "驗證請求超時時間 (毫秒)",
"ollamaValidationTimeoutMsPlaceholder": "10000",
"qdrantApiKeyLabel": "Qdrant API 金鑰",
"qdrantApiKeyPlaceholder": "輸入您的 Qdrant API 金鑰(選用)",
"setupConfigLabel": "設定",