agentrun-inner-test 0.0.12__tar.gz → 0.0.64__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. {agentrun_inner_test-0.0.12/agentrun_inner_test.egg-info → agentrun_inner_test-0.0.64}/PKG-INFO +5 -2
  2. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/__init__.py +173 -24
  3. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/agent_runtime/__endpoint_async_template.py +40 -0
  4. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/agent_runtime/api/control.py +1 -1
  5. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/agent_runtime/endpoint.py +79 -0
  6. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/credential/api/control.py +1 -1
  7. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/credential/model.py +2 -2
  8. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/agentscope/__init__.py +2 -1
  9. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/agentscope/builtin.py +23 -0
  10. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/agentscope/model_adapter.py +1 -1
  11. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/builtin/__init__.py +2 -0
  12. agentrun_inner_test-0.0.64/agentrun/integration/builtin/knowledgebase.py +137 -0
  13. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/builtin/model.py +10 -14
  14. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/crewai/__init__.py +2 -1
  15. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/crewai/builtin.py +23 -0
  16. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/crewai/model_adapter.py +5 -1
  17. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/google_adk/__init__.py +2 -1
  18. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/google_adk/builtin.py +23 -0
  19. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/google_adk/model_adapter.py +4 -1
  20. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/google_adk/tool_adapter.py +3 -2
  21. agentrun_inner_test-0.0.64/agentrun/integration/langchain/__init__.py +31 -0
  22. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/langchain/builtin.py +23 -0
  23. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/langchain/model_adapter.py +2 -2
  24. agentrun_inner_test-0.0.64/agentrun/integration/langgraph/__init__.py +36 -0
  25. agentrun_inner_test-0.0.64/agentrun/integration/langgraph/agent_converter.py +1073 -0
  26. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/langgraph/builtin.py +23 -0
  27. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/pydantic_ai/__init__.py +2 -1
  28. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/pydantic_ai/builtin.py +23 -0
  29. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/pydantic_ai/model_adapter.py +4 -4
  30. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/utils/adapter.py +3 -2
  31. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/utils/canonical.py +7 -0
  32. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/utils/model.py +6 -3
  33. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/utils/tool.py +47 -2
  34. agentrun_inner_test-0.0.64/agentrun/knowledgebase/__client_async_template.py +173 -0
  35. agentrun_inner_test-0.0.64/agentrun/knowledgebase/__init__.py +53 -0
  36. agentrun_inner_test-0.0.64/agentrun/knowledgebase/__knowledgebase_async_template.py +438 -0
  37. agentrun_inner_test-0.0.64/agentrun/knowledgebase/api/__data_async_template.py +414 -0
  38. agentrun_inner_test-0.0.64/agentrun/knowledgebase/api/__init__.py +19 -0
  39. agentrun_inner_test-0.0.64/agentrun/knowledgebase/api/control.py +606 -0
  40. agentrun_inner_test-0.0.64/agentrun/knowledgebase/api/data.py +624 -0
  41. agentrun_inner_test-0.0.64/agentrun/knowledgebase/client.py +311 -0
  42. agentrun_inner_test-0.0.64/agentrun/knowledgebase/knowledgebase.py +748 -0
  43. agentrun_inner_test-0.0.64/agentrun/knowledgebase/model.py +270 -0
  44. agentrun_inner_test-0.0.64/agentrun/memory_collection/__client_async_template.py +178 -0
  45. agentrun_inner_test-0.0.64/agentrun/memory_collection/__init__.py +37 -0
  46. agentrun_inner_test-0.0.64/agentrun/memory_collection/__memory_collection_async_template.py +457 -0
  47. agentrun_inner_test-0.0.64/agentrun/memory_collection/api/__init__.py +5 -0
  48. agentrun_inner_test-0.0.64/agentrun/memory_collection/api/control.py +610 -0
  49. agentrun_inner_test-0.0.64/agentrun/memory_collection/client.py +323 -0
  50. agentrun_inner_test-0.0.64/agentrun/memory_collection/memory_collection.py +844 -0
  51. agentrun_inner_test-0.0.64/agentrun/memory_collection/model.py +162 -0
  52. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/model/api/control.py +1 -1
  53. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/model/model.py +20 -3
  54. agentrun_inner_test-0.0.64/agentrun/sandbox/__aio_sandbox_async_template.py +523 -0
  55. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/__browser_sandbox_async_template.py +1 -1
  56. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/__client_async_template.py +32 -7
  57. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/__init__.py +15 -0
  58. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/__sandbox_async_template.py +79 -14
  59. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/__template_async_template.py +29 -27
  60. agentrun_inner_test-0.0.64/agentrun/sandbox/aio_sandbox.py +912 -0
  61. agentrun_inner_test-0.0.64/agentrun/sandbox/api/__aio_data_async_template.py +335 -0
  62. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/api/__init__.py +2 -0
  63. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/api/__sandbox_data_async_template.py +15 -8
  64. agentrun_inner_test-0.0.64/agentrun/sandbox/api/aio_data.py +551 -0
  65. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/api/control.py +1 -1
  66. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/api/sandbox_data.py +29 -15
  67. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/browser_sandbox.py +2 -2
  68. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/client.py +60 -13
  69. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/model.py +128 -13
  70. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/sandbox.py +129 -18
  71. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/template.py +29 -27
  72. agentrun_inner_test-0.0.64/agentrun/server/__init__.py +191 -0
  73. agentrun_inner_test-0.0.64/agentrun/server/agui_normalizer.py +180 -0
  74. agentrun_inner_test-0.0.64/agentrun/server/agui_protocol.py +797 -0
  75. agentrun_inner_test-0.0.64/agentrun/server/invoker.py +309 -0
  76. agentrun_inner_test-0.0.64/agentrun/server/model.py +427 -0
  77. agentrun_inner_test-0.0.64/agentrun/server/openai_protocol.py +535 -0
  78. agentrun_inner_test-0.0.64/agentrun/server/protocol.py +140 -0
  79. agentrun_inner_test-0.0.64/agentrun/server/server.py +208 -0
  80. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/toolset/api/control.py +1 -1
  81. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/toolset/api/openapi.py +5 -2
  82. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/utils/__data_api_async_template.py +6 -0
  83. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/utils/config.py +12 -0
  84. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/utils/control_api.py +27 -0
  85. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/utils/data_api.py +11 -0
  86. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/utils/exception.py +5 -3
  87. agentrun_inner_test-0.0.64/agentrun/utils/helper.py +108 -0
  88. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64/agentrun_inner_test.egg-info}/PKG-INFO +5 -2
  89. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun_inner_test.egg-info/SOURCES.txt +26 -0
  90. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun_inner_test.egg-info/requires.txt +4 -1
  91. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/pyproject.toml +77 -3
  92. agentrun_inner_test-0.0.12/agentrun/integration/langchain/__init__.py +0 -9
  93. agentrun_inner_test-0.0.12/agentrun/integration/langgraph/__init__.py +0 -13
  94. agentrun_inner_test-0.0.12/agentrun/server/__init__.py +0 -82
  95. agentrun_inner_test-0.0.12/agentrun/server/invoker.py +0 -131
  96. agentrun_inner_test-0.0.12/agentrun/server/model.py +0 -225
  97. agentrun_inner_test-0.0.12/agentrun/server/openai_protocol.py +0 -798
  98. agentrun_inner_test-0.0.12/agentrun/server/protocol.py +0 -96
  99. agentrun_inner_test-0.0.12/agentrun/server/server.py +0 -192
  100. agentrun_inner_test-0.0.12/agentrun/utils/helper.py +0 -34
  101. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/LICENSE +0 -0
  102. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/README.md +0 -0
  103. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/agent_runtime/__client_async_template.py +0 -0
  104. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/agent_runtime/__init__.py +0 -0
  105. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/agent_runtime/__runtime_async_template.py +0 -0
  106. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/agent_runtime/api/__data_async_template.py +0 -0
  107. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/agent_runtime/api/__init__.py +0 -0
  108. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/agent_runtime/api/data.py +0 -0
  109. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/agent_runtime/client.py +0 -0
  110. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/agent_runtime/model.py +0 -0
  111. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/agent_runtime/runtime.py +0 -0
  112. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/credential/__client_async_template.py +0 -0
  113. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/credential/__credential_async_template.py +0 -0
  114. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/credential/__init__.py +0 -0
  115. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/credential/api/__init__.py +0 -0
  116. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/credential/client.py +0 -0
  117. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/credential/credential.py +0 -0
  118. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/__init__.py +0 -0
  119. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/agentscope/adapter.py +0 -0
  120. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/agentscope/message_adapter.py +0 -0
  121. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/agentscope/tool_adapter.py +0 -0
  122. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/builtin/sandbox.py +0 -0
  123. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/builtin/toolset.py +0 -0
  124. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/crewai/adapter.py +0 -0
  125. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/crewai/tool_adapter.py +0 -0
  126. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/google_adk/adapter.py +0 -0
  127. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/google_adk/message_adapter.py +0 -0
  128. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/langchain/adapter.py +0 -0
  129. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/langchain/message_adapter.py +0 -0
  130. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/langchain/tool_adapter.py +0 -0
  131. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/langgraph/adapter.py +0 -0
  132. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/pydantic_ai/adapter.py +0 -0
  133. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/pydantic_ai/tool_adapter.py +0 -0
  134. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/utils/__init__.py +0 -0
  135. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/integration/utils/converter.py +0 -0
  136. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/model/__client_async_template.py +0 -0
  137. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/model/__init__.py +0 -0
  138. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/model/__model_proxy_async_template.py +0 -0
  139. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/model/__model_service_async_template.py +0 -0
  140. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/model/api/__init__.py +0 -0
  141. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/model/api/data.py +0 -0
  142. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/model/client.py +0 -0
  143. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/model/model_proxy.py +0 -0
  144. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/model/model_service.py +0 -0
  145. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/__code_interpreter_sandbox_async_template.py +0 -0
  146. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/api/__browser_data_async_template.py +0 -0
  147. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/api/__code_interpreter_data_async_template.py +0 -0
  148. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/api/browser_data.py +0 -0
  149. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/api/code_interpreter_data.py +0 -0
  150. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/api/playwright_async.py +0 -0
  151. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/api/playwright_sync.py +0 -0
  152. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/sandbox/code_interpreter_sandbox.py +0 -0
  153. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/toolset/__client_async_template.py +0 -0
  154. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/toolset/__init__.py +0 -0
  155. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/toolset/__toolset_async_template.py +0 -0
  156. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/toolset/api/__init__.py +0 -0
  157. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/toolset/api/mcp.py +0 -0
  158. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/toolset/client.py +0 -0
  159. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/toolset/model.py +0 -0
  160. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/toolset/toolset.py +0 -0
  161. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/utils/__init__.py +0 -0
  162. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/utils/__resource_async_template.py +0 -0
  163. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/utils/log.py +0 -0
  164. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/utils/model.py +0 -0
  165. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun/utils/resource.py +0 -0
  166. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun_inner_test.egg-info/dependency_links.txt +0 -0
  167. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/agentrun_inner_test.egg-info/top_level.txt +0 -0
  168. {agentrun_inner_test-0.0.12 → agentrun_inner_test-0.0.64}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentrun-inner-test
