huggingface / chat-ui

Open source codebase powering the HuggingChat app
https://huggingface.co/chat
Apache License 2.0
6.73k stars 940 forks source link

Assistant feature: Send user query as part of template variable GET request #1302

Open ethayu opened 4 days ago

ethayu commented 4 days ago

Trying to integrate RAG as an assistant. Thinking of using a template variable that makes a GET request (with the prompt as the request body), to get the relevant documents as context. Is this possible (i.e. there is a special variable in the system prompt page for the user query), or is there a better way of doing this?

ethayu commented 4 days ago

Found this: https://github.com/huggingface/chat-ui/pull/949, but seems to only support time and date. Would be great if something like {{ query }} was supported, and secondly we could query {{url=123.123.123.12:8000/{{ query }}}}, or something like that.

Alternatively, maybe {{url=123.123.123.12:8000/}} could pass the query as part of the request body (as mentioned already)

ethayu commented 4 days ago

https://github.com/huggingface/chat-ui/issues/611 would also make it doable.