AS AgentScopeAPI 手册 / API Reference
功能域Functional domain

基础设施Infrastructure

框架内部共享的基础设施:通用类型、异常体系、JSON/传输层、配置、日志、指标以及协议生成代码。排查底层问题时从这里入手。Shared foundations: common types, exceptions, JSON/transport, configuration, logging, metrics and generated protocol code.

57类型总数types total
16Python
41Java
3学习锚点learning anchors

心智模型Mental model

基础设施层提供通用类型、异常、序列化、传输、配置与工具函数,是其他所有功能域的共同底座。Infrastructure provides shared types, exceptions, serialization, transport, configuration and utilities underpinning every other domain.

先学什么What to learn first

  • 异常类型决定重试策略:可重试错误与业务错误要分开。Exception types drive retry policy: separate retryable failures from business errors.
  • 序列化边界要固定版本与字段兼容策略。Serialization boundaries need versioning and field-compatibility rules.
  • 通用工具不要承载业务状态。Shared utilities must not hold business state.

生产常见坑Production pitfalls

  • 捕获所有异常后静默返回,掩盖真实故障。Catching everything and returning silently hides real failures.
  • 内部类型直接暴露为对外协议,升级即破坏兼容。Exposing internal types as public contracts breaks on upgrade.

进入对应闯关单元Practice this domain →

域内图谱Domain map

点击节点打开 API 页面;拖拽平移,滚轮缩放。Click a node to open its API page. Drag to pan, scroll to zoom.

Python Java

Python API 集Python API set 16

归入本功能域的全部 Python 公开类型,按所属包分组。Every public Python type classified into this domain, grouped by owning package.

agentscope.exception7
AgentOrientedExceptionclass智能体 Oriented 异常,表示执行过程中的错误。
DeveloperOrientedExceptionclassDeveloper Oriented 异常,表示执行过程中的错误。
StructuredOutputErrorclass结构化输出错误,为框架提供通用类型与基础能力。
ToolGroupInactiveErrorclass工具组 Inactive 错误,为框架提供通用类型与基础能力。
ToolInterruptedErrorclass工具 Interrupted 错误,为框架提供通用类型与基础能力。
ToolJSONDecodeErrorclass工具 JSON Decode 错误,为框架提供通用类型与基础能力。
ToolNotFoundErrorclass工具未找到错误,为框架提供通用类型与基础能力。
agentscope.tui6
ChatUIclass聊天 UI,为框架提供通用类型与基础能力。
ChatUI.ConfirmedclassConfirmed,为框架提供通用类型与基础能力。
ChatUI.ExternalExecutionSubmittedclass外部执行 Submitted,为框架提供通用类型与基础能力。
ChatUI.InterruptRequestedclass中断 Requested,为框架提供通用类型与基础能力。
ChatUI.SubmittedclassSubmitted,为框架提供通用类型与基础能力。
MessagesUIclass消息 UI,为框架提供通用类型与基础能力。
agentscope.types2
ErrorInfoclass错误信息,为框架提供通用类型与基础能力。
ErrorTypeclass错误类型,为框架提供通用类型与基础能力。
agentscope.console1
ConsoleRendererclass控制台渲染器,为框架提供通用类型与基础能力。

Java API 集Java API set 41

归入本功能域的全部 Java 公开类型,按包分组并标注构件。Every public Java type classified into this domain, grouped by package with its artifact.

