mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-14 21:21:56 +03:00
b3fb8fc3bc
* fix: update prompt_id logic in payload * feat: add getPublicPrompts to sdk * feat: add public prompt picker
25 lines
743 B
TypeScript
25 lines
743 B
TypeScript
import { useAxios } from "@/lib/hooks";
|
|
|
|
import {
|
|
createPrompt,
|
|
CreatePromptProps,
|
|
getPrompt,
|
|
getPublicPrompts,
|
|
PromptUpdatableProperties,
|
|
updatePrompt,
|
|
} from "./prompt";
|
|
|
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
export const usePromptApi = () => {
|
|
const { axiosInstance } = useAxios();
|
|
|
|
return {
|
|
createPrompt: async (prompt: CreatePromptProps) =>
|
|
createPrompt(prompt, axiosInstance),
|
|
getPrompt: async (promptId: string) => getPrompt(promptId, axiosInstance),
|
|
updatePrompt: async (promptId: string, prompt: PromptUpdatableProperties) =>
|
|
updatePrompt(promptId, prompt, axiosInstance),
|
|
getPublicPrompts: async () => await getPublicPrompts(axiosInstance),
|
|
};
|
|
};
|