history init

This commit is contained in:
Alex
2023-05-18 14:27:13 +01:00
parent e49dd0cc6a
commit 74845aed64
3 changed files with 18 additions and 11 deletions

View File

@@ -7,6 +7,7 @@ export function fetchAnswerApi(
question: string,
apiKey: string,
selectedDocs: Doc,
history: Array<any> = [],
): Promise<Answer> {
let namePath = selectedDocs.name;
if (selectedDocs.language === namePath) {
@@ -37,7 +38,7 @@ export function fetchAnswerApi(
question: question,
api_key: apiKey,
embeddings_key: apiKey,
history: localStorage.getItem('chatHistory'),
history: history,
active_docs: docPath,
}),
})

View File

@@ -19,6 +19,7 @@ export const fetchAnswer = createAsyncThunk<
question,
state.preference.apiKey,
state.preference.selectedDocs!,
state.conversation.queries,
);
return answer;
});