mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-15 05:31:33 +03:00
ea227df30e
https://github.com/StanGirard/quivr/assets/63923024/08554dd5-2765-436a-b900-48b38d582f6c https://github.com/StanGirard/quivr/issues/1389
22 lines
488 B
TypeScript
22 lines
488 B
TypeScript
import { AxiosInstance } from "axios";
|
|
|
|
import { ChatMessage } from "@/app/chat/[chatId]/types";
|
|
|
|
export type QuestionAndAnwser = {
|
|
question: string;
|
|
answer: string;
|
|
};
|
|
|
|
export const addQuestionAndAnswer = async (
|
|
chatId: string,
|
|
questionAndAnswer: QuestionAndAnwser,
|
|
axiosInstance: AxiosInstance
|
|
): Promise<ChatMessage> => {
|
|
const response = await axiosInstance.post<ChatMessage>(
|
|
`/chat/${chatId}/question/answer`,
|
|
questionAndAnswer
|
|
);
|
|
|
|
return response.data;
|
|
};
|