3
- Version: 0.0.12
3
+ Version: 0.0.64
4
4
  Summary: Alibaba Cloud Agent Run SDK
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -13,11 +13,14 @@ Requires-Dist: typing-extensions>=4.15.0
13
13
  Requires-Dist: litellm>=1.79.3
14
14
  Requires-Dist: alibabacloud-devs20230714>=2.4.1
15
15
  Requires-Dist: pydash>=8.0.5
16
- Requires-Dist: alibabacloud-agentrun20250910>=4.0.1
16
+ Requires-Dist: alibabacloud-agentrun20250910>=5.2.0
17
17
  Requires-Dist: alibabacloud_tea_openapi>=0.4.2
18
+ Requires-Dist: alibabacloud_bailian20231229>=2.6.2
19
+ Requires-Dist: agentrun-mem0ai>=0.0.6
18
20
  Provides-Extra: server
19
21
  Requires-Dist: fastapi>=0.104.0; extra == "server"
20
22
  Requires-Dist: uvicorn>=0.24.0; extra == "server"
23
+ Requires-Dist: ag-ui-protocol>=0.1.10; extra == "server"
21
24
  Provides-Extra: langchain
22
25
  Requires-Dist: langchain>=1.0.0; python_version >= "3.10" and extra == "langchain"
