mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-30 17:13:15 +00:00
Add support for setting the number of chunks processed per query
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user