Skip to content
Snippets Groups Projects
Unverified Commit bf435b28 authored by Timothy Carambat's avatar Timothy Carambat Committed by GitHub
Browse files

Adjust how text is split depending on input type (#1238)

resolves #1230
parent ca63012c
Branches
Tags
No related merge requests found
......@@ -23,7 +23,9 @@ class AzureOpenAiEmbedder {
}
async embedTextInput(textInput) {
const result = await this.embedChunks(textInput);
const result = await this.embedChunks(
Array.isArray(textInput) ? textInput : [textInput]
);
return result?.[0] || [];
}
......
......@@ -31,7 +31,9 @@ class LMStudioEmbedder {
}
async embedTextInput(textInput) {
const result = await this.embedChunks(textInput);
const result = await this.embedChunks(
Array.isArray(textInput) ? textInput : [textInput]
);
return result?.[0] || [];
}
......
......@@ -23,7 +23,9 @@ class LocalAiEmbedder {
}
async embedTextInput(textInput) {
const result = await this.embedChunks(textInput);
const result = await this.embedChunks(
Array.isArray(textInput) ? textInput : [textInput]
);
return result?.[0] || [];
}
......
......@@ -119,7 +119,9 @@ class NativeEmbedder {
}
async embedTextInput(textInput) {
const result = await this.embedChunks(textInput);
const result = await this.embedChunks(
Array.isArray(textInput) ? textInput : [textInput]
);
return result?.[0] || [];
}
......
......@@ -30,7 +30,9 @@ class OllamaEmbedder {
}
async embedTextInput(textInput) {
const result = await this.embedChunks([textInput]);
const result = await this.embedChunks(
Array.isArray(textInput) ? textInput : [textInput]
);
return result?.[0] || [];
}
......
......@@ -19,7 +19,9 @@ class OpenAiEmbedder {
}
async embedTextInput(textInput) {
const result = await this.embedChunks(textInput);
const result = await this.embedChunks(
Array.isArray(textInput) ? textInput : [textInput]
);
return result?.[0] || [];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment