You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: adminforth/documentation/docs/tutorial/08-Plugins/01-agent.md
+18-7Lines changed: 18 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -700,9 +700,9 @@ If your existing checkpoint table already uses different column names, keep your
700
700
701
701
## Reverse proxy and CDN configuration for streaming
702
702
703
-
The agent streams responses from `<baseURL>/adminapi/v1/agent/response` using server-sent events, where `<baseURL>` is your AdminForth base path or an empty string when deployed at the domain root. If your proxy buffers responses, the UI will receive the answer only after generation is finished.
703
+
The agent streams responses from `<baseURL>/adminapi/v1/agent/response` using server-sent events, where `<baseURL>` is your AdminForth base path or an empty string when deployed at the domain root. Voice mode also streams from `<baseURL>/adminapi/v1/agent/speech-response` after uploading the recorded audio. If your proxy buffers responses, the UI will receive the answer only after generation is finished.
704
704
705
-
For Nginx, disable response buffering on this endpoint. The critical line is `proxy_buffering off;`.
705
+
For Nginx, disable response buffering on both endpoints. The critical line is `proxy_buffering off;`.
proxy_buffering off; # required for streaming voice responses
725
+
proxy_pass http://127.0.0.1:3500;
726
+
}
717
727
```
718
728
719
-
Traefik forwards streaming responses immediately by default. The line that must stay off this route is any buffering middleware attachment such as `traefik.http.routers.adminforth-agent.middlewares=buffering@docker`. If your main router uses extra middlewares, create a dedicated router for the agent stream endpoint and do not attach buffering to it:
729
+
Traefik forwards streaming responses immediately by default. The line that must stay off these routes is any buffering middleware attachment such as `traefik.http.routers.adminforth-agent.middlewares=buffering@docker`. If your main router uses extra middlewares, create a dedicated router for the agent stream endpoints and do not attach buffering to it:
Replace `<baseURL>` with the same base path you use for AdminForth. For example, when `ADMIN_BASE_URL = '/admin/'`, the endpoint becomes`/admin/adminapi/v1/agent/response`.
753
+
Replace `<baseURL>` with the same base path you use for AdminForth. For example, when `ADMIN_BASE_URL = '/admin/'`, the endpoints become`/admin/adminapi/v1/agent/response` and `/admin/adminapi/v1/agent/speech-response`.
744
754
745
755
### CDN
746
756
747
-
Cloudflare by default buffers responses, which breaks streaming. To fix it, create a page rule for your domain with a "Response Body Buffering" setting turned off for the agent stream endpoint (`<baseURL>/adminapi/v1/agent/response`).
757
+
Cloudflare by default buffers responses, which breaks streaming. To fix it, create a page rule for your domain with a "Response Body Buffering" setting turned off for the agent stream endpoints (`<baseURL>/adminapi/v1/agent/response` and `<baseURL>/adminapi/v1/agent/speech-response`).
748
758
749
-

759
+
If Cloudflare returns a 403 response with `cf-mitigated: challenge` for `<baseURL>/adminapi/v1/agent/speech-response`, the request was blocked before it reached AdminForth. Create a WAF or bot rule exception for authenticated requests to this endpoint, because browser `fetch` calls with `multipart/form-data` cannot complete an HTML challenge page.
0 commit comments