Add support for setting the number of chunks processed per query

This commit is contained in:
Alex
2024-03-22 14:50:56 +00:00
parent add2db5b7a
commit ed08123550
7 changed files with 76 additions and 9 deletions

View File

@@ -11,6 +11,7 @@ export function fetchAnswerApi(
history: Array<any> = [],
conversationId: string | null,
promptId: string | null,
chunks: string,
): Promise<
| {
result: any;
@@ -65,6 +66,7 @@ export function fetchAnswerApi(
active_docs: docPath,
conversation_id: conversationId,
prompt_id: promptId,
chunks: chunks,
}),
signal,
})
@@ -95,6 +97,7 @@ export function fetchAnswerSteaming(
history: Array<any> = [],
conversationId: string | null,
promptId: string | null,
chunks: string,
onEvent: (event: MessageEvent) => void,
): Promise<Answer> {
let namePath = selectedDocs.name;
@@ -130,6 +133,7 @@ export function fetchAnswerSteaming(
history: JSON.stringify(history),
conversation_id: conversationId,
prompt_id: promptId,
chunks: chunks,
};
fetch(apiHost + '/stream', {
method: 'POST',
@@ -192,6 +196,7 @@ export function searchEndpoint(
selectedDocs: Doc,
conversation_id: string | null,
history: Array<any> = [],
chunks: string,
) {
/*
"active_docs": "default",
@@ -223,6 +228,7 @@ export function searchEndpoint(
active_docs: docPath,
conversation_id,
history,
chunks: chunks,
};
return fetch(`${apiHost}/api/search`, {
method: 'POST',