custom prompts

This commit is contained in:
Alex
2023-11-22 23:55:41 +00:00
parent e9a9cbbd07
commit b2770f67a1
6 changed files with 244 additions and 127 deletions

View File

@@ -9,6 +9,7 @@ export function fetchAnswerApi(
selectedDocs: Doc,
history: Array<any> = [],
conversationId: string | null,
promptId: string | null,
): Promise<
| {
result: any;
@@ -62,6 +63,7 @@ export function fetchAnswerApi(
history: history,
active_docs: docPath,
conversation_id: conversationId,
prompt_id: promptId,
}),
})
.then((response) => {
@@ -89,6 +91,7 @@ export function fetchAnswerSteaming(
selectedDocs: Doc,
history: Array<any> = [],
conversationId: string | null,
promptId: string | null,
onEvent: (event: MessageEvent) => void,
): Promise<Answer> {
let namePath = selectedDocs.name;
@@ -123,6 +126,7 @@ export function fetchAnswerSteaming(
active_docs: docPath,
history: JSON.stringify(history),
conversation_id: conversationId,
prompt_id: promptId,
};
fetch(apiHost + '/stream', {