agentscope-runtime 1.0.0b1__tar.gz → 1.0.1__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 (252) hide show
  1. {agentscope_runtime-1.0.0b1/src/agentscope_runtime.egg-info → agentscope_runtime-1.0.1}/PKG-INFO +60 -6
  2. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/README.md +58 -4
  3. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/pyproject.toml +3 -3
  4. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/adapters/agentscope/message.py +49 -6
  5. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/adapters/agentscope/stream.py +81 -25
  6. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/adapters/agentscope/tool/tool.py +1 -3
  7. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/app/agent_app.py +8 -1
  8. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/agentrun_deployer.py +2 -2
  9. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/utils/service_utils/fastapi_factory.py +52 -7
  10. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/runner.py +7 -6
  11. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/schemas/agent_schemas.py +21 -7
  12. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/agent_state/__init__.py +2 -0
  13. agentscope_runtime-1.0.1/src/agentscope_runtime/engine/services/agent_state/state_service_factory.py +55 -0
  14. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/memory/__init__.py +2 -0
  15. agentscope_runtime-1.0.1/src/agentscope_runtime/engine/services/memory/memory_service_factory.py +126 -0
  16. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/sandbox/__init__.py +2 -0
  17. agentscope_runtime-1.0.1/src/agentscope_runtime/engine/services/sandbox/sandbox_service_factory.py +49 -0
  18. agentscope_runtime-1.0.1/src/agentscope_runtime/engine/services/service_factory.py +119 -0
  19. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/session_history/__init__.py +2 -0
  20. agentscope_runtime-1.0.1/src/agentscope_runtime/engine/services/session_history/session_history_service_factory.py +73 -0
  21. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/utils/tablestore_service_utils.py +35 -10
  22. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/tracing/wrapper.py +49 -31
  23. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/manager/sandbox_manager.py +0 -3
  24. agentscope_runtime-1.0.1/src/agentscope_runtime/version.py +2 -0
  25. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1/src/agentscope_runtime.egg-info}/PKG-INFO +60 -6
  26. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime.egg-info/SOURCES.txt +5 -0
  27. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime.egg-info/requires.txt +1 -1
  28. agentscope_runtime-1.0.0b1/src/agentscope_runtime/version.py +0 -2
  29. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/LICENSE +0 -0
  30. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/setup.cfg +0 -0
  31. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/setup.py +0 -0
  32. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/__init__.py +0 -0
  33. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/adapters/__init__.py +0 -0
  34. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/adapters/agentscope/__init__.py +0 -0
  35. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/adapters/agentscope/long_term_memory/__init__.py +0 -0
  36. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/adapters/agentscope/long_term_memory/_long_term_memory_adapter.py +0 -0
  37. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/adapters/agentscope/memory/__init__.py +0 -0
  38. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/adapters/agentscope/memory/_memory_adapter.py +0 -0
  39. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/adapters/agentscope/tool/__init__.py +0 -0
  40. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/adapters/agentscope/tool/sandbox_tool.py +0 -0
  41. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/adapters/autogen/__init__.py +0 -0
  42. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/adapters/autogen/tool/__init__.py +0 -0
  43. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/adapters/autogen/tool/tool.py +0 -0
  44. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/adapters/text/__init__.py +0 -0
  45. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/adapters/text/stream.py +0 -0
  46. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/__init__.py +0 -0
  47. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/collections/__init__.py +0 -0
  48. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/collections/base_mapping.py +0 -0
  49. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/collections/base_queue.py +0 -0
  50. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/collections/base_set.py +0 -0
  51. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/collections/in_memory_mapping.py +0 -0
  52. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/collections/in_memory_queue.py +0 -0
  53. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/collections/in_memory_set.py +0 -0
  54. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/collections/redis_mapping.py +0 -0
  55. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/collections/redis_queue.py +0 -0
  56. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/collections/redis_set.py +0 -0
  57. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/container_clients/__init__.py +0 -0
  58. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/container_clients/agentrun_client.py +0 -0
  59. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/container_clients/base_client.py +0 -0
  60. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/container_clients/docker_client.py +0 -0
  61. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/container_clients/fc_client.py +0 -0
  62. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/container_clients/kubernetes_client.py +0 -0
  63. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/utils/__init__.py +0 -0
  64. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/common/utils/lazy_loader.py +0 -0
  65. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/__init__.py +0 -0
  66. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/app/__init__.py +0 -0
  67. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/app/base_app.py +0 -0
  68. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/app/celery_mixin.py +0 -0
  69. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/constant.py +0 -0
  70. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/__init__.py +0 -0
  71. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/adapter/__init__.py +0 -0
  72. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/adapter/a2a/__init__.py +0 -0
  73. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/adapter/a2a/a2a_adapter_utils.py +0 -0
  74. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/adapter/a2a/a2a_agent_adapter.py +0 -0
  75. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/adapter/a2a/a2a_protocol_adapter.py +0 -0
  76. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/adapter/protocol_adapter.py +0 -0
  77. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/adapter/responses/__init__.py +0 -0
  78. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/adapter/responses/response_api_adapter_utils.py +0 -0
  79. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/adapter/responses/response_api_agent_adapter.py +0 -0
  80. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/adapter/responses/response_api_protocol_adapter.py +0 -0
  81. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/base.py +0 -0
  82. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/cli_fc_deploy.py +0 -0
  83. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/kubernetes_deployer.py +0 -0
  84. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/local_deployer.py +0 -0
  85. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/modelstudio_deployer.py +0 -0
  86. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/utils/__init__.py +0 -0
  87. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/utils/app_runner_utils.py +0 -0
  88. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/utils/deployment_modes.py +0 -0
  89. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/utils/detached_app.py +0 -0
  90. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/utils/docker_image_utils/__init__.py +0 -0
  91. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/utils/docker_image_utils/docker_image_builder.py +0 -0
  92. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/utils/docker_image_utils/dockerfile_generator.py +0 -0
  93. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/utils/docker_image_utils/image_factory.py +0 -0
  94. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/utils/package.py +0 -0
  95. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/utils/service_utils/__init__.py +0 -0
  96. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/utils/service_utils/fastapi_templates.py +0 -0
  97. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/utils/service_utils/process_manager.py +0 -0
  98. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/utils/templates/app_main.py.j2 +0 -0
  99. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/utils/templates/runner_main.py.j2 +0 -0
  100. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/utils/templates/standalone_main.py.j2 +0 -0
  101. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/deployers/utils/wheel_packager.py +0 -0
  102. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/helpers/agent_api_builder.py +0 -0
  103. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/helpers/runner.py +0 -0
  104. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/misc/__init__.py +0 -0
  105. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/schemas/__init__.py +0 -0
  106. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/schemas/embedding.py +0 -0
  107. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/schemas/modelstudio_llm.py +0 -0
  108. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/schemas/oai_llm.py +0 -0
  109. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/schemas/realtime.py +0 -0
  110. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/schemas/response_api.py +0 -0
  111. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/schemas/session.py +0 -0
  112. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/__init__.py +0 -0
  113. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/agent_state/redis_state_service.py +0 -0
  114. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/agent_state/state_service.py +0 -0
  115. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/base.py +0 -0
  116. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/memory/mem0_memory_service.py +0 -0
  117. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/memory/memory_service.py +0 -0
  118. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/memory/redis_memory_service.py +0 -0
  119. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/memory/reme_personal_memory_service.py +0 -0
  120. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/memory/reme_task_memory_service.py +0 -0
  121. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/memory/tablestore_memory_service.py +0 -0
  122. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/sandbox/sandbox_service.py +0 -0
  123. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/session_history/redis_session_history_service.py +0 -0
  124. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/session_history/session_history_service.py +0 -0
  125. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/session_history/tablestore_session_history_service.py +0 -0
  126. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/services/utils/__init__.py +0 -0
  127. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/tracing/__init__.py +0 -0
  128. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/tracing/asyncio_util.py +0 -0
  129. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/tracing/base.py +0 -0
  130. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/tracing/local_logging_handler.py +0 -0
  131. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/tracing/message_util.py +0 -0
  132. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/tracing/tracing_metric.py +0 -0
  133. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/engine/tracing/tracing_util.py +0 -0
  134. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/__init__.py +0 -0
  135. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/__init__.py +0 -0
  136. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/agentbay/__init__.py +0 -0
  137. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/agentbay/agentbay_sandbox.py +0 -0
  138. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/base/__init__.py +0 -0
  139. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/base/base_sandbox.py +0 -0
  140. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/base/box/__init__.py +0 -0
  141. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/browser/__init__.py +0 -0
  142. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/browser/box/__init__.py +0 -0
  143. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/browser/browser_sandbox.py +0 -0
  144. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/cloud/__init__.py +0 -0
  145. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/cloud/cloud_sandbox.py +0 -0
  146. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/dummy/__init__.py +0 -0
  147. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/dummy/dummy_sandbox.py +0 -0
  148. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/filesystem/__init__.py +0 -0
  149. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/filesystem/box/__init__.py +0 -0
  150. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/filesystem/filesystem_sandbox.py +0 -0
  151. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/gui/__init__.py +0 -0
  152. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/gui/box/__init__.py +0 -0
  153. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/gui/gui_sandbox.py +0 -0
  154. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/mobile/__init__.py +0 -0
  155. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/mobile/box/__init__.py +0 -0
  156. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/mobile/mobile_sandbox.py +0 -0
  157. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/sandbox.py +0 -0
  158. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/shared/__init__.py +0 -0
  159. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/shared/app.py +0 -0
  160. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/shared/dependencies/__init__.py +0 -0
  161. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/shared/dependencies/deps.py +0 -0
  162. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/shared/routers/__init__.py +0 -0
  163. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/shared/routers/generic.py +0 -0
  164. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/shared/routers/mcp.py +0 -0
  165. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/shared/routers/mcp_utils.py +0 -0
  166. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/shared/routers/runtime_watcher.py +0 -0
  167. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/shared/routers/workspace.py +0 -0
  168. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/training_box/__init__.py +0 -0
  169. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/training_box/base.py +0 -0
  170. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/training_box/env_service.py +0 -0
  171. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/training_box/environments/__init__.py +0 -0
  172. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/training_box/environments/appworld/appworld_env.py +0 -0
  173. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/training_box/environments/bfcl/bfcl_dataprocess.py +0 -0
  174. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/training_box/environments/bfcl/bfcl_env.py +0 -0
  175. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/training_box/environments/bfcl/env_handler.py +0 -0
  176. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/training_box/registry.py +0 -0
  177. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/training_box/src/trajectory.py +0 -0
  178. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/box/training_box/training_box.py +0 -0
  179. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/build.py +0 -0
  180. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/client/__init__.py +0 -0
  181. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/client/http_client.py +0 -0
  182. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/client/training_client.py +0 -0
  183. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/constant.py +0 -0
  184. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/custom/__init__.py +0 -0
  185. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/custom/custom_sandbox.py +0 -0
  186. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/custom/example.py +0 -0
  187. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/enums.py +0 -0
  188. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/manager/__init__.py +0 -0
  189. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/manager/server/__init__.py +0 -0
  190. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/manager/server/app.py +0 -0
  191. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/manager/server/config.py +0 -0
  192. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/manager/server/models.py +0 -0
  193. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/manager/storage/__init__.py +0 -0
  194. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/manager/storage/data_storage.py +0 -0
  195. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/manager/storage/local_storage.py +0 -0
  196. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/manager/storage/oss_storage.py +0 -0
  197. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/mcp_server.py +0 -0
  198. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/model/__init__.py +0 -0
  199. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/model/api.py +0 -0
  200. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/model/container.py +0 -0
  201. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/model/manager_config.py +0 -0
  202. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/registry.py +0 -0
  203. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/sandbox/utils.py +0 -0
  204. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/RAGs/__init__.py +0 -0
  205. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/RAGs/modelstudio_rag.py +0 -0
  206. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/RAGs/modelstudio_rag_lite.py +0 -0
  207. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/__init__.py +0 -0
  208. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/_constants.py +0 -0
  209. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/alipay/__init__.py +0 -0
  210. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/alipay/base.py +0 -0
  211. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/alipay/payment.py +0 -0
  212. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/alipay/subscribe.py +0 -0
  213. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/base.py +0 -0
  214. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/cli/__init__.py +0 -0
  215. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/cli/modelstudio_mcp_server.py +0 -0
  216. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/__init__.py +0 -0
  217. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/async_image_to_video.py +0 -0
  218. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/async_image_to_video_wan25.py +0 -0
  219. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/async_speech_to_video.py +0 -0
  220. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/async_text_to_video.py +0 -0
  221. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/async_text_to_video_wan25.py +0 -0
  222. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/image_edit.py +0 -0
  223. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/image_edit_wan25.py +0 -0
  224. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/image_generation.py +0 -0
  225. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/image_generation_wan25.py +0 -0
  226. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/image_style_repaint.py +0 -0
  227. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/image_to_video.py +0 -0
  228. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/qwen_image_edit.py +0 -0
  229. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/qwen_image_generation.py +0 -0
  230. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/qwen_text_to_speech.py +0 -0
  231. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/speech_to_text.py +0 -0
  232. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/speech_to_video.py +0 -0
  233. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/generations/text_to_video.py +0 -0
  234. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/mcp_wrapper.py +0 -0
  235. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/realtime_clients/__init__.py +0 -0
  236. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/realtime_clients/asr_client.py +0 -0
  237. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/realtime_clients/azure_asr_client.py +0 -0
  238. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/realtime_clients/azure_tts_client.py +0 -0
  239. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/realtime_clients/modelstudio_asr_client.py +0 -0
  240. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/realtime_clients/modelstudio_tts_client.py +0 -0
  241. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/realtime_clients/realtime_tool.py +0 -0
  242. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/realtime_clients/tts_client.py +0 -0
  243. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/searches/__init__.py +0 -0
  244. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/searches/modelstudio_search.py +0 -0
  245. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/searches/modelstudio_search_lite.py +0 -0
  246. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/utils/__init__.py +0 -0
  247. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/utils/api_key_util.py +0 -0
  248. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/utils/crypto_utils.py +0 -0
  249. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime/tools/utils/mcp_util.py +0 -0
  250. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime.egg-info/dependency_links.txt +0 -0
  251. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime.egg-info/entry_points.txt +0 -0
  252. {agentscope_runtime-1.0.0b1 → agentscope_runtime-1.0.1}/src/agentscope_runtime.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentscope-runtime