io.agentscope.extensions.agentprotocol10
AgentFactoryinterfaceagentscope-extensions-agent-protocol定义智能体工厂契约的接口。
AgentProtocolAutoConfigurationclassagentscope-extensions-agent-protocol智能体协议 Auto 配置,保存相关配置项。
AgentProtocolConstantsclassagentscope-extensions-agent-protocol智能体协议 Constants,为框架提供通用类型与基础能力。
AgentProtocolControllerclassagentscope-extensions-agent-protocol智能体协议控制器,为框架提供通用类型与基础能力。
AgentProtocolEventBusinterfaceagentscope-extensions-agent-protocol定义智能体协议事件总线契约的接口。
AgentProtocolPropertiesclassagentscope-extensions-agent-protocol智能体协议属性,为框架提供通用类型与基础能力。
AgentProtocolTaskEventBusclassagentscope-extensions-agent-protocol智能体协议任务事件总线,为框架提供通用类型与基础能力。
AgentRequestrecordagentscope-extensions-agent-protocol承载智能体请求数据的记录类型。
ProtocolTaskRepositoryinterfaceagentscope-extensions-agent-protocol定义协议任务仓库契约的接口。
RuntimeContextCustomizerinterfaceagentscope-extensions-agent-protocol定义运行时上下文 Customizer契约的接口。
io.agentscope.core.util8
ExceptionUtilsclassagentscope-core异常 Utils,为框架提供通用类型与基础能力。
JacksonJsonCodecclassagentscope-coreJackson JSON 编解码器,为框架提供通用类型与基础能力。
JsonCodecinterfaceagentscope-core定义 JSON 编解码器契约的接口。
JsonExceptionclassagentscope-coreJSON 异常,表示执行过程中的错误。
JsonSchemaUtilsclassagentscope-coreJSON 模式 Utils,为框架提供通用类型与基础能力。
JsonUtilsclassagentscope-coreJSON Utils,为框架提供通用类型与基础能力。
MessageUtilsclassagentscope-core消息 Utils,为框架提供通用类型与基础能力。
TypeUtilsclassagentscope-core类型 Utils,为框架提供通用类型与基础能力。
io.agentscope.examples.compression.extra7
Builderclassmodel-request-compressionCompressingOkHttpTransport的构建器。
Builderclassmodel-request-compressionCompressionConfig的构建器。
CompressingOkHttpTransportclassmodel-request-compressionCompressing Ok HTTP 传输层,为框架提供通用类型与基础能力。
CompressionConfigclassmodel-request-compression用于HTTP 压缩的配置。
CompressionEncodingenummodel-request-compression定义压缩 Encoding相关取值的枚举。
CompressionExceptionclassmodel-request-compression压缩异常,表示执行过程中的错误。
CompressionUtilsclassmodel-request-compression压缩 Utils,为框架提供通用类型与基础能力。
io.agentscope.core.shutdown6
AgentScopeJvmShutdownHookclassagentscope-coreAgentScope Jvm Shutdown 钩子,为框架提供通用类型与基础能力。
AgentShuttingDownExceptionclassagentscope-core智能体 Shutting Down 异常,表示执行过程中的错误。
GracefulShutdownConfigrecordagentscope-core承载 Graceful Shutdown 配置数据的记录类型。
GracefulShutdownManagerclassagentscope-coreGraceful Shutdown 管理器,为框架提供通用类型与基础能力。
GracefulShutdownMiddlewareclassagentscope-coreGraceful Shutdown 中间件,在智能体执行流程中提供横切扩展。
PartialReasoningPolicyenumagentscope-core定义Partial 推理策略相关取值的枚举。
io.agentscope.core.interruption4
Builderclassagentscope-coreInterruptContext的构建器。
InterruptContextclassagentscope-core中断上下文,为框架提供通用类型与基础能力。
InterruptControlclassagentscope-core中断 Control,为框架提供通用类型与基础能力。
InterruptSourceenumagentscope-core定义中断来源相关取值的枚举。
io.agentscope.core.exception2
AgentExceptionInforecordagentscope-core承载智能体异常信息数据的记录类型。
CompositeAgentExceptionclassagentscope-coreComposite 智能体异常,表示执行过程中的错误。
io.agentscope.core.chat.completions.builder1
ChatCompletionsResponseBuilderclassagentscope-extensions-chat-completions-web聊天补全响应构建器,用于构建并配置目标实例。
io.agentscope.core.chat.completions.converter1
ChatMessageConverterclassagentscope-extensions-chat-completions-web聊天消息转换器,为框架提供通用类型与基础能力。
io.agentscope.core.chat.completions.streaming1
ChatCompletionsStreamingAdapterclassagentscope-extensions-chat-completions-web聊天补全流式适配器,为框架提供通用类型与基础能力。
io.agentscope.examples.compression1
CompressionDemoclassmodel-request-compression压缩 Demo,为框架提供通用类型与基础能力。

Python ↔ Java 对照Python ↔ Java

Python

AgentScopeExceptionset_id_factory

Java

JsonUtilsTransportAgentScopeException

两套实现共享同一概念模型,但在并发(async/await 与 Reactor)、打包(wheel 模块与 Maven 构件)和生命周期 API 上存在差异。需要精确签名时请使用 API 全景。The two implementations follow the same conceptual model but differ in concurrency (async/await vs Reactor), packaging (wheel modules vs Maven artifacts) and lifecycle APIs. Use the full API map to locate exact signatures.

打开 API 全景Open full API map →

基于官方固定版本源码静态生成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.