Skip to content

Commit c0f8b44

Browse files
committed
azure embedding model not used
1 parent 9364ebd commit c0f8b44

File tree

3 files changed

+1
-25
lines changed

3 files changed

+1
-25
lines changed

.env.template

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ API_TOKEN=
55
AZURE_API_KEY=
66
AZURE_RESOURCE=
77

8-
AZURE_OPENAI_EMBEDDER_MODEL=
9-
AZURE_OPENAI_EMBEDDER_DEPLOYMENT=
10-
118
# Encryption
129
ENCRYPTION_KEY=
1310
ENCRYPTION_IV=
Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
1-
import { AzureOpenAIEmbeddings } from '@langchain/openai'
21
import { OllamaEmbeddings } from '@langchain/ollama'
32
import {
4-
AZURE_API_KEY,
5-
AZURE_OPENAI_EMBEDDER_DEPLOYMENT,
6-
AZURE_OPENAI_EMBEDDER_MODEL,
7-
AZURE_RESOURCE,
83
LAAMA_API_TOKEN,
94
LAAMA_API_URL,
105
OLLAMA_EMBEDDER_MODEL,
116
// OLLAMA_URL,
127
} from '../../util/config'
138

14-
const _azureOpenAIEmbedder = new AzureOpenAIEmbeddings({
15-
model: AZURE_OPENAI_EMBEDDER_MODEL,
16-
azureOpenAIApiKey: AZURE_API_KEY,
17-
azureOpenAIApiVersion: '2023-05-15',
18-
azureOpenAIApiDeploymentName: AZURE_OPENAI_EMBEDDER_DEPLOYMENT,
19-
azureOpenAIApiInstanceName: AZURE_RESOURCE,
20-
})
21-
229
const _ollamaEmbedder = new OllamaEmbeddings({
2310
model: OLLAMA_EMBEDDER_MODEL,
2411
baseUrl: LAAMA_API_URL,
@@ -33,9 +20,4 @@ const _ollamaEmbedder = new OllamaEmbeddings({
3320
},
3421
})
3522

36-
export const getEmbedder = (embedderType = 'ollama') => {
37-
if (embedderType === 'azure') {
38-
return _azureOpenAIEmbedder
39-
}
40-
return _ollamaEmbedder
41-
}
23+
export const getEmbedder = () => _ollamaEmbedder

src/server/util/config.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ export const AZURE_API_KEY = getEnv('AZURE_API_KEY', 'placeholder')
99

1010
export const AZURE_RESOURCE = getEnv('AZURE_RESOURCE', 'placeholder')
1111

12-
export const AZURE_OPENAI_EMBEDDER_MODEL = getEnv('AZURE_OPENAI_EMBEDDER_MODEL', 'placeholder')
13-
export const AZURE_OPENAI_EMBEDDER_DEPLOYMENT = getEnv('AZURE_OPENAI_EMBEDDER_DEPLOYMENT', 'placeholder')
14-
1512
export const DATABASE_URL = getEnv('DATABASE_URL', 'placeholder-this-needs-to-be-set')
1613

1714
export const CHROMADB_URL = getEnv('CHROMADB_URL', 'http://chromadb:8001')

0 commit comments

Comments
 (0)