AS AgentScopeAPI 手册 / API Reference

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说明Description
default public Mono<Msg> callAgent(AgentBase instance, List<Msg> inputMessages, Supplier<Mono<Msg>> agentCall)
default
调用智能体。
Calls the agent.
default public Flux<ChatResponse> callModel(ChatModelBase instance, List<Msg> inputMessages, List<ToolSchema> toolSchemas, GenerateOptions options, Supplier<Flux<ChatResponse>> modelCall)
default
调用模型。
Calls the model.
default public Mono<ToolResultBlock> callTool(Toolkit toolkit, ToolCallParam toolCallParam, Supplier<Mono<ToolResultBlock>> toolKitCall)
default
调用工具。
Calls the tool.
default public TReq TResp TParams List<TReq> callFormat(AbstractBaseFormatter<TReq, TResp, TParams> formatter, List<Msg> msgs, Supplier<List<TReq>> formatCall)
default
调用格式。
Calls the format.
default public TResp TResp runWithContext(ContextView reactorCtx, Supplier<TResp> inner)
default
运行使用上下文。
Runs the with context.
default public void shutdown()
default
关闭资源并释放连接。
Releases resources and connections.

方法详情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
instanceAgentBase实例(类型 `AgentBase`)。The instance.
inputMessagesList<Msg>输入消息(类型 `List`)。The input messages.
agentCallSupplier<Mono<Msg>>智能体调用(类型 `Supplier >`)。The agent call.
返回Returns Mono<Msg>
返回Mono。Returns mono.
源码Source io/agentscope/core/tracing/Tracer.java:41–44

callModel

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
instanceChatModelBase实例(类型 `ChatModelBase`)。The instance.
inputMessagesList<Msg>输入消息(类型 `List`)。The input messages.
toolSchemasList<ToolSchema>工具模式(类型 `List`)。The tool schemas.
optionsGenerateOptions选项(类型 `GenerateOptions`)。The options.
modelCallSupplier<Flux<ChatResponse>>模型调用(类型 `Supplier >`)。The model call.
返回Returns Flux<ChatResponse>
返回Flux。Returns flux.
源码Source io/agentscope/core/tracing/Tracer.java:46–53

callTool

default public Mono<ToolResultBlock> callTool(Toolkit toolkit, ToolCallParam toolCallParam, Supplier<Mono<ToolResultBlock>> toolKitCall)
default

调用工具。

Calls the tool.

参数Parameters
名称Name类型Type说明Description
toolkitToolkit工具包(类型 `Toolkit`)。The toolkit.
toolCallParamToolCallParam工具调用参数(类型 `ToolCallParam`)。The tool call param.
toolKitCallSupplier<Mono<ToolResultBlock>>工具包调用(类型 `Supplier >`)。The tool kit call.
返回Returns Mono<ToolResultBlock>
返回Mono。Returns mono.
源码Source io/agentscope/core/tracing/Tracer.java:55–60

callFormat

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
formatterAbstractBaseFormatter<TReq, TResp, TParams>格式化器(类型 `AbstractBaseFormatter`)。The formatter.
msgsList<Msg>消息列表(类型 `List`)。The msgs.
formatCallSupplier<List<TReq>>格式调用(类型 `Supplier >`)。The format call.
返回Returns List<TReq>
返回列出。Returns list.
源码Source io/agentscope/core/tracing/Tracer.java:62–67

runWithContext

default public TResp TResp runWithContext(ContextView reactorCtx, Supplier<TResp> inner)
default

运行使用上下文。

Runs the with context.

参数Parameters
名称Name类型Type说明Description
reactorCtxContextViewreactor Ctx(类型 `ContextView`)。The reactor ctx.
innerSupplier<TResp>inner(类型 `Supplier`)。The inner.
返回Returns TResp
返回TResp。Returns t resp.
源码Source io/agentscope/core/tracing/Tracer.java:69–71

shutdown

default public void shutdown()
default

关闭资源并释放连接。

Releases resources and connections.

源码Source io/agentscope/core/tracing/Tracer.java:73
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.