karthink / gptel

A simple LLM client for Emacs
GNU General Public License v3.0
1.04k stars 111 forks source link

Add chatbotui #280

Closed chenyanming closed 2 months ago

chenyanming commented 2 months ago

I am not sure if it is ok to add chatbotui as backend to this project (It is not LLM, it is just a chatbot ui project). I am using it happily though! It is a little bit tricky to get it work, I am using cookie, for example:

  (defvar gptel--chatbotui (gptel-make-chatbotui "Chatbot-ui"
                             :host "127.0.0.1"
                             :protocol "http"
                             :endpoint "/api/chat"
                             :stream t
                             :header `(("Cookie" . ,(auth-source-pick-first-password :host "chatbot-ui-cookie")))
                             :models '("gpt-4-32k")))
karthink commented 2 months ago

Thank you @chenyanming! Will take a look soon.

(It is not LLM, it is just a chatbot ui project)

So are Ollama and GPT4All, so this is not an issue.

Can you direct me to the API documentation for chatbotui? I'd like to understand what it sends so I can review this PR.

chenyanming commented 2 months ago

Hi, @karthink sorry I can not find the api doc, and probably it is https://github.com/mckaywrigley/chatbot-ui/blob/main/components%2Fchat%2Fchat-helpers%2Findex.ts. However, I handle the request in a tricky way: I made a request on the UI, and checked it on the inspector.

karthink commented 2 months ago

If there's no stable API available I'm less confident about adding this to gptel -- it can break any time they update chatbot-ui, and I won't be able to keep up with their changes. Perhaps gptel-chatbotui can be an add-on package to gptel instead?

chenyanming commented 2 months ago

No problem :)

karthink commented 2 months ago

Cheers @chenyanming