update for custom model, ollama

This commit is contained in:
duanfuxiang
2025-03-20 12:44:53 +08:00
parent 76ecca0da9
commit 570e8d9564
9 changed files with 155 additions and 115 deletions

View File

@@ -159,10 +159,9 @@ export const getEmbeddingModel = (
dangerouslyAllowBrowser: true,
baseURL: `${settings.ollamaProvider.baseUrl}/v1`,
})
const modelInfo = GetEmbeddingModelInfo(settings.embeddingModelProvider, settings.embeddingModelId)
return {
id: settings.embeddingModelId,
dimension: modelInfo.dimensions,
dimension: 0,
getEmbedding: async (text: string) => {
if (!settings.ollamaProvider.baseUrl) {
throw new LLMBaseUrlNotSetException(