23
26
  Requires-Dist: langchain-openai>=1.0.0; python_version >= "3.10" and extra == "langchain"
@@ -16,7 +16,9 @@ Provides simple and easy-to-use APIs for managing AI Agent runtime environments,
16
16
  - Integration: 框架集成 / Framework integration
17
17
  """
18
18
 
19
- __version__ = "0.0.12"
19
+ from typing import TYPE_CHECKING
20
+
21
+ __version__ = "0.0.64"
20
22
 
21
23
  # Agent Runtime
22
24
  from agentrun.agent_runtime import (
@@ -53,6 +55,22 @@ from agentrun.credential import (
53
55
  CredentialUpdateInput,
54
56
  RelatedResource,
55
57
  )
58
+ # Memory Collection
59
+ from agentrun.memory_collection import (
60
+ EmbedderConfig,
61
+ EmbedderConfigConfig,
62
+ LLMConfig,
63
+ LLMConfigConfig,
64
+ MemoryCollection,
65
+ MemoryCollectionClient,
66
+ MemoryCollectionCreateInput,
67
+ MemoryCollectionListInput,
68
+ MemoryCollectionListOutput,
69
+ MemoryCollectionUpdateInput,
70
+ NetworkConfiguration,
71
+ VectorStoreConfig,
72
+ VectorStoreConfigConfig,
73
+ )
56
74
  # Model Service
57
75
  from agentrun.model import (
58
76
  BackendType,
@@ -87,30 +105,50 @@ from agentrun.sandbox import (
87
105
  SandboxClient,
88
106
  Template,
89
107
  )
90
- # Server
91
- from agentrun.server import (
92
- AgentRequest,
93
- AgentResponse,
94
- AgentResult,
95
- AgentRunServer,
96
- AgentStreamIterator,
97
- AgentStreamResponse,
98
- AsyncInvokeAgentHandler,
99
- InvokeAgentHandler,
100
- Message,
101
- MessageRole,
102
- OpenAIProtocolHandler,
103
- ProtocolHandler,
104
- SyncInvokeAgentHandler,
105
- )
106
108
  # ToolSet
107
109
  from agentrun.toolset import ToolSet, ToolSetClient
110
+ from agentrun.utils.config import Config
108
111
  from agentrun.utils.exception import (
109
112
  ResourceAlreadyExistError,
110
113
  ResourceNotExistError,
111
114
  )
112
115
  from agentrun.utils.model import Status
113
116
 
117
+ # Server - 延迟导入以避免可选依赖问题
118
+ # Type hints for IDE and type checkers
119
+ if TYPE_CHECKING:
120
+ from agentrun.server import (
121
+ AgentEvent,
122
+ AgentEventItem,
123
+ AgentRequest,
124
+ AgentResult,
125
+ AgentResultItem,
126
+ AgentReturnType,
127
+ AgentRunServer,
128
+ AguiEventNormalizer,
129
+ AGUIProtocolConfig,
130
+ AGUIProtocolHandler,
131
+ AsyncAgentEventGenerator,
132
+ AsyncAgentResultGenerator,
133
+ AsyncInvokeAgentHandler,
134
+ BaseProtocolHandler,
135
+ EventType,
136
+ InvokeAgentHandler,
137
+ MergeOptions,
138
+ Message,
139
+ MessageRole,
140
+ OpenAIProtocolConfig,
141
+ OpenAIProtocolHandler,
142
+ ProtocolConfig,
143
+ ProtocolHandler,
144
+ ServerConfig,
145
+ SyncAgentEventGenerator,
146
+ SyncAgentResultGenerator,
147
+ SyncInvokeAgentHandler,
148
+ Tool,
149
+ ToolCall,
150
+ )
151
+
114
152
  __all__ = [
115
153
  ######## Agent Runtime ########
116
154
  # base
@@ -151,6 +189,23 @@ __all__ = [
151
189
  "CredentialCreateInput",
152
190
  "CredentialUpdateInput",
153
191
  "CredentialListInput",
192
+ ######## Memory Collection ########
193
+ # base
194
+ "MemoryCollection",
195
+ "MemoryCollectionClient",
196
+ # inner model
197
+ "EmbedderConfig",
198
+ "EmbedderConfigConfig",
199
+ "LLMConfig",
200
+ "LLMConfigConfig",
201
+ "NetworkConfiguration",
202
+ "VectorStoreConfig",
203
+ "VectorStoreConfigConfig",
204
+ # api model
205
+ "MemoryCollectionCreateInput",
206
+ "MemoryCollectionUpdateInput",
207
+ "MemoryCollectionListInput",
208
+ "MemoryCollectionListOutput",
154
209
  ######## Model ########
155
210
  # base
156
211
  "ModelClient",
@@ -188,22 +243,116 @@ __all__ = [
188
243
  ######## ToolSet ########
189
244
  "ToolSetClient",
190
245
  "ToolSet",
191
- ######## Server ########
246
+ ######## Server (延迟加载) ########
247
+ # Server
192
248
  "AgentRunServer",
249
+ # Config
250
+ "ServerConfig",
251
+ "ProtocolConfig",
252
+ "OpenAIProtocolConfig",
253
+ "AGUIProtocolConfig",
254
+ # Request/Response Models
193
255
  "AgentRequest",
194
- "AgentResponse",
256
+ "AgentEvent",
195
257
  "AgentResult",
196
- "AgentStreamResponse",
258
+ "Message",
259
+ "MessageRole",
260
+ "Tool",
261
+ "ToolCall",
262
+ # Event Types
263
+ "EventType",
264
+ # Type Aliases
265
+ "AgentEventItem",
266
+ "AgentResultItem",
267
+ "AgentReturnType",
268
+ "SyncAgentEventGenerator",
269
+ "SyncAgentResultGenerator",
270
+ "AsyncAgentEventGenerator",
271
+ "AsyncAgentResultGenerator",
197
272
  "InvokeAgentHandler",
198
273
  "AsyncInvokeAgentHandler",
199
274
  "SyncInvokeAgentHandler",
200
- "Message",
201
- "MessageRole",
275
+ # Protocol Base
202
276
  "ProtocolHandler",
277
+ "BaseProtocolHandler",
278
+ # Protocol - OpenAI
203
279
  "OpenAIProtocolHandler",
204
- "AgentStreamIterator",
280
+ # Protocol - AG-UI
281
+ "AGUIProtocolHandler",
282
+ # Event Normalizer
283
+ "AguiEventNormalizer",
284
+ # Helpers
285
+ "MergeOptions",
205
286
  ######## Others ########
206
- "Status",
207
287
  "ResourceNotExistError",
208
288
  "ResourceAlreadyExistError",
289
+ "Config",
209
290
  ]
291
+
292
+ # Server 模块的所有导出
293
+ _SERVER_EXPORTS = {
294
+ "AgentRunServer",
295
+ "ServerConfig",
296
+ "ProtocolConfig",
297
+ "OpenAIProtocolConfig",
298
+ "AGUIProtocolConfig",
299
+ "AgentRequest",
300
+ "AgentEvent",
301
+ "AgentResult",
302
+ "Message",
303
+ "MessageRole",
304
+ "Tool",
305
+ "ToolCall",
306
+ "EventType",
307
+ "AgentEventItem",
308
+ "AgentResultItem",
309
+ "AgentReturnType",
310
+ "SyncAgentEventGenerator",
311
+ "SyncAgentResultGenerator",
312
+ "AsyncAgentEventGenerator",
313
+ "AsyncAgentResultGenerator",
314
+ "InvokeAgentHandler",
315
+ "AsyncInvokeAgentHandler",
316
+ "SyncInvokeAgentHandler",
317
+ "ProtocolHandler",
318
+ "BaseProtocolHandler",
319
+ "OpenAIProtocolHandler",
320
+ "AGUIProtocolHandler",
321
+ "AguiEventNormalizer",
322
+ "MergeOptions",
323
+ }
324
+
325
+ # 可选依赖包映射:安装命令 -> 导入错误的包名列表
326
+ # Optional dependency mapping: installation command -> list of import error package names
327
+ # 将使用相同安装命令的包合并到一起 / Group packages with the same installation command
328
+ _OPTIONAL_PACKAGES = {
329
+ "agentrun-sdk[server]": ["fastapi", "uvicorn", "ag_ui"],
330
+ }
331
+
332
+
333
+ def __getattr__(name: str):
334
+ """延迟加载 server 模块的导出,避免可选依赖导致导入失败
335
+
336
+ 当用户访问 server 相关的类时,才尝试导入 server 模块。
337
+ 如果 server 可选依赖未安装,会抛出清晰的错误提示。
338
+ """
339
+ if name in _SERVER_EXPORTS:
340
+ try:
341
+ from agentrun import server
342
+
343
+ return getattr(server, name)
344
+ except ImportError as e:
345
+ # 检查是否是缺少可选依赖导致的错误
346
+ error_str = str(e)
347
+ for install_cmd, package_names in _OPTIONAL_PACKAGES.items():
348
+ for package_name in package_names:
349
+ if package_name in error_str:
350
+ raise ImportError(
351
+ f"'{name}' requires the 'server' optional"
352
+ " dependencies. Install with: pip install"
353
+ f" {install_cmd}\nOriginal error: {e}"
354
+ ) from e
355
+ # 其他导入错误继续抛出
356
+ raise
357
+
358
+ raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
@@ -18,6 +18,7 @@ from agentrun.agent_runtime.model import (
18
18
  AgentRuntimeEndpointUpdateInput,
19
19
  )
20
20
  from agentrun.utils.config import Config
21
+ from agentrun.utils.model import PageableInput
21
22
  from agentrun.utils.resource import ResourceBase
22
23
 
23
24
 
@@ -160,6 +161,45 @@ class AgentRuntimeEndpoint(
160
161
  config=config,
161
162
  )
162
163
 
164
+ @classmethod
165
+ async def _list_page_async(
166
+ cls,
167
+ page_input: PageableInput,
168
+ config: Optional[Config] = None,
169
+ **kwargs,
170
+ ) -> List["AgentRuntimeEndpoint"]:
171
+ """分页列出端点 / List endpoints by page
172
+
173
+ 此方法是 ResourceBase 要求实现的抽象方法,用于支持分页查询。
174
+ This method is an abstract method required by ResourceBase to support pagination.
175
+
176
+ Args:
177
+ page_input: 分页参数 / Pagination parameters
178
+ config: 配置对象,可选 / Configuration object, optional
179
+ **kwargs: 其他参数,必须包含 agent_runtime_id / Other parameters, must include agent_runtime_id
180
+
181
+ Returns:
182
+ List[AgentRuntimeEndpoint]: 端点对象列表 / List of endpoint objects
183
+
184
+ Raises:
185
+ ValueError: 当 agent_runtime_id 未提供时 / When agent_runtime_id is not provided
186
+ HTTPError: HTTP 请求错误 / HTTP request error
187
+ """
188
+ agent_runtime_id = kwargs.get("agent_runtime_id")
189
+ if not agent_runtime_id:
190
+ raise ValueError(
191
+ "agent_runtime_id is required for listing endpoints"
192
+ )
193
+
194
+ return await cls.__get_client().list_endpoints_async(
195
+ agent_runtime_id,
196
+ AgentRuntimeEndpointListInput(
197
+ page_number=page_input.page_number,
198
+ page_size=page_input.page_size,
199
+ ),
200
+ config=config,
201
+ )
202
+
163
203
  @classmethod
164
204
  async def list_by_id_async(
165
205
  cls, agent_runtime_id: str, config: Optional[Config] = None
@@ -35,7 +35,7 @@ from alibabacloud_agentrun20250910.models import (
35
35
  )
36
36
  from alibabacloud_tea_openapi.exceptions._client import ClientException
37
37
  from alibabacloud_tea_openapi.exceptions._server import ServerException
38
- from alibabacloud_tea_util.models import RuntimeOptions
38
+ from darabonba.runtime import RuntimeOptions
39
39
  import pydash
40
40
 
41
41
  from agentrun.utils.config import Config
@@ -28,6 +28,7 @@ from agentrun.agent_runtime.model import (
28
28
  AgentRuntimeEndpointUpdateInput,
29
29
  )
30
30
  from agentrun.utils.config import Config
31
+ from agentrun.utils.model import PageableInput
31
32
  from agentrun.utils.resource import ResourceBase
32
33
 
33
34
 
@@ -286,6 +287,84 @@ class AgentRuntimeEndpoint(
286
287
  config=config,
287
288
  )
288
289
 
290
+ @classmethod
291
+ async def _list_page_async(
292
+ cls,
293
+ page_input: PageableInput,
294
+ config: Optional[Config] = None,
295
+ **kwargs,
296
+ ) -> List["AgentRuntimeEndpoint"]:
297
+ """分页列出端点 / List endpoints by page
298
+
299
+ 此方法是 ResourceBase 要求实现的抽象方法,用于支持分页查询。
300
+ This method is an abstract method required by ResourceBase to support pagination.
301
+
302
+ Args:
303
+ page_input: 分页参数 / Pagination parameters
304
+ config: 配置对象,可选 / Configuration object, optional
305
+ **kwargs: 其他参数,必须包含 agent_runtime_id / Other parameters, must include agent_runtime_id
306
+
307
+ Returns:
308
+ List[AgentRuntimeEndpoint]: 端点对象列表 / List of endpoint objects
309
+
310
+ Raises:
311
+ ValueError: 当 agent_runtime_id 未提供时 / When agent_runtime_id is not provided
312
+ HTTPError: HTTP 请求错误 / HTTP request error
313
+ """
314
+ agent_runtime_id = kwargs.get("agent_runtime_id")
315
+ if not agent_runtime_id:
316
+ raise ValueError(
317
+ "agent_runtime_id is required for listing endpoints"
318
+ )
319
+
320
+ return await cls.__get_client().list_endpoints_async(
321
+ agent_runtime_id,
322
+ AgentRuntimeEndpointListInput(
323
+ page_number=page_input.page_number,
324
+ page_size=page_input.page_size,
325
+ ),
326
+ config=config,
327
+ )
328
+
329
+ @classmethod
330
+ def _list_page(
331
+ cls,
332
+ page_input: PageableInput,
333
+ config: Optional[Config] = None,
334
+ **kwargs,
335
+ ) -> List["AgentRuntimeEndpoint"]:
336
+ """分页列出端点 / List endpoints by page
337
+
338
+ 此方法是 ResourceBase 要求实现的抽象方法,用于支持分页查询。
339
+ This method is an abstract method required by ResourceBase to support pagination.
340
+
341
+ Args:
342
+ page_input: 分页参数 / Pagination parameters
343
+ config: 配置对象,可选 / Configuration object, optional
344
+ **kwargs: 其他参数,必须包含 agent_runtime_id / Other parameters, must include agent_runtime_id
345
+
346
+ Returns:
347
+ List[AgentRuntimeEndpoint]: 端点对象列表 / List of endpoint objects
348
+
349
+ Raises:
350
+ ValueError: 当 agent_runtime_id 未提供时 / When agent_runtime_id is not provided
351
+ HTTPError: HTTP 请求错误 / HTTP request error
352
+ """
353
+ agent_runtime_id = kwargs.get("agent_runtime_id")
354
+ if not agent_runtime_id:
355
+ raise ValueError(
356
+ "agent_runtime_id is required for listing endpoints"
357
+ )
358
+
359
+ return cls.__get_client().list_endpoints(
360
+ agent_runtime_id,
361
+ AgentRuntimeEndpointListInput(
362
+ page_number=page_input.page_number,
363
+ page_size=page_input.page_size,
364
+ ),
365
+ config=config,
366
+ )
367
+
289
368
  @classmethod
290
369
  async def list_by_id_async(
291
370
  cls, agent_runtime_id: str, config: Optional[Config] = None
@@ -25,7 +25,7 @@ from alibabacloud_agentrun20250910.models import (
25
25
  )
26
26
  from alibabacloud_tea_openapi.exceptions._client import ClientException
27
27
  from alibabacloud_tea_openapi.exceptions._server import ServerException
28
- from alibabacloud_tea_util.models import RuntimeOptions
28
+ from darabonba.runtime import RuntimeOptions
29
29
  import pydash
30
30
 
31
31
  from agentrun.utils.config import Config
@@ -134,7 +134,7 @@ class CredentialConfig(CredentialConfigInner):
134
134
  cls,
135
135
  provider: str,
136
136
  access_key_id: str,
137
- access_key_secred: str,
137
+ access_key_secret: str,
138
138
  account_id: str,
139
139
  ):
140
140
  """配置访问第三方工具的 ak/sk 凭证"""
@@ -148,7 +148,7 @@ class CredentialConfig(CredentialConfigInner):
148
148
  "accountId": account_id,
149
149
  },
150
150
  },
151
- credential_secret=access_key_secred,
151
+ credential_secret=access_key_secret,
152
152
  )
153
153
 
154
154
  @classmethod
@@ -3,10 +3,11 @@
3
3
  提供 AgentRun 模型与沙箱工具的 AgentScope 适配入口。 / 提供 AgentRun 模型with沙箱工具的 AgentScope 适配入口。
4
4
  """
