fix: rag is not working for nitro (#2511)
Signed-off-by: James <james@jan.ai> Co-authored-by: James <james@jan.ai>
This commit is contained in:
parent
84e1b09e84
commit
5eed8a5eca
@ -31,7 +31,6 @@ export class Retrieval {
|
|||||||
public updateEmbeddingEngine(engine: string): void {
|
public updateEmbeddingEngine(engine: string): void {
|
||||||
// Engine settings are not compatible with the current embedding model params
|
// Engine settings are not compatible with the current embedding model params
|
||||||
// Switch case manually for now
|
// Switch case manually for now
|
||||||
const settings = readEmbeddingEngine(engine)
|
|
||||||
if (engine === 'nitro') {
|
if (engine === 'nitro') {
|
||||||
this.embeddingModel = new OpenAIEmbeddings(
|
this.embeddingModel = new OpenAIEmbeddings(
|
||||||
{ openAIApiKey: 'nitro-embedding' },
|
{ openAIApiKey: 'nitro-embedding' },
|
||||||
@ -40,6 +39,7 @@ export class Retrieval {
|
|||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
// Fallback to OpenAI Settings
|
// Fallback to OpenAI Settings
|
||||||
|
const settings = readEmbeddingEngine(engine)
|
||||||
this.embeddingModel = new OpenAIEmbeddings({
|
this.embeddingModel = new OpenAIEmbeddings({
|
||||||
openAIApiKey: settings.api_key,
|
openAIApiKey: settings.api_key,
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user