open-webui / open-webui

User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
https://openwebui.com
MIT License
49.4k stars 6.07k forks source link

feat: openai compatible tool usage #4436

Open CookSleep opened 3 months ago

CookSleep commented 3 months ago

Is your feature request related to a problem? Please describe. I instructed the model to use a Tool to obtain search engine results, and attempted to have the model call the Tool again after reviewing the search result text returned by the Tool, in order to read the content of specific search result links. However, currently Open WebUI only allows one Tool call per model output, which is quite frustrating...

Describe the solution you'd like Allow the model to call functions multiple times in a single output

Describe alternatives you've considered Making multiple requests, but that only makes searching more of a hassle!

Additional context I know some folks might recommend I use Reader's search engine, but honestly, I feel the quality of content it retrieves is just so-so, and the diversity doesn't really meet my expectations... Plus, I'm sure there are tons of use cases where models need to call functions multiple times in one output.

justinh-rahb commented 3 months ago

I believe @michaelpoluektov has been pushing for adding support for this as well. I don't recall if he's already started an issue or PR for it, but he can chime in his thoughts either way.

michaelpoluektov commented 3 months ago

I started an issue but no PR yet. Adding this requires quite a major refactor, and I'll most likely submit a draft this weekend. Issue tracked here:

https://github.com/open-webui/open-webui/issues/4219

lee-b commented 3 months ago

FYI, LocalAI implements the required backend API locally: https://localai.io/features/openai-functions/