__init__.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. """
  2. Reson Agent - 模块化、可扩展的 Agent 框架
  3. 核心导出:
  4. - AgentRunner: Agent 执行引擎
  5. - RunConfig: 运行配置
  6. - Trace, Message, Goal: 执行追踪
  7. - Skill: 技能模型
  8. - tool: 工具装饰器
  9. - TraceStore: 存储接口
  10. """
  11. # 核心引擎
  12. from agent.core.runner import AgentRunner, CallResult, RunConfig
  13. from agent.core.presets import AgentPreset, AGENT_PRESETS, get_preset
  14. # 执行追踪
  15. from agent.trace.models import (
  16. Trace,
  17. Message,
  18. Step,
  19. StepType,
  20. StepStatus,
  21. ChatMessage,
  22. Messages,
  23. MessageContent,
  24. )
  25. from agent.trace.goal_models import Goal, GoalTree, GoalStatus
  26. from agent.trace.attachments import AttachmentRef
  27. from agent.trace.protocols import TraceAttachmentStore, TraceStore
  28. from agent.trace.store import FileSystemTraceStore
  29. # 技能系统
  30. from agent.skill.models import Skill
  31. # 工具系统
  32. from agent.tools import tool, ToolRegistry, get_tool_registry
  33. from agent.tools.models import ToolCapability, ToolResult, ToolContext
  34. # 显式任务执行与独立验证
  35. from agent.orchestration import (
  36. CompletionPolicy,
  37. AgentRole,
  38. TaskStatus,
  39. ValidationVerdict,
  40. ExecutionStats,
  41. FailureCode,
  42. BackgroundOperation,
  43. OperationKind,
  44. OperationStatus,
  45. OrchestrationAPIError,
  46. OrchestrationClient,
  47. ValidationMode,
  48. ValidationPlan,
  49. TaskCoordinator,
  50. AgentExecutor,
  51. TaskStore,
  52. FileSystemTaskStore,
  53. ArtifactStore,
  54. FileSystemArtifactStore,
  55. OrchestrationConfig,
  56. RoleRunConfigOverrides,
  57. RoleRunConfigResolver,
  58. RoleSystemPromptOverride,
  59. RoleSystemPromptResolver,
  60. )
  61. from agent.orchestration.wiring import wire_orchestration
  62. # SDK 公开入口:统一调用 remote / 本地 Agent
  63. from agent.client import invoke_agent
  64. __version__ = "0.4.0"
  65. __all__ = [
  66. # Core
  67. "AgentRunner",
  68. "CallResult",
  69. "RunConfig",
  70. "AgentPreset",
  71. "AGENT_PRESETS",
  72. "get_preset",
  73. # Trace
  74. "Trace",
  75. "Message",
  76. "ChatMessage",
  77. "Messages",
  78. "MessageContent",
  79. "Step",
  80. "StepType",
  81. "StepStatus",
  82. "Goal",
  83. "GoalTree",
  84. "GoalStatus",
  85. "TraceStore",
  86. "TraceAttachmentStore",
  87. "AttachmentRef",
  88. "FileSystemTraceStore",
  89. # Skill
  90. "Skill",
  91. # Tools
  92. "tool",
  93. "ToolRegistry",
  94. "get_tool_registry",
  95. "ToolCapability",
  96. "ToolResult",
  97. "ToolContext",
  98. # Orchestration
  99. "CompletionPolicy",
  100. "AgentRole",
  101. "TaskStatus",
  102. "ValidationVerdict",
  103. "ExecutionStats",
  104. "FailureCode",
  105. "BackgroundOperation",
  106. "OperationKind",
  107. "OperationStatus",
  108. "OrchestrationAPIError",
  109. "OrchestrationClient",
  110. "ValidationMode",
  111. "ValidationPlan",
  112. "TaskCoordinator",
  113. "AgentExecutor",
  114. "TaskStore",
  115. "FileSystemTaskStore",
  116. "ArtifactStore",
  117. "FileSystemArtifactStore",
  118. "OrchestrationConfig",
  119. "RoleRunConfigOverrides",
  120. "RoleRunConfigResolver",
  121. "RoleSystemPromptOverride",
  122. "RoleSystemPromptResolver",
  123. "wire_orchestration",
  124. # SDK
  125. "invoke_agent",
  126. ]