diff --git a/workers/example/stream_chat.toml b/workers/example/stream_chat.toml new file mode 100644 index 0000000..f8273e5 --- /dev/null +++ b/workers/example/stream_chat.toml @@ -0,0 +1,13 @@ +[POST] +summary = "模拟 AI 流式对话(SSE,逐 token 输出)" +docstring = "流式端点示例:@rpc_method 返回生成器,框架逐块多回复推送,网关以 text/event-stream 转发。curl -N 可观察逐块到达。" +auth_required = false +stream = true +# 流式超时模型: timeout = 流总寿命上限(zenoh query deadline), +# stream_idle_timeout = 网关侧连续无数据块的最大间隔 +timeout = 300.0 +stream_idle_timeout = 10.0 +params = [ + "prompt: str", + "tokens: int" +]