feat: support messages to ask AI (#1380)

This commit is contained in:
boojack
2023-03-18 22:07:14 +08:00
committed by GitHub
parent 8b20cb9fd2
commit 573f07ec82
8 changed files with 99 additions and 108 deletions

View File

@ -250,16 +250,8 @@ export function deleteIdentityProvider(id: IdentityProviderId) {
return axios.delete(`/api/idp/${id}`);
}
export function postChatCompletion(prompt: string) {
return axios.post<ResponseObject<string>>(`/api/openai/chat-completion`, {
prompt,
});
}
export function postTextCompletion(prompt: string) {
return axios.post<ResponseObject<string>>(`/api/openai/text-completion`, {
prompt,
});
export function postChatCompletion(messages: any[]) {
return axios.post<ResponseObject<string>>(`/api/openai/chat-completion`, messages);
}
export function checkOpenAIEnabled() {