feat: gpt demo

This commit is contained in:
Tristan Yang
2023-02-15 09:54:06 +08:00
parent e7ec003b23
commit 99c14d1bac
3 changed files with 79 additions and 1 deletions
+10 -1
View File
@@ -147,6 +147,14 @@ export const messageApi = createApi({
}
}
}),
replyWithChatGPT: builder.mutation<{ message: string, prompt: string }, string>({
query: (prompt) => ({
url: `https://official.voce.chat/chatgpt/complete`,
method: "POST",
body: { prompt, api_key: "test" }
})
}),
replyMessage: builder.mutation<
number,
{ from_uid: number, reply_mid: number; content: string; type: ContentTypeKey, properties?: {} }
@@ -209,5 +217,6 @@ export const {
useReplyMessageMutation,
useLazyDeleteMessageQuery,
useReadMessageMutation,
useCreateArchiveMutation
useCreateArchiveMutation,
useReplyWithChatGPTMutation
} = messageApi;