refactor: extract client Chat API to seperate file
phodal opened this issue · 1 comments
phodal commented
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
in current design, all client use API in their components, like ChatRoot.tsx
:
async function createConversation() {
const response = await fetch("/api/chatgpt/conversation", {
method: "POST",
body: JSON.stringify({
action: "create_conversation",
name: "Default name",
} as RequestCreateConversation),
});
...
}
CGQAQ commented
I'll take it