3
- Version: 1.0.0b1
3
+ Version: 1.0.1
4
4
  Summary: A production-ready runtime framework for agent applications, providing secure sandboxed execution environments and scalable deployment solutions with multi-framework support.
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -11,7 +11,7 @@ Requires-Dist: uvicorn[standard]>=0.24.0
11
11
  Requires-Dist: openai
12
12
  Requires-Dist: pydantic>=2.11.7
13
13
  Requires-Dist: requests>=2.32.4
14
- Requires-Dist: agentscope>=1.0.6
14
+ Requires-Dist: agentscope>=1.0.9
15
15
  Requires-Dist: docker>=7.1.0
16
16
  Requires-Dist: redis>=6.0.0
17
17
  Requires-Dist: oss2>=2.19.1
@@ -301,9 +301,11 @@ You’ll see output streamed in **Server-Sent Events (SSE)** format:
301
301
  ```bash
302
302
  data: {"sequence_number":0,"object":"response","status":"created", ... }
303
303
  data: {"sequence_number":1,"object":"response","status":"in_progress", ... }
304
- data: {"sequence_number":2,"object":"content","status":"in_progress","text":"The" }
305
- data: {"sequence_number":3,"object":"content","status":"in_progress","text":" capital of France is Paris." }
306
- data: {"sequence_number":4,"object":"message","status":"completed","text":"The capital of France is Paris." }
304
+ data: {"sequence_number":2,"object":"message","status":"in_progress", ... }
305
+ data: {"sequence_number":3,"object":"content","status":"in_progress","text":"The" }
306
+ data: {"sequence_number":4,"object":"content","status":"in_progress","text":" capital of France is Paris." }
307
+ data: {"sequence_number":5,"object":"message","status":"completed","text":"The capital of France is Paris." }
308
+ data: {"sequence_number":6,"object":"response","status":"completed", ... }
307
309
  ```
