Tracer
@Deprecated(forRemoval = true, since = "2.0.0") public interface Tracer
源码Source
io/agentscope/core/tracing/Tracer.java:38–74定义追踪器契约的接口。位于 io.agentscope.core.tracing 包。核心成员包括 callAgent、callModel、callTool、callFormat、runWithContext、shutdown。
@deprecated since 2.0.0. Declared in io.agentscope.core.tracing.
方法摘要Method Summary
方法详情Method Detail
callAgent
default public Mono<Msg> callAgent(AgentBase instance, List<Msg> inputMessages, Supplier<Mono<Msg>> agentCall)
default
调用智能体。
Calls the agent.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
instance | AgentBase | 实例(类型 `AgentBase`)。The instance. |
inputMessages | List<Msg> | 输入消息(类型 `List`)。The input messages. |
agentCall | Supplier<Mono<Msg>> | 智能体调用(类型 `Supplier >`)。The agent call. |
Mono<Msg>返回Mono。Returns mono.
源码Source
io/agentscope/core/tracing/Tracer.java:41–44callModel
default public Flux<ChatResponse> callModel(ChatModelBase instance, List<Msg> inputMessages, List<ToolSchema> toolSchemas, GenerateOptions options, Supplier<Flux<ChatResponse>> modelCall)
default
调用模型。
Calls the model.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
instance | ChatModelBase | 实例(类型 `ChatModelBase`)。The instance. |
inputMessages | List<Msg> | 输入消息(类型 `List`)。The input messages. |
toolSchemas | List<ToolSchema> | 工具模式(类型 `List`)。The tool schemas. |
options | GenerateOptions | 选项(类型 `GenerateOptions`)。The options. |
modelCall | Supplier<Flux<ChatResponse>> | 模型调用(类型 `Supplier >`)。The model call. |
Flux<ChatResponse>返回Flux。Returns flux.
源码Source
io/agentscope/core/tracing/Tracer.java:46–53callTool
default public Mono<ToolResultBlock> callTool(Toolkit toolkit, ToolCallParam toolCallParam, Supplier<Mono<ToolResultBlock>> toolKitCall)
default
调用工具。
Calls the tool.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
toolkit | Toolkit | 工具包(类型 `Toolkit`)。The toolkit. |
toolCallParam | ToolCallParam | 工具调用参数(类型 `ToolCallParam`)。The tool call param. |
toolKitCall | Supplier<Mono<ToolResultBlock>> | 工具包调用(类型 `Supplier >`)。The tool kit call. |
Mono<ToolResultBlock>返回Mono。Returns mono.
源码Source
io/agentscope/core/tracing/Tracer.java:55–60callFormat
default public TReq TResp TParams List<TReq> callFormat(AbstractBaseFormatter<TReq, TResp, TParams> formatter, List<Msg> msgs, Supplier<List<TReq>> formatCall)
default
调用格式。
Calls the format.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
formatter | AbstractBaseFormatter<TReq, TResp, TParams> | 格式化器(类型 `AbstractBaseFormatter`)。The formatter. |
msgs | List<Msg> | 消息列表(类型 `List`)。The msgs. |
formatCall | Supplier<List<TReq>> | 格式调用(类型 `Supplier >`)。The format call. |
List<TReq>返回列出。Returns list.
源码Source
io/agentscope/core/tracing/Tracer.java:62–67runWithContext
default public TResp TResp runWithContext(ContextView reactorCtx, Supplier<TResp> inner)
default
运行使用上下文。
Runs the with context.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
reactorCtx | ContextView | reactor Ctx(类型 `ContextView`)。The reactor ctx. |
inner | Supplier<TResp> | inner(类型 `Supplier`)。The inner. |
TResp返回TResp。Returns t resp.
源码Source
io/agentscope/core/tracing/Tracer.java:69–71shutdown
default public void shutdown()
default
关闭资源并释放连接。
Releases resources and connections.
源码Source
io/agentscope/core/tracing/Tracer.java:73