prompt-engineering / click-prompt

ClickPrompt - Streamline your prompt design, with ClickPrompt, you can easily view, share, and run these prompts with just one click. ClickPrompt 用于一键轻松查看、分享和执行您的 Prompt。
https://www.clickprompt.org/
MIT License
2.28k stars 197 forks source link

refactor: extract client Chat API to seperate file #106

Closed phodal closed 1 year ago

phodal commented 1 year ago

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 1 year ago

I'll take it