perf: attribute

This commit is contained in:
archer
2023-07-08 10:37:25 +08:00
parent 23642af6e2
commit aef42cef9d
17 changed files with 1177 additions and 351 deletions

View File

@@ -72,6 +72,12 @@ export async function kbSearch({
maxToken = 2500,
userChatInput
}: Props): Promise<Response> {
if (kb_ids.length === 0)
return {
isEmpty: true,
rawSearch: [],
quotePrompt: undefined
};
// get vector
const promptVector = await openaiEmbedding_system({
input: [userChatInput]