308
310
 
309
311
  ### Sandbox Example
@@ -484,6 +486,22 @@ agentscope-registry.ap-southeast-1.cr.aliyuncs.com/agentscope/runtime-sandbox-ba
484
486
 
485
487
  ---
486
488
 
489
+ #### Serverless Sandbox Deployment
490
+
491
+ AgentScope Runtime also supports serverless deployment, which is suitable for running sandboxes in a serverless environment,
492
+ [Alibaba Cloud Function Compute (FC)](https://help.aliyun.com/zh/functioncompute/fc/) or [Alibaba Cloud AgentRun](https://docs.agent.run/).
493
+
494
+ First, please refer to the [documentation](https://runtime.agentscope.io/en/sandbox/advanced.html#optional-function-compute-fc-settings) to configure the serverless environment variables.
495
+ Make `CONTAINER_DEPLOYMENT` to `fc` or `agentrun` to enable serverless deployment.
496
+
497
+ Then, start a sandbox server, use the `--config` option to specify a serverless environment setup:
498
+
499
+ ```bash
500
+ # This command will load the settings defined in the `custom.env` file
501
+ runtime-sandbox-server --config fc.env
502
+ ```
503
+ After the server starts, you can access the sandbox server at baseurl `http://localhost:8000` and invoke sandbox tools described above.
504
+
487
505
  ## 📚 Cookbook
488
506
 
489
507
  - **[📖 Cookbook](https://runtime.agentscope.io/en/intro.html)**: Comprehensive tutorials
@@ -534,6 +552,40 @@ response = client.responses.create(
534
552
  print(response)
535
553
  ```
536
554
 
555
+ Besides, `DeployManager` also supports serverless deployments, such as deploying your agent app
556
+ to [ModelStudio](https://bailian.console.aliyun.com/?admin=1&tab=doc#/doc/?type=app&url=2983030)
557
+ or [AgentRun](https://docs.agent.run/).
558
+
559
+ ```python
560
+ from agentscope_runtime.engine.deployers import ModelStudioDeployManager
561
+ # Create deployment manager
562
+ deployer = ModelstudioDeployManager(
563
+ oss_config=OSSConfig(
564
+ access_key_id=os.environ.get("ALIBABA_CLOUD_ACCESS_KEY_ID"),
565
+ access_key_secret=os.environ.get("ALIBABA_CLOUD_ACCESS_KEY_SECRET"),
566
+ ),
567
+ modelstudio_config=ModelstudioConfig(
568
+ workspace_id=os.environ.get("MODELSTUDIO_WORKSPACE_ID"),
569
+ access_key_id=os.environ.get("ALIBABA_CLOUD_ACCESS_KEY_ID"),
570
+ access_key_secret=os.environ.get("ALIBABA_CLOUD_ACCESS_KEY_SECRET"),
571
+ dashscope_api_key=os.environ.get("DASHSCOPE_API_KEY"),
572
+ ),
573
+ )
574
+
575
+ # Deploy to ModelStudio
576
+ result = await app.deploy(
577
+ deployer,
578
+ deploy_name="agent-app-example",
579
+ telemetry_enabled=True,
580
+ requirements=["agentscope", "fastapi", "uvicorn"],
581
+ environment={
582
+ "PYTHONPATH": "/app",
583
+ "DASHSCOPE_API_KEY": os.environ.get("DASHSCOPE_API_KEY"),
584
+ },
585
+ )
586
+ ```
587
+
588
+ For more advanced serverless deployment guides, please refer to the [documentation](https://runtime.agentscope.io/en/advanced_deployment.html#method-4-modelstudio-deployment).
537
589
 
538
590
  ---
539
591
 
@@ -584,7 +636,7 @@ limitations under the License.
584
636
 
585
637
  ## Contributors ✨
586
638
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
587
- [![All Contributors](https://img.shields.io/badge/all_contributors-23-orange.svg?style=flat-square)](#contributors-)
639
+ [![All Contributors](https://img.shields.io/badge/all_contributors-25-orange.svg?style=flat-square)](#contributors-)
588
640
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
589
641
 
590
642
  Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/emoji-key/)):
@@ -624,6 +676,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/e
624
676
  <tr>
625
677
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/iSample"><img src="https://avatars.githubusercontent.com/u/12894421?v=4?s=100" width="100px;" alt="iSample"/><br /><sub><b>iSample</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=iSample" title="Code">💻</a> <a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=iSample" title="Documentation">📖</a></td>
626
678
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/XiuShenAl"><img src="https://avatars.githubusercontent.com/u/242360128?v=4?s=100" width="100px;" alt="XiuShenAl"/><br /><sub><b>XiuShenAl</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=XiuShenAl" title="Code">💻</a> <a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=XiuShenAl" title="Documentation">📖</a></td>
679
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/k-farruh"><img src="https://avatars.githubusercontent.com/u/33511681?v=4?s=100" width="100px;" alt="Farruh Kushnazarov"/><br /><sub><b>Farruh Kushnazarov</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=k-farruh" title="Documentation">📖</a></td>
680
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/fengxsong"><img src="https://avatars.githubusercontent.com/u/7008971?v=4?s=100" width="100px;" alt="fengxsong"/><br /><sub><b>fengxsong</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/issues?q=author%3Afengxsong" title="Bug reports">🐛</a></td>
627
681
  </tr>
628
682
  </tbody>
629
683
  <tfoot>
@@ -236,9 +236,11 @@ You’ll see output streamed in **Server-Sent Events (SSE)** format:
236
236
  ```bash
237
237
  data: {"sequence_number":0,"object":"response","status":"created", ... }
238
238
  data: {"sequence_number":1,"object":"response","status":"in_progress", ... }
239
- data: {"sequence_number":2,"object":"content","status":"in_progress","text":"The" }
240
- data: {"sequence_number":3,"object":"content","status":"in_progress","text":" capital of France is Paris." }
241
- data: {"sequence_number":4,"object":"message","status":"completed","text":"The capital of France is Paris." }
239
+ data: {"sequence_number":2,"object":"message","status":"in_progress", ... }
240
+ data: {"sequence_number":3,"object":"content","status":"in_progress","text":"The" }
241
+ data: {"sequence_number":4,"object":"content","status":"in_progress","text":" capital of France is Paris." }
242
+ data: {"sequence_number":5,"object":"message","status":"completed","text":"The capital of France is Paris." }
243
+ data: {"sequence_number":6,"object":"response","status":"completed", ... }
242
244
  ```
243
245
 
244
246
  ### Sandbox Example
@@ -419,6 +421,22 @@ agentscope-registry.ap-southeast-1.cr.aliyuncs.com/agentscope/runtime-sandbox-ba
419
421
 
420
422
  ---
421
423
 
424
+ #### Serverless Sandbox Deployment
425
+
426
+ AgentScope Runtime also supports serverless deployment, which is suitable for running sandboxes in a serverless environment,
427
+ [Alibaba Cloud Function Compute (FC)](https://help.aliyun.com/zh/functioncompute/fc/) or [Alibaba Cloud AgentRun](https://docs.agent.run/).
428
+
429
+ First, please refer to the [documentation](https://runtime.agentscope.io/en/sandbox/advanced.html#optional-function-compute-fc-settings) to configure the serverless environment variables.
430
+ Make `CONTAINER_DEPLOYMENT` to `fc` or `agentrun` to enable serverless deployment.
431
+
432
+ Then, start a sandbox server, use the `--config` option to specify a serverless environment setup:
433
+
434
+ ```bash
435
+ # This command will load the settings defined in the `custom.env` file
436
+ runtime-sandbox-server --config fc.env
437
+ ```
438
+ After the server starts, you can access the sandbox server at baseurl `http://localhost:8000` and invoke sandbox tools described above.
439
+
422
440
  ## 📚 Cookbook
423
441
 
424
442
  - **[📖 Cookbook](https://runtime.agentscope.io/en/intro.html)**: Comprehensive tutorials
@@ -469,6 +487,40 @@ response = client.responses.create(
469
487
  print(response)
470
488
  ```
471
489
 
490
+ Besides, `DeployManager` also supports serverless deployments, such as deploying your agent app
491
+ to [ModelStudio](https://bailian.console.aliyun.com/?admin=1&tab=doc#/doc/?type=app&url=2983030)
492
+ or [AgentRun](https://docs.agent.run/).
493
+
494
+ ```python
495
+ from agentscope_runtime.engine.deployers import ModelStudioDeployManager
496
+ # Create deployment manager
497
+ deployer = ModelstudioDeployManager(
498
+ oss_config=OSSConfig(
499
+ access_key_id=os.environ.get("ALIBABA_CLOUD_ACCESS_KEY_ID"),
500
+ access_key_secret=os.environ.get("ALIBABA_CLOUD_ACCESS_KEY_SECRET"),
501
+ ),
502
+ modelstudio_config=ModelstudioConfig(
503
+ workspace_id=os.environ.get("MODELSTUDIO_WORKSPACE_ID"),
504
+ access_key_id=os.environ.get("ALIBABA_CLOUD_ACCESS_KEY_ID"),
505
+ access_key_secret=os.environ.get("ALIBABA_CLOUD_ACCESS_KEY_SECRET"),
506
+ dashscope_api_key=os.environ.get("DASHSCOPE_API_KEY"),
507
+ ),
508
+ )
509
+
510
+ # Deploy to ModelStudio
511
+ result = await app.deploy(
512
+ deployer,
513
+ deploy_name="agent-app-example",
514
+ telemetry_enabled=True,
515
+ requirements=["agentscope", "fastapi", "uvicorn"],
516
+ environment={
517
+ "PYTHONPATH": "/app",
518
+ "DASHSCOPE_API_KEY": os.environ.get("DASHSCOPE_API_KEY"),
519
+ },
520
+ )
521
+ ```
522
+
523
+ For more advanced serverless deployment guides, please refer to the [documentation](https://runtime.agentscope.io/en/advanced_deployment.html#method-4-modelstudio-deployment).
472
524
 
473
525
  ---
474
526
 
@@ -519,7 +571,7 @@ limitations under the License.
519
571
 
520
572
  ## Contributors ✨
521
573
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
522
- [![All Contributors](https://img.shields.io/badge/all_contributors-23-orange.svg?style=flat-square)](#contributors-)
574
+ [![All Contributors](https://img.shields.io/badge/all_contributors-25-orange.svg?style=flat-square)](#contributors-)
523
575
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
524
576
 
525
577
  Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/emoji-key/)):
@@ -559,6 +611,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/e
559
611
  <tr>
560
612
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/iSample"><img src="https://avatars.githubusercontent.com/u/12894421?v=4?s=100" width="100px;" alt="iSample"/><br /><sub><b>iSample</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=iSample" title="Code">💻</a> <a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=iSample" title="Documentation">📖</a></td>
561
613
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/XiuShenAl"><img src="https://avatars.githubusercontent.com/u/242360128?v=4?s=100" width="100px;" alt="XiuShenAl"/><br /><sub><b>XiuShenAl</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=XiuShenAl" title="Code">💻</a> <a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=XiuShenAl" title="Documentation">📖</a></td>
614
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/k-farruh"><img src="https://avatars.githubusercontent.com/u/33511681?v=4?s=100" width="100px;" alt="Farruh Kushnazarov"/><br /><sub><b>Farruh Kushnazarov</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=k-farruh" title="Documentation">📖</a></td>
615
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/fengxsong"><img src="https://avatars.githubusercontent.com/u/7008971?v=4?s=100" width="100px;" alt="fengxsong"/><br /><sub><b>fengxsong</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/issues?q=author%3Afengxsong" title="Bug reports">🐛</a></td>
562
616
  </tr>
563
617
  </tbody>
564
618
  <tfoot>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "agentscope-runtime"
3
- version = "1.0.0b1"
3
+ version = "1.0.1"
4
4
  description = "A production-ready runtime framework for agent applications, providing secure sandboxed execution environments and scalable deployment solutions with multi-framework support."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -11,7 +11,7 @@ dependencies = [
11
11
  "openai",
12
12
  "pydantic>=2.11.7",
13
13
  "requests>=2.32.4",
14
- "agentscope>=1.0.6",
14
+ "agentscope>=1.0.9",
15
15
  "docker>=7.1.0",
16
16
  "redis>=6.0.0",
17
17
  "oss2>=2.19.1",
@@ -84,4 +84,4 @@ ext = [
84
84
  "wheel",
85
85
  "alibabacloud-credentials",
86
86
  "PyYAML",
87
- ]
87
+ ]
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # pylint:disable=too-many-branches,too-many-statements
2
+ # pylint:disable=too-many-branches,too-many-statements,protected-access
3
3
  # TODO: support file block
4
4
  import json
5
5
 
@@ -7,6 +7,7 @@ from collections import OrderedDict
7
7
  from typing import Union, List
8
8
  from urllib.parse import urlparse
9
9
 
10
+ from mcp.types import CallToolResult
10
11
  from agentscope.message import (
11
12
  Msg,
12
13
  ToolUseBlock,
@@ -19,6 +20,7 @@ from agentscope.message import (
19
20
  URLSource,
20
21
  Base64Source,
21
22
  )
23
+ from agentscope.mcp._client_base import MCPClientBase
22
24
 
23
25
  from ...engine.schemas.agent_schemas import (
24
26
  Message,
@@ -338,6 +340,16 @@ def message_to_agentscope_msg(
338
340
  A single Msg object or a list of Msg objects.
339
341
  """
340
342
 
343
+ def _try_loads(v, default, keep_original=False):
344
+ if isinstance(v, (dict, list)):
345
+ return v
346
+ if isinstance(v, str) and v.strip():
347
+ try:
348
+ return json.loads(v)
349
+ except Exception:
350
+ return v if keep_original else default
351
+ return default
352
+
341
353
  def _convert_one(message: Message) -> Msg:
342
354
  # Normalize role
343
355
  if message.role == "tool":
@@ -365,12 +377,23 @@ def message_to_agentscope_msg(
365
377
  MessageType.FUNCTION_CALL,
366
378
  ):
367
379
  # convert PLUGIN_CALL, FUNCTION_CALL to ToolUseBlock
380
+ tool_args = None
381
+ for cnt in reversed(message.content):
382
+ if hasattr(cnt, "data"):
383
+ v = cnt.data.get("arguments")
384
+ if isinstance(v, (dict, list)) or (
385
+ isinstance(v, str) and v.strip()
386
+ ):
387
+ tool_args = _try_loads(v, {}, keep_original=False)
388
+ break
389
+ if tool_args is None:
390
+ tool_args = {}
368
391
  result["content"] = [
369
392
  ToolUseBlock(
370
393
  type="tool_use",
371
394
  id=message.content[0].data["call_id"],
372
395
  name=message.content[0].data.get("name"),
373
- input=json.loads(message.content[0].data["arguments"]),
396
+ input=tool_args,
374
397
  ),
375
398
  ]
376
399
  elif message.type in (
@@ -379,7 +402,20 @@ def message_to_agentscope_msg(
379
402
  ):
380
403
  # convert PLUGIN_CALL_OUTPUT, FUNCTION_CALL_OUTPUT to
381
404
  # ToolResultBlock
382
- blk = json.loads(message.content[0].data["output"])
405
+ out = None
406
+ raw_output = ""
407
+ for cnt in reversed(message.content):
408
+ if hasattr(cnt, "data"):
409
+ v = cnt.data.get("output")
410
+ if isinstance(v, (dict, list)) or (
411
+ isinstance(v, str) and v.strip()
412
+ ):
413
+ raw_output = v
414
+ out = _try_loads(v, "", keep_original=True)
415
+ break
416
+ if out is None:
417
+ out = ""
418
+ blk = out
383
419
 
384
420
  def is_valid_block(obj):
385
421
  return any(
@@ -389,12 +425,19 @@ def message_to_agentscope_msg(
389
425
 
390
426
  if isinstance(blk, list):
391
427
  if not all(is_valid_block(item) for item in blk):
392
- blk = message.content[0].data["output"]
428
+ try:
429
+ # Try to convert to MCP CallToolResult then to blocks
430
+ blk = CallToolResult.model_validate(blk)
431
+ blk = MCPClientBase._convert_mcp_content_to_as_blocks(
432
+ blk.content,
433
+ )
434
+ except Exception:
435
+ blk = raw_output
393
436
  elif isinstance(blk, dict):
394
437
  if not is_valid_block(blk):
395
- blk = message.content[0].data["output"]
438
+ blk = raw_output
396
439
  else:
397
- blk = message.content[0].data["output"]
440
+ blk = raw_output
398
441
 
399
442
  result["content"] = [
400
443
  ToolResultBlock(
@@ -14,6 +14,8 @@ from ...engine.schemas.agent_schemas import (
14
14
  ImageContent,
15
15
  AudioContent,
16
16
  DataContent,
17
+ McpCall,
18
+ McpCallOutput,
17
19
  FunctionCall,
18
20
  FunctionCallOutput,
19
21
  MessageType,
@@ -78,8 +80,6 @@ async def adapt_agentscope_message_stream(
78
80
  # Note: Tool use content only happens in the last of messages
79
81
  tool_start = False
80
82
 
81
- tool_use_messages_dict = {}
82
-
83
83
  # Cache msg id
84
84
  msg_id = msg.id
85
85
 
@@ -251,24 +251,65 @@ async def adapt_agentscope_message_stream(
251
251
  elif element.get("type") == "tool_use": # Tool use
252
252
  call_id = element.get("id")
253
253
 
254
+ if element.get("tool_type", "plugin") == "mcp":
255
+ msg_type = MessageType.MCP_TOOL_CALL
256
+ fc_cls = McpCall
257
+ fc_kwargs = {
258
+ "server_label": element.get("server_label"),
259
+ }
260
+ else:
261
+ msg_type = MessageType.PLUGIN_CALL
262
+ fc_cls = FunctionCall
263
+ fc_kwargs = {}
264
+
254
265
  if last:
255
- plugin_call_message = tool_use_messages_dict[
256
- call_id
257
- ]
258
- json_str = json.dumps(element.get("input"))
266
+ plugin_call_message = tool_use_messages_dict.get(
267
+ call_id,
268
+ )
269
+
270
+ if plugin_call_message is None:
271
+ # Only one tool use message yields, we fake
272
+ # Build a new tool call message
273
+ plugin_call_message = Message(
274
+ type=msg_type,
275
+ role="assistant",
276
+ )
277
+
278
+ data_delta_content = DataContent(
279
+ index=0,
280
+ data=fc_cls(
281
+ call_id=element.get("id"),
282
+ name=element.get("name"),
283
+ arguments="",
284
+ **fc_kwargs,
285
+ ).model_dump(),
286
+ delta=False,
287
+ )
288
+
289
+ plugin_call_message = _update_obj_attrs(
290
+ plugin_call_message,
291
+ metadata=metadata,
292
+ usage=usage,
293
+ )
294
+ yield plugin_call_message.in_progress()
295
+ yield data_delta_content.in_progress()
296
+
297
+ json_str = json.dumps(
298
+ element.get("input"),
299
+ ensure_ascii=False,
300
+ )
259
301
  data_delta_content = DataContent(
260
- index=index,
261
- data=FunctionCall(
302
+ index=None, # Will be set by `add_content`
303
+ data=fc_cls(
262
304
  call_id=element.get("id"),
263
305
  name=element.get("name"),
264
306
  arguments=json_str,
307
+ **fc_kwargs,
265
308
  ).model_dump(),
266
- delta=True,
309
+ delta=False,
267
310
  )
268
- data_delta_content = (
269
- plugin_call_message.add_delta_content(
270
- new_content=data_delta_content,
271
- )
311
+ plugin_call_message.add_content(
312
+ new_content=data_delta_content,
272
313
  )
273
314
  yield data_delta_content.completed()
274
315
  plugin_call_message = _update_obj_attrs(
@@ -284,18 +325,19 @@ async def adapt_agentscope_message_stream(
284
325
  else:
285
326
  # Build a new tool call message
286
327
  plugin_call_message = Message(
287
- type=MessageType.PLUGIN_CALL,
328
+ type=msg_type,
288
329
  role="assistant",
289
330
  )
290
331
 
291
332
  data_delta_content = DataContent(
292
- index=index,
293
- data=FunctionCall(
333
+ index=0,
334
+ data=fc_cls(
294
335
  call_id=element.get("id"),
295
336
  name=element.get("name"),
296
337
  arguments="",
338
+ **fc_kwargs,
297
339
  ).model_dump(),
298
- delta=True,
340
+ delta=False,
299
341
  )
300
342
 
301
343
  plugin_call_message = _update_obj_attrs(
@@ -304,32 +346,46 @@ async def adapt_agentscope_message_stream(
304
346
  usage=usage,
305
347
  )
306
348
  yield plugin_call_message.in_progress()
307
- data_delta_content = (
308
- plugin_call_message.add_delta_content(
309
- new_content=data_delta_content,
310
- )
311
- )
312
- yield data_delta_content
349
+ yield data_delta_content.in_progress()
313
350
 
314
351
  tool_use_messages_dict[
315
352
  call_id
316
353
  ] = plugin_call_message
317
354
 
318
355
  elif element.get("type") == "tool_result": # Tool result
356
+ call_id = element.get("id")
357
+
358
+ plugin_call_message = tool_use_messages_dict.get(
359
+ call_id,
360
+ )
361
+ # Determine the output message type and class to use
362
+ # for the tool result message based on the type of
363
+ # the original tool call message.
364
+ msg_type = MessageType.PLUGIN_CALL_OUTPUT
365
+ fc_cls = FunctionCallOutput
366
+
367
+ if plugin_call_message:
368
+ if (
369
+ plugin_call_message.type
370
+ == MessageType.MCP_TOOL_CALL
371
+ ):
372
+ msg_type = MessageType.MCP_TOOL_CALL_OUTPUT
373
+ fc_cls = McpCallOutput
374
+
319
375
  json_str = json.dumps(
320
376
  element.get("output"),
321
377
  ensure_ascii=False,
322
378
  )
323
379
  data_delta_content = DataContent(
324
380
  index=index,
325
- data=FunctionCallOutput(
381
+ data=fc_cls(
326
382
  call_id=element.get("id"),
327
383
  name=element.get("name"),
328
384
  output=json_str,
329
385
  ).model_dump(),
330
386
  )
331
387
  plugin_output_message = Message(
332
- type=MessageType.PLUGIN_CALL_OUTPUT,
388
+ type=msg_type,
333
389
  role="tool",
334
390
  content=[data_delta_content],
335
391
  )
@@ -9,9 +9,7 @@ from typing import (
9
9
  )
10
10
 
11
11
  from agentscope.tool import Toolkit, ToolResponse
12
- from agentscope.tool._registered_tool_function import (
13
- RegisteredToolFunction,
14
- )
12
+ from agentscope.tool._types import RegisteredToolFunction
15
13
 
16
14
  from agentscope_runtime.tools.base import Tool
17
15
 
@@ -1,6 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  import logging
3
3
  import types
4
+ import platform
4
5
  import subprocess
5
6
  import shlex
6
7
  from typing import Optional, Callable, List
@@ -203,7 +204,13 @@ class AgentApp(BaseApp):
203
204
  "[AgentApp] Note: First WebUI launch may take extra time "
204
205
  "as dependencies are installed.",
205
206
  )
206
- with subprocess.Popen(shlex.split(cmd)):
207
+
208
+ cmd_kwarg = {}
209
+ if platform.system() == "Windows":
210
+ cmd_kwarg.update({"shell": True})
211
+ else:
212
+ cmd = shlex.split(cmd)
213
+ with subprocess.Popen(cmd, **cmd_kwarg):
207
214
  uvicorn.run(
208
215
  fastapi_app,
209
216
  host=host,
@@ -1022,7 +1022,7 @@ ls -lh /output/{zip_filename}
1022
1022
  artifact_type="Code",
1023
1023
  cpu=self.agentrun_config.cpu,
1024
1024
  memory=self.agentrun_config.memory,
1025
- port=8080,
1025
+ port=8090,
1026
1026
  code_configuration=CodeConfig(
1027
1027
  command=["python3", "/code/deploy_starter/main.py"],
1028
1028
  oss_bucket_name=oss_bucket_name,
@@ -1159,7 +1159,7 @@ ls -lh /output/{zip_filename}
1159
1159
  artifact_type="Code",
1160
1160
  cpu=self.agentrun_config.cpu,
1161
1161
  memory=self.agentrun_config.memory,
1162
- port=8080,
1162
+ port=8090,
1163
1163
  code_configuration=CodeConfig(
1164
1164
  command=["python3", "/code/deploy_starter/main.py"],
1165
1165
  oss_bucket_name=oss_bucket_name,
@@ -693,9 +693,32 @@ class FastAPIAppFactory:
693
693
  parsing."""
694
694
  is_async_gen = inspect.isasyncgenfunction(handler)
695
695
 
696
+ # NOTE:
697
+ # -----
698
+ # FastAPI >= 0.123.5 uses Dependant.is_coroutine_callable, which in
699
+ # turn unwraps callables via inspect.unwrap() and then inspects the
700
+ # unwrapped target to decide whether it is a coroutine function /
701
+ # generator / async generator.
702
+ #
703
+ # If we decorate an async-generator handler with
704
+ # functools.wraps(handler), FastAPI will unwrap back to the original
705
+ # async-generator function and *misclassify* the endpoint as
706
+ # non-coroutine. It will then call our async wrapper *without awaiting
707
+ # it*, and later try to JSON-encode the resulting coroutine object,
708
+ # causing errors like:
709
+ # TypeError("'coroutine' object is not iterable")
710
+ #
711
+ # To avoid that, we deliberately do NOT use functools.wraps() here.
712
+ # Instead, we manually copy the key metadata (name, qualname, doc,
713
+ # module, and signature) from the original handler, but we do NOT set
714
+ # __wrapped__. This ensures:
715
+ # * FastAPI sees the wrapper itself as the callable (an async def),
716
+ # so Dependant.is_coroutine_callable is True, and it is properly
717
+ # awaited.
718
+ # * FastAPI still sees the correct signature for parameter parsing.
719
+
696
720
  if is_async_gen:
697
721
 
698
- @functools.wraps(handler)
699
722
  async def wrapped_handler(*args, **kwargs):
700
723
  async def generate():
701
724
  try:
@@ -720,12 +743,8 @@ class FastAPIAppFactory:
720
743
  media_type="text/event-stream",
721
744
  )
722
745
 
723
- wrapped_handler.__signature__ = inspect.signature(handler)
724
- return wrapped_handler
725
-
726
746
  else:
727
747
 
728
- @functools.wraps(handler)
729
748
  def wrapped_handler(*args, **kwargs):
730
749
  def generate():
731
750
  try:
@@ -748,8 +767,34 @@ class FastAPIAppFactory:
748
767
  media_type="text/event-stream",
749
768
  )
750
769
 
751
- wrapped_handler.__signature__ = inspect.signature(handler)
752
- return wrapped_handler
770
+ # Manually propagate essential metadata without creating a __wrapped__
771
+ # chain that would confuse FastAPI's unwrap logic.
772
+ wrapped_handler.__name__ = getattr(
773
+ handler,
774
+ "__name__",
775
+ wrapped_handler.__name__,
776
+ )
777
+ wrapped_handler.__qualname__ = getattr(
778
+ handler,
779
+ "__qualname__",
780
+ wrapped_handler.__qualname__,
781
+ )
782
+ wrapped_handler.__doc__ = getattr(
783
+ handler,
784
+ "__doc__",
785
+ wrapped_handler.__doc__,
786
+ )
787
+ wrapped_handler.__module__ = getattr(
788
+ handler,
789
+ "__module__",
790
+ wrapped_handler.__module__,
791
+ )
792
+ wrapped_handler.__signature__ = inspect.signature(handler)
793
+
794
+ # Make sure FastAPI doesn't see any stale __wrapped__ pointing back to
795
+ # the original async-generator; if present, remove it.
796
+
797
+ return wrapped_handler
753
798
 
754
799
  @staticmethod
755
800
  def _add_custom_endpoints(app: FastAPI):