5
5
 
6
- from .builtin import model, sandbox_toolset, toolset
6
+ from .builtin import knowledgebase_toolset, model, sandbox_toolset, toolset
7
7
 
8
8
  __all__ = [
9
9
  "model",
10
10
  "toolset",
11
11
  "sandbox_toolset",
12
+ "knowledgebase_toolset",
12
13
  ]
@@ -8,6 +8,9 @@ from typing import Any, Callable, List, Optional, Union
8
8
 
9
9
  from typing_extensions import Unpack
10
10
 
11
+ from agentrun.integration.builtin import (
12
+ knowledgebase_toolset as _knowledgebase_toolset,
13
+ )
11
14
  from agentrun.integration.builtin import model as _model
12
15
  from agentrun.integration.builtin import ModelArgs
13
16
  from agentrun.integration.builtin import sandbox_toolset as _sandbox_toolset
@@ -63,3 +66,23 @@ def sandbox_toolset(
63
66
  config=config,
64
67
  sandbox_idle_timeout_seconds=sandbox_idle_timeout_seconds,
65
68
  ).to_agentscope(prefix=prefix)
69
+
70
+
71
+ def knowledgebase_toolset(
72
+ knowledge_base_names: List[str],
73
+ *,
74
+ prefix: Optional[str] = None,
75
+ modify_tool_name: Optional[Callable[[Tool], Tool]] = None,
76
+ filter_tools_by_name: Optional[Callable[[str], bool]] = None,
77
+ config: Optional[Config] = None,
78
+ ) -> List[Any]:
79
+ """将知识库检索封装为 AgentScope 工具列表。 / AgentScope Built-in Integration Functions"""
80
+
81
+ return _knowledgebase_toolset(
82
+ knowledge_base_names=knowledge_base_names,
83
+ config=config,
84
+ ).to_agentscope(
85
+ prefix=prefix,
86
+ modify_tool_name=modify_tool_name,
87
+ filter_tools_by_name=filter_tools_by_name,
88
+ )
@@ -51,7 +51,7 @@ class AgentScopeModelAdapter(ModelAdapter):
51
51
  return OpenAIChatModel(
52
52
  model_name=info.model or "",
53
53
  api_key=info.api_key,
54
- stream=False,
54
+ stream=True,
55
55
  client_args={
56
56
  "base_url": info.base_url,
57
57
  "http_client": AsyncClient(headers=info.headers),
@@ -4,6 +4,7 @@
4
4
  This module provides built-in integration functions for quickly creating models and tools.
5
5
  """
6
6
 
7
+ from .knowledgebase import knowledgebase_toolset
7
8
  from .model import model, ModelArgs
8
9
  from .sandbox import sandbox_toolset
9
10
  from .toolset import toolset
@@ -13,4 +14,5 @@ __all__ = [
13
14
  "ModelArgs",
14
15
  "toolset",
15
16
  "sandbox_toolset",
17
+ "knowledgebase_toolset",
16
18
  ]
@@ -0,0 +1,137 @@
1
+ """知识库工具集 / KnowledgeBase ToolSet
2
+
3
+ 提供知识库检索功能的工具集,支持多知识库联合检索。
4
+ Provides toolset for knowledge base retrieval, supporting multi-knowledge-base search.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from typing import Any, Dict, List, Optional
10
+
11
+ from agentrun.integration.utils.tool import CommonToolSet, tool
12
+ from agentrun.knowledgebase import KnowledgeBase
13
+ from agentrun.utils.config import Config
14
+
15
+
16
+ class KnowledgeBaseToolSet(CommonToolSet):
17
+ """知识库工具集 / KnowledgeBase ToolSet
18
+
19
+ 提供知识库检索功能,支持对多个知识库进行联合检索。
20
+ Provides knowledge base retrieval capabilities, supporting joint retrieval
21
+ across multiple knowledge bases.
22
+
23
+ 使用指南 / Usage Guide:
24
+ ============================================================
25
+
26
+ ## 基本用法 / Basic Usage
27
+
28
+ 1. **创建工具集 / Create ToolSet**:
29
+ - 使用 `knowledgebase_toolset` 函数创建工具集实例
30
+ - Use `knowledgebase_toolset` function to create a toolset instance
31
+ - 指定要检索的知识库名称列表
32
+ - Specify the list of knowledge base names to search
33
+
34
+ 2. **执行检索 / Execute Search**:
35
+ - 调用 `search_document` 工具进行检索
36
+ - Call `search_document` tool to perform retrieval
37
+ - 返回所有指定知识库的检索结果
38
+ - Returns retrieval results from all specified knowledge bases
39
+
40
+ ## 示例 / Examples
41
+
42
+ ```python
43
+ from agentrun.integration.langchain import knowledgebase_toolset
44
+
45
+ # 创建工具集 / Create toolset
46
+ tools = knowledgebase_toolset(
47
+ knowledge_base_names=["kb-product-docs", "kb-faq"],
48
+ )
49
+
50
+ # 在 Agent 中使用 / Use in Agent
51
+ agent = create_react_agent(llm, tools)
52
+ ```
53
+ """
54
+
55
+ def __init__(
56
+ self,
57
+ knowledge_base_names: List[str],
58
+ config: Optional[Config] = None,
59
+ ) -> None:
60
+ """初始化知识库工具集 / Initialize KnowledgeBase ToolSet
61
+
62
+ Args:
63
+ knowledge_base_names: 知识库名称列表 / List of knowledge base names
64
+ config: 配置 / Configuration
65
+ """
66
+ super().__init__()
67
+
68
+ self.knowledge_base_names = knowledge_base_names
69
+ self.config = config
70
+
71
+ @tool(
72
+ name="search_document",
73
+ description=(
74
+ "Search and retrieve relevant documents from configured knowledge"
75
+ " bases. Use this tool when you need to find information from the"
76
+ " knowledge base to answer user questions. Returns relevant"
77
+ " document chunks with their content and metadata. The search is"
78
+ " performed across all configured knowledge bases and results are"
79
+ " grouped by knowledge base name."
80
+ ),
81
+ )
82
+ def search_document(self, query: str) -> Dict[str, Any]:
83
+ """检索文档 / Search documents
84
+
85
+ 根据查询文本从配置的知识库中检索相关文档。
86
+ Retrieves relevant documents from configured knowledge bases based on query text.
87
+
88
+ Args:
89
+ query: 查询文本 / Query text
90
+
91
+ Returns:
92
+ Dict[str, Any]: 检索结果,包含各知识库的检索结果 /
93
+ Retrieval results containing results from each knowledge base
94
+ """
95
+ return KnowledgeBase.multi_retrieve(
96
+ query=query,
97
+ knowledge_base_names=self.knowledge_base_names,
98
+ config=self.config,
99
+ )
100
+
101
+
102
+ def knowledgebase_toolset(
103
+ knowledge_base_names: List[str],
104
+ *,
105
+ config: Optional[Config] = None,
106
+ ) -> KnowledgeBaseToolSet:
107
+ """创建知识库工具集 / Create KnowledgeBase ToolSet
108
+
109
+ 将知识库检索功能封装为通用工具集,可转换为各框架支持的格式。
110
+ Wraps knowledge base retrieval functionality into a common toolset that can be
111
+ converted to formats supported by various frameworks.
112
+
113
+ Args:
114
+ knowledge_base_names: 知识库名称列表 / List of knowledge base names
115
+ config: 配置 / Configuration
116
+
117
+ Returns:
118
+ KnowledgeBaseToolSet: 知识库工具集实例 / KnowledgeBase toolset instance
119
+
120
+ Example:
121
+ >>> from agentrun.integration.builtin import knowledgebase_toolset
122
+ >>>
123
+ >>> # 创建工具集 / Create toolset
124
+ >>> kb_tools = knowledgebase_toolset(
125
+ ... knowledge_base_names=["kb-docs", "kb-faq"],
126
+ ... )
127
+ >>>
128
+ >>> # 转换为 LangChain 格式 / Convert to LangChain format
129
+ >>> langchain_tools = kb_tools.to_langchain()
130
+ >>>
131
+ >>> # 转换为 Google ADK 格式 / Convert to Google ADK format
132
+ >>> adk_tools = kb_tools.to_google_adk()
133
+ """
134
+ return KnowledgeBaseToolSet(
135
+ knowledge_base_names=knowledge_base_names,
136
+ config=config,
137
+ )