mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: implement openai integration (#1245)
* feat: implement openai integration * chore: update
This commit is contained in:
@ -246,6 +246,22 @@ export function deleteIdentityProvider(id: IdentityProviderId) {
|
||||
return axios.delete(`/api/idp/${id}`);
|
||||
}
|
||||
|
||||
export function postChatCompletion(prompt: string) {
|
||||
return axios.post<ResponseObject<string>>(`/api/opanai/chat-completion`, {
|
||||
prompt,
|
||||
});
|
||||
}
|
||||
|
||||
export function postTextCompletion(prompt: string) {
|
||||
return axios.post<ResponseObject<string>>(`/api/opanai/text-completion`, {
|
||||
prompt,
|
||||
});
|
||||
}
|
||||
|
||||
export function checkOpenAIEnabled() {
|
||||
return axios.get<ResponseObject<boolean>>(`/api/opanai/enabled`);
|
||||
}
|
||||
|
||||
export async function getRepoStarCount() {
|
||||
const { data } = await axios.get(`https://api.github.com/repos/usememos/memos`, {
|
||||
headers: {
|
||||
|
Reference in New Issue
Block a user