Commit e08e395
committed
Document how to get Open WebUI to run tool calls server-side over the API
People wiring scripts, bots and agents into Open WebUI keep hitting the same wall: they send a prompt with tool_ids, get a raw tool_calls object back, and have no way to execute a builtin tool like web search or the code interpreter from their own process. Nothing in the docs said which request fields decide whether Open WebUI runs the tools for you.
The new Reference page spells that out. `/api/chat/completions` behaves in three different ways and the request body picks which one: the native multi-round loop needs `chat_id`, `id` and `stream: true` and returns its answer through the chat record rather than the HTTP body; `session_id` is what makes the builtin tools available at all; legacy function calling runs one round inline and returns everything in the response. It also flags that a model's configured terminal is applied by the frontend, so an API caller has to send `terminal_id` itself.
It is written as two end-to-end paths, full agentic loop and single request, each with the calls in order, both streaming and non-streaming, both with and without the chat being saved, and a reusable Python script at the end. Reference lives in Reference rather than Tutorials because this is core API behaviour, not a community integration.1 parent ea9cb27 commit e08e395
4 files changed
Lines changed: 461 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
62 | 78 | | |
63 | 79 | | |
64 | 80 | | |
| |||
0 commit comments