@Preview(value="3.9.0")
public interface AgentRequest<Req extends AgentRequest<Req,Resp>,Resp extends AgentResponse>
extends org.noear.solon.lang.NonSerializable
该接口定义了向 Agent 发起调用的请求契约。它通常作为 Fluent API 的入口,
允许调用者链式配置 Prompt、Session、拦截器以及模型参数。
作为一个“活跃”的构建器,它不仅承载请求参数,还负责触发最终的推理执行过程。
| 限定符和类型 | 方法和说明 |
|---|---|
Resp |
call()
同步调用:阻塞等待推理结束并返回完整响应
|
Req |
session(AgentSession session)
绑定或切换当前请求的会话上下文
|
reactor.core.publisher.Flux<AgentChunk> |
stream()
响应式流输出:实时推送推理过程中的中间结果(如思考、动作、内容片段)
|
Req session(AgentSession session)
Resp call() throws java.lang.Throwable
java.lang.Throwablereactor.core.publisher.Flux<AgentChunk> stream()