modify: rust worker

This commit is contained in:
2026-08-22 03:27:32 +08:00
parent 541a9b5e33
commit 3cc8a63c1d
5 changed files with 64 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
# rsdemo.stream —— 流式端点(SSE,逐块多回复)
[POST]
summary = "Rust 参考插件:模拟 AI 流式输出(SSE,逐 token)"
docstring = "流式端点:Rust handler 返回流,逐块多回复推送,网关以 text/event-stream 转发。tokens > 50 时第 26 块抛错,演示 {\"error\": ...} 收尾块。"
auth_required = false
stream = true
# 流式超时模型: timeout = 流总寿命上限(zenoh query deadline)
timeout = 300.0
stream_idle_timeout = 10.0
params = [
"prompt: str",
"tokens: int"
]