agentscope-runtime 0.1.2__tar.gz → 0.1.3__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.
- {agentscope_runtime-0.1.2/src/agentscope_runtime.egg-info → agentscope_runtime-0.1.3}/PKG-INFO +54 -3
- agentscope_runtime-0.1.2/PKG-INFO → agentscope_runtime-0.1.3/README.md +40 -49
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/pyproject.toml +18 -4
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/agents/agentscope_agent/agent.py +105 -50
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/agents/agentscope_agent/hooks.py +16 -3
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/helpers/helper.py +33 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/runner.py +33 -1
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/schemas/agent_schemas.py +208 -13
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/services/context_manager.py +7 -1
- agentscope_runtime-0.1.3/src/agentscope_runtime/engine/services/rag_service.py +195 -0
- agentscope_runtime-0.1.3/src/agentscope_runtime/engine/services/reme_personal_memory_service.py +106 -0
- agentscope_runtime-0.1.3/src/agentscope_runtime/engine/services/reme_task_memory_service.py +11 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/browser/browser_sandbox.py +25 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/sandbox.py +60 -7
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/shared/routers/mcp_utils.py +20 -2
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/client/http_client.py +1 -1
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/server/app.py +87 -13
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/tools/mcp_tool.py +1 -1
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/version.py +1 -1
- agentscope_runtime-0.1.2/README.md → agentscope_runtime-0.1.3/src/agentscope_runtime.egg-info/PKG-INFO +100 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime.egg-info/SOURCES.txt +2 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime.egg-info/requires.txt +17 -2
- agentscope_runtime-0.1.2/src/agentscope_runtime/engine/services/rag_service.py +0 -101
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/LICENSE +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/setup.cfg +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/setup.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/agents/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/agents/agentscope_agent/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/agents/agno_agent.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/agents/autogen_agent.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/agents/base_agent.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/agents/langgraph_agent.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/agents/llm_agent.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/deployers/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/deployers/adapter/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/deployers/adapter/a2a/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/deployers/adapter/a2a/a2a_adapter_utils.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/deployers/adapter/a2a/a2a_agent_adapter.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/deployers/adapter/a2a/a2a_protocol_adapter.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/deployers/adapter/protocol_adapter.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/deployers/base.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/deployers/local_deployer.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/llms/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/llms/base_llm.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/llms/qwen_llm.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/misc/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/schemas/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/schemas/context.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/services/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/services/base.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/services/environment_manager.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/services/manager.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/services/memory_service.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/services/redis_memory_service.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/services/redis_session_history_service.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/services/sandbox_service.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/services/session_history_service.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/tracing/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/tracing/base.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/tracing/local_logging_handler.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/tracing/tracing_metric.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/tracing/wrapper.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/base/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/base/base_sandbox.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/base/box/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/browser/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/browser/box/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/dummy/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/dummy/dummy_sandbox.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/filesystem/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/filesystem/box/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/filesystem/filesystem_sandbox.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/shared/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/shared/app.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/shared/dependencies/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/shared/dependencies/deps.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/shared/routers/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/shared/routers/generic.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/shared/routers/mcp.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/shared/routers/runtime_watcher.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/shared/routers/workspace.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/training_box/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/training_box/base.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/training_box/env_service.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/training_box/environments/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/training_box/environments/appworld/appworld_env.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/training_box/environments/bfcl/bfcl_dataprocess.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/training_box/environments/bfcl/bfcl_env.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/training_box/environments/bfcl/env_handler.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/training_box/registry.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/training_box/src/trajectory.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/box/training_box/training_box.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/build.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/client/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/client/training_client.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/constant.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/custom/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/custom/custom_sandbox.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/custom/example.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/enums.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/collections/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/collections/base_mapping.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/collections/base_queue.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/collections/base_set.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/collections/in_memory_mapping.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/collections/in_memory_queue.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/collections/in_memory_set.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/collections/redis_mapping.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/collections/redis_queue.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/collections/redis_set.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/container_clients/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/container_clients/base_client.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/container_clients/docker_client.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/container_clients/kubernetes_client.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/sandbox_manager.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/server/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/server/config.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/server/models.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/storage/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/storage/data_storage.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/storage/local_storage.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/manager/storage/oss_storage.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/mcp_server.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/model/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/model/api.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/model/container.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/model/manager_config.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/registry.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/tools/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/tools/base/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/tools/base/tool.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/tools/browser/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/tools/browser/tool.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/tools/filesystem/__init__.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/tools/filesystem/tool.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/tools/function_tool.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/tools/sandbox_tool.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/tools/tool.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/sandbox/tools/utils.py +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime.egg-info/dependency_links.txt +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime.egg-info/entry_points.txt +0 -0
- {agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime.egg-info/top_level.txt +0 -0
{agentscope_runtime-0.1.2/src/agentscope_runtime.egg-info → agentscope_runtime-0.1.3}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agentscope-runtime
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
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
|
|
@@ -30,11 +30,11 @@ Requires-Dist: dotenv>=0.9.9; extra == "sandbox"
|
|
|
30
30
|
Requires-Dist: kubernetes>=33.1.0; extra == "sandbox"
|
|
31
31
|
Requires-Dist: shortuuid>=1.0.13; extra == "sandbox"
|
|
32
32
|
Provides-Extra: agentscope
|
|
33
|
-
Requires-Dist: agentscope
|
|
33
|
+
Requires-Dist: agentscope>=1.0.1; extra == "agentscope"
|
|
34
34
|
Provides-Extra: langgraph
|
|
35
35
|
Requires-Dist: langgraph>=0.5.3; extra == "langgraph"
|
|
36
36
|
Provides-Extra: agno
|
|
37
|
-
Requires-Dist: agno
|
|
37
|
+
Requires-Dist: agno<2.0.0,>=1.7.5; extra == "agno"
|
|
38
38
|
Provides-Extra: a2a
|
|
39
39
|
Requires-Dist: a2a-sdk>=0.3.0; extra == "a2a"
|
|
40
40
|
Provides-Extra: autogen
|
|
@@ -45,6 +45,17 @@ Requires-Dist: langchain>=0.3.25; extra == "langchain-rag"
|
|
|
45
45
|
Requires-Dist: pymilvus>=2.6.0; extra == "langchain-rag"
|
|
46
46
|
Requires-Dist: langchain-community>=0.3.27; extra == "langchain-rag"
|
|
47
47
|
Requires-Dist: langchain-milvus>=0.2.1; extra == "langchain-rag"
|
|
48
|
+
Requires-Dist: bs4>=0.0.2; extra == "langchain-rag"
|
|
49
|
+
Provides-Extra: llamaindex-rag
|
|
50
|
+
Requires-Dist: llama-index>=0.13.4; extra == "llamaindex-rag"
|
|
51
|
+
Requires-Dist: pymilvus>=2.6.0; extra == "llamaindex-rag"
|
|
52
|
+
Requires-Dist: llama-index-vector-stores-milvus>=0.9.1; extra == "llamaindex-rag"
|
|
53
|
+
Requires-Dist: llama-index-readers-web>=0.5.1; extra == "llamaindex-rag"
|
|
54
|
+
Requires-Dist: llama-index-embeddings-langchain>=0.4.0; extra == "llamaindex-rag"
|
|
55
|
+
Requires-Dist: langchain-community>=0.3.27; extra == "llamaindex-rag"
|
|
56
|
+
Requires-Dist: bs4>=0.0.2; extra == "llamaindex-rag"
|
|
57
|
+
Provides-Extra: memory-ext
|
|
58
|
+
Requires-Dist: reme-ai==0.1.8; python_full_version >= "3.12" and extra == "memory-ext"
|
|
48
59
|
Dynamic: license-file
|
|
49
60
|
|
|
50
61
|
<div align="center">
|
|
@@ -391,3 +402,43 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
391
402
|
See the License for the specific language governing permissions and
|
|
392
403
|
limitations under the License.
|
|
393
404
|
```
|
|
405
|
+
|
|
406
|
+
## Contributors ✨
|
|
407
|
+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
408
|
+
[](#contributors-)
|
|
409
|
+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
410
|
+
|
|
411
|
+
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
|
412
|
+
|
|
413
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
414
|
+
<!-- prettier-ignore-start -->
|
|
415
|
+
<!-- markdownlint-disable -->
|
|
416
|
+
<table>
|
|
417
|
+
<tbody>
|
|
418
|
+
<tr>
|
|
419
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rayrayraykk"><img src="https://avatars.githubusercontent.com/u/39145382?v=4?s=100" width="100px;" alt="Weirui Kuang"/><br /><sub><b>Weirui Kuang</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=rayrayraykk" title="Code">💻</a> <a href="https://github.com/agentscope-ai/agentscope-runtime/pulls?q=is%3Apr+reviewed-by%3Arayrayraykk" title="Reviewed Pull Requests">👀</a> <a href="#maintenance-rayrayraykk" title="Maintenance">🚧</a> <a href="#projectManagement-rayrayraykk" title="Project Management">📆</a></td>
|
|
420
|
+
<td align="center" valign="top" width="14.28%"><a href="http://www.bruceluo.net/"><img src="https://avatars.githubusercontent.com/u/7297307?v=4?s=100" width="100px;" alt="Bruce Luo"/><br /><sub><b>Bruce Luo</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=zhilingluo" title="Code">💻</a> <a href="https://github.com/agentscope-ai/agentscope-runtime/pulls?q=is%3Apr+reviewed-by%3Azhilingluo" title="Reviewed Pull Requests">👀</a> <a href="#example-zhilingluo" title="Examples">💡</a></td>
|
|
421
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zzhangpurdue"><img src="https://avatars.githubusercontent.com/u/5746653?v=4?s=100" width="100px;" alt="Zhicheng Zhang"/><br /><sub><b>Zhicheng Zhang</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=zzhangpurdue" title="Code">💻</a> <a href="https://github.com/agentscope-ai/agentscope-runtime/pulls?q=is%3Apr+reviewed-by%3Azzhangpurdue" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=zzhangpurdue" title="Documentation">📖</a></td>
|
|
422
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ericczq"><img src="https://avatars.githubusercontent.com/u/116273607?v=4?s=100" width="100px;" alt="ericczq"/><br /><sub><b>ericczq</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=ericczq" title="Code">💻</a> <a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=ericczq" title="Documentation">📖</a></td>
|
|
423
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/qbc2016"><img src="https://avatars.githubusercontent.com/u/22984042?v=4?s=100" width="100px;" alt="qbc"/><br /><sub><b>qbc</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/pulls?q=is%3Apr+reviewed-by%3Aqbc2016" title="Reviewed Pull Requests">👀</a></td>
|
|
424
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rankesterc"><img src="https://avatars.githubusercontent.com/u/114560457?v=4?s=100" width="100px;" alt="Ran Chen"/><br /><sub><b>Ran Chen</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=rankesterc" title="Code">💻</a></td>
|
|
425
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jinliyl"><img src="https://avatars.githubusercontent.com/u/6469360?v=4?s=100" width="100px;" alt="jinliyl"/><br /><sub><b>jinliyl</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=jinliyl" title="Code">💻</a> <a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=jinliyl" title="Documentation">📖</a></td>
|
|
426
|
+
</tr>
|
|
427
|
+
</tbody>
|
|
428
|
+
<tfoot>
|
|
429
|
+
<tr>
|
|
430
|
+
<td align="center" size="13px" colspan="7">
|
|
431
|
+
<img src="https://raw.githubusercontent.com/all-contributors/all-contributors-cli/1b8533af435da9854653492b1327a23a4dbd0a10/assets/logo-small.svg">
|
|
432
|
+
<a href="https://all-contributors.js.org/docs/en/bot/usage">Add your contributions</a>
|
|
433
|
+
</img>
|
|
434
|
+
</td>
|
|
435
|
+
</tr>
|
|
436
|
+
</tfoot>
|
|
437
|
+
</table>
|
|
438
|
+
|
|
439
|
+
<!-- markdownlint-restore -->
|
|
440
|
+
<!-- prettier-ignore-end -->
|
|
441
|
+
|
|
442
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
443
|
+
|
|
444
|
+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
|
@@ -1,52 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: agentscope-runtime
|
|
3
|
-
Version: 0.1.2
|
|
4
|
-
Summary: A production-ready runtime framework for agent applications, providing secure sandboxed execution environments and scalable deployment solutions with multi-framework support.
|
|
5
|
-
Requires-Python: >=3.10
|
|
6
|
-
Description-Content-Type: text/markdown
|
|
7
|
-
License-File: LICENSE
|
|
8
|
-
Requires-Dist: mcp<1.10.0,>=1.8.0
|
|
9
|
-
Requires-Dist: fastapi>=0.104.0
|
|
10
|
-
Requires-Dist: uvicorn[standard]>=0.24.0
|
|
11
|
-
Requires-Dist: openai
|
|
12
|
-
Requires-Dist: pydantic>=2.11.7
|
|
13
|
-
Requires-Dist: requests>=2.32.4
|
|
14
|
-
Provides-Extra: dev
|
|
15
|
-
Requires-Dist: pytest>=8.3.5; extra == "dev"
|
|
16
|
-
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
|
|
17
|
-
Requires-Dist: pre-commit>=4.2.0; extra == "dev"
|
|
18
|
-
Requires-Dist: jupyter-book>=1.0.4.post1; extra == "dev"
|
|
19
|
-
Requires-Dist: furo>=2025.7.19; extra == "dev"
|
|
20
|
-
Requires-Dist: pytest-cov>=6.2.1; extra == "dev"
|
|
21
|
-
Requires-Dist: fakeredis>=2.31.0; extra == "dev"
|
|
22
|
-
Requires-Dist: sphinx-autoapi>=3.6.0; extra == "dev"
|
|
23
|
-
Provides-Extra: sandbox
|
|
24
|
-
Requires-Dist: docker>=7.1.0; extra == "sandbox"
|
|
25
|
-
Requires-Dist: steel-sdk>=0.1.0; extra == "sandbox"
|
|
26
|
-
Requires-Dist: redis>=6.0.0b2; extra == "sandbox"
|
|
27
|
-
Requires-Dist: oss2>=2.19.1; extra == "sandbox"
|
|
28
|
-
Requires-Dist: pydantic-settings>=2.9.1; extra == "sandbox"
|
|
29
|
-
Requires-Dist: dotenv>=0.9.9; extra == "sandbox"
|
|
30
|
-
Requires-Dist: kubernetes>=33.1.0; extra == "sandbox"
|
|
31
|
-
Requires-Dist: shortuuid>=1.0.13; extra == "sandbox"
|
|
32
|
-
Provides-Extra: agentscope
|
|
33
|
-
Requires-Dist: agentscope==1.0.0; extra == "agentscope"
|
|
34
|
-
Provides-Extra: langgraph
|
|
35
|
-
Requires-Dist: langgraph>=0.5.3; extra == "langgraph"
|
|
36
|
-
Provides-Extra: agno
|
|
37
|
-
Requires-Dist: agno>=1.7.5; extra == "agno"
|
|
38
|
-
Provides-Extra: a2a
|
|
39
|
-
Requires-Dist: a2a-sdk>=0.3.0; extra == "a2a"
|
|
40
|
-
Provides-Extra: autogen
|
|
41
|
-
Requires-Dist: autogen-agentchat>=0.7.4; extra == "autogen"
|
|
42
|
-
Requires-Dist: autogen-ext[openai]>=0.7.4; extra == "autogen"
|
|
43
|
-
Provides-Extra: langchain-rag
|
|
44
|
-
Requires-Dist: langchain>=0.3.25; extra == "langchain-rag"
|
|
45
|
-
Requires-Dist: pymilvus>=2.6.0; extra == "langchain-rag"
|
|
46
|
-
Requires-Dist: langchain-community>=0.3.27; extra == "langchain-rag"
|
|
47
|
-
Requires-Dist: langchain-milvus>=0.2.1; extra == "langchain-rag"
|
|
48
|
-
Dynamic: license-file
|
|
49
|
-
|
|
50
1
|
<div align="center">
|
|
51
2
|
|
|
52
3
|
# AgentScope Runtime
|
|
@@ -391,3 +342,43 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
391
342
|
See the License for the specific language governing permissions and
|
|
392
343
|
limitations under the License.
|
|
393
344
|
```
|
|
345
|
+
|
|
346
|
+
## Contributors ✨
|
|
347
|
+
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
348
|
+
[](#contributors-)
|
|
349
|
+
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
350
|
+
|
|
351
|
+
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
|
352
|
+
|
|
353
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
354
|
+
<!-- prettier-ignore-start -->
|
|
355
|
+
<!-- markdownlint-disable -->
|
|
356
|
+
<table>
|
|
357
|
+
<tbody>
|
|
358
|
+
<tr>
|
|
359
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rayrayraykk"><img src="https://avatars.githubusercontent.com/u/39145382?v=4?s=100" width="100px;" alt="Weirui Kuang"/><br /><sub><b>Weirui Kuang</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=rayrayraykk" title="Code">💻</a> <a href="https://github.com/agentscope-ai/agentscope-runtime/pulls?q=is%3Apr+reviewed-by%3Arayrayraykk" title="Reviewed Pull Requests">👀</a> <a href="#maintenance-rayrayraykk" title="Maintenance">🚧</a> <a href="#projectManagement-rayrayraykk" title="Project Management">📆</a></td>
|
|
360
|
+
<td align="center" valign="top" width="14.28%"><a href="http://www.bruceluo.net/"><img src="https://avatars.githubusercontent.com/u/7297307?v=4?s=100" width="100px;" alt="Bruce Luo"/><br /><sub><b>Bruce Luo</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=zhilingluo" title="Code">💻</a> <a href="https://github.com/agentscope-ai/agentscope-runtime/pulls?q=is%3Apr+reviewed-by%3Azhilingluo" title="Reviewed Pull Requests">👀</a> <a href="#example-zhilingluo" title="Examples">💡</a></td>
|
|
361
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/zzhangpurdue"><img src="https://avatars.githubusercontent.com/u/5746653?v=4?s=100" width="100px;" alt="Zhicheng Zhang"/><br /><sub><b>Zhicheng Zhang</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=zzhangpurdue" title="Code">💻</a> <a href="https://github.com/agentscope-ai/agentscope-runtime/pulls?q=is%3Apr+reviewed-by%3Azzhangpurdue" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=zzhangpurdue" title="Documentation">📖</a></td>
|
|
362
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/ericczq"><img src="https://avatars.githubusercontent.com/u/116273607?v=4?s=100" width="100px;" alt="ericczq"/><br /><sub><b>ericczq</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=ericczq" title="Code">💻</a> <a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=ericczq" title="Documentation">📖</a></td>
|
|
363
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/qbc2016"><img src="https://avatars.githubusercontent.com/u/22984042?v=4?s=100" width="100px;" alt="qbc"/><br /><sub><b>qbc</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/pulls?q=is%3Apr+reviewed-by%3Aqbc2016" title="Reviewed Pull Requests">👀</a></td>
|
|
364
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rankesterc"><img src="https://avatars.githubusercontent.com/u/114560457?v=4?s=100" width="100px;" alt="Ran Chen"/><br /><sub><b>Ran Chen</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=rankesterc" title="Code">💻</a></td>
|
|
365
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jinliyl"><img src="https://avatars.githubusercontent.com/u/6469360?v=4?s=100" width="100px;" alt="jinliyl"/><br /><sub><b>jinliyl</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=jinliyl" title="Code">💻</a> <a href="https://github.com/agentscope-ai/agentscope-runtime/commits?author=jinliyl" title="Documentation">📖</a></td>
|
|
366
|
+
</tr>
|
|
367
|
+
</tbody>
|
|
368
|
+
<tfoot>
|
|
369
|
+
<tr>
|
|
370
|
+
<td align="center" size="13px" colspan="7">
|
|
371
|
+
<img src="https://raw.githubusercontent.com/all-contributors/all-contributors-cli/1b8533af435da9854653492b1327a23a4dbd0a10/assets/logo-small.svg">
|
|
372
|
+
<a href="https://all-contributors.js.org/docs/en/bot/usage">Add your contributions</a>
|
|
373
|
+
</img>
|
|
374
|
+
</td>
|
|
375
|
+
</tr>
|
|
376
|
+
</tfoot>
|
|
377
|
+
</table>
|
|
378
|
+
|
|
379
|
+
<!-- markdownlint-restore -->
|
|
380
|
+
<!-- prettier-ignore-end -->
|
|
381
|
+
|
|
382
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
383
|
+
|
|
384
|
+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "agentscope-runtime"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.3"
|
|
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"
|
|
@@ -49,7 +49,7 @@ sandbox = [
|
|
|
49
49
|
]
|
|
50
50
|
|
|
51
51
|
agentscope = [
|
|
52
|
-
"agentscope
|
|
52
|
+
"agentscope>=1.0.1",
|
|
53
53
|
]
|
|
54
54
|
|
|
55
55
|
langgraph = [
|
|
@@ -57,7 +57,7 @@ langgraph = [
|
|
|
57
57
|
]
|
|
58
58
|
|
|
59
59
|
agno = [
|
|
60
|
-
"agno>=1.7.5",
|
|
60
|
+
"agno>=1.7.5,<2.0.0",
|
|
61
61
|
]
|
|
62
62
|
a2a = [
|
|
63
63
|
"a2a-sdk>=0.3.0",
|
|
@@ -72,4 +72,18 @@ langchain_rag=[
|
|
|
72
72
|
"pymilvus>=2.6.0",
|
|
73
73
|
"langchain-community>=0.3.27",
|
|
74
74
|
"langchain-milvus>=0.2.1",
|
|
75
|
-
|
|
75
|
+
"bs4>=0.0.2",
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
llamaindex_rag=[
|
|
79
|
+
"llama-index>=0.13.4",
|
|
80
|
+
"pymilvus>=2.6.0",
|
|
81
|
+
"llama-index-vector-stores-milvus>=0.9.1",
|
|
82
|
+
"llama-index-readers-web>=0.5.1",
|
|
83
|
+
"llama-index-embeddings-langchain>=0.4.0",
|
|
84
|
+
"langchain-community>=0.3.27",
|
|
85
|
+
"bs4>=0.0.2",
|
|
86
|
+
]
|
|
87
|
+
memory-ext = [
|
|
88
|
+
"reme-ai==0.1.8 ; python_full_version >= '3.12'",
|
|
89
|
+
]
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
# pylint:disable=too-many-nested-blocks, too-many-branches, too-many-statements
|
|
3
|
+
# pylint:disable=line-too-long, protected-access
|
|
4
|
+
|
|
3
5
|
import json
|
|
4
6
|
import threading
|
|
5
7
|
import uuid
|
|
6
8
|
from functools import partial
|
|
7
9
|
from typing import Optional, Type
|
|
8
10
|
|
|
11
|
+
from agentscope import setup_logger
|
|
9
12
|
from agentscope.agent import ReActAgent
|
|
10
13
|
from agentscope.formatter import (
|
|
11
14
|
FormatterBase,
|
|
@@ -15,6 +18,8 @@ from agentscope.formatter import (
|
|
|
15
18
|
OllamaChatFormatter,
|
|
16
19
|
GeminiChatFormatter,
|
|
17
20
|
)
|
|
21
|
+
from agentscope.memory import InMemoryMemory
|
|
22
|
+
from agentscope.message import Msg, ToolUseBlock, ToolResultBlock
|
|
18
23
|
from agentscope.model import (
|
|
19
24
|
ChatModelBase,
|
|
20
25
|
DashScopeChatModel,
|
|
@@ -23,9 +28,6 @@ from agentscope.model import (
|
|
|
23
28
|
OllamaChatModel,
|
|
24
29
|
GeminiChatModel,
|
|
25
30
|
)
|
|
26
|
-
from agentscope.memory import InMemoryMemory
|
|
27
|
-
from agentscope.message import Msg
|
|
28
|
-
from agentscope import setup_logger
|
|
29
31
|
from agentscope.tool import (
|
|
30
32
|
Toolkit,
|
|
31
33
|
ToolResponse,
|
|
@@ -46,7 +48,6 @@ from ...schemas.agent_schemas import (
|
|
|
46
48
|
FunctionCall,
|
|
47
49
|
FunctionCallOutput,
|
|
48
50
|
MessageType,
|
|
49
|
-
RunStatus,
|
|
50
51
|
)
|
|
51
52
|
from ...schemas.context import Context
|
|
52
53
|
|
|
@@ -90,12 +91,33 @@ class AgentScopeContextAdapter:
|
|
|
90
91
|
role_label = "user"
|
|
91
92
|
else:
|
|
92
93
|
role_label = message.role
|
|
93
|
-
|
|
94
|
-
return {
|
|
94
|
+
result = {
|
|
95
95
|
"name": message.role,
|
|
96
96
|
"role": role_label,
|
|
97
|
-
"content": message.content[0].text if message.content else "",
|
|
98
97
|
}
|
|
98
|
+
if message.type == MessageType.PLUGIN_CALL:
|
|
99
|
+
result["content"] = [
|
|
100
|
+
ToolUseBlock(
|
|
101
|
+
type="tool_use",
|
|
102
|
+
id=message.content[0].data["call_id"],
|
|
103
|
+
name=message.role,
|
|
104
|
+
input=json.loads(message.content[0].data["arguments"]),
|
|
105
|
+
),
|
|
106
|
+
]
|
|
107
|
+
elif message.type == MessageType.PLUGIN_CALL_OUTPUT:
|
|
108
|
+
result["content"] = [
|
|
109
|
+
ToolResultBlock(
|
|
110
|
+
type="tool_result",
|
|
111
|
+
id=message.content[0].data["call_id"],
|
|
112
|
+
name=message.role,
|
|
113
|
+
output=message.content[0].data["output"],
|
|
114
|
+
),
|
|
115
|
+
]
|
|
116
|
+
else:
|
|
117
|
+
result["content"] = (
|
|
118
|
+
message.content[0].text if message.content else ""
|
|
119
|
+
)
|
|
120
|
+
return result
|
|
99
121
|
|
|
100
122
|
async def adapt_new_message(self):
|
|
101
123
|
last_message = self.context.session.messages[-1]
|
|
@@ -213,6 +235,7 @@ class AgentScopeAgent(Agent):
|
|
|
213
235
|
memory=as_context.memory,
|
|
214
236
|
toolkit=as_context.toolkit,
|
|
215
237
|
)
|
|
238
|
+
self._agent._disable_console_output = True
|
|
216
239
|
|
|
217
240
|
self._agent.register_instance_hook(
|
|
218
241
|
"pre_print",
|
|
@@ -225,6 +248,7 @@ class AgentScopeAgent(Agent):
|
|
|
225
248
|
async def run(self, context):
|
|
226
249
|
as_context = AgentScopeContextAdapter(context=context, attr=self._attr)
|
|
227
250
|
await as_context.initialize()
|
|
251
|
+
local_truncate_memory = ""
|
|
228
252
|
|
|
229
253
|
# We should always build a new agent since the state is manage outside
|
|
230
254
|
# the agent
|
|
@@ -245,89 +269,120 @@ class AgentScopeAgent(Agent):
|
|
|
245
269
|
# Yield new Msg instances as they are logged
|
|
246
270
|
last_content = ""
|
|
247
271
|
|
|
272
|
+
message = Message(type=MessageType.MESSAGE, role="assistant")
|
|
273
|
+
yield message.in_progress()
|
|
274
|
+
index = None
|
|
275
|
+
|
|
248
276
|
for msg, msg_len in get_msg_instances(thread_id=thread_id):
|
|
249
277
|
if msg:
|
|
250
278
|
content = msg.content
|
|
251
|
-
|
|
252
279
|
if isinstance(content, str):
|
|
253
280
|
last_content = content
|
|
254
281
|
else:
|
|
255
282
|
for element in content:
|
|
256
|
-
if isinstance(element, str):
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
283
|
+
if isinstance(element, str) and element:
|
|
284
|
+
text_delta_content = TextContent(
|
|
285
|
+
delta=True,
|
|
286
|
+
index=index,
|
|
287
|
+
text=element,
|
|
288
|
+
)
|
|
289
|
+
text_delta_content = message.add_delta_content(
|
|
290
|
+
new_content=text_delta_content,
|
|
263
291
|
)
|
|
264
|
-
|
|
292
|
+
index = text_delta_content.index
|
|
293
|
+
yield text_delta_content
|
|
265
294
|
elif isinstance(element, dict):
|
|
266
295
|
if element.get("type") == "text":
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
message = Message(
|
|
271
|
-
type=MessageType.MESSAGE,
|
|
272
|
-
role="assistant",
|
|
273
|
-
status=RunStatus.Completed,
|
|
274
|
-
content=[content],
|
|
296
|
+
text = element.get(
|
|
297
|
+
"text",
|
|
298
|
+
"",
|
|
275
299
|
)
|
|
276
|
-
|
|
300
|
+
if text:
|
|
301
|
+
text_delta_content = TextContent(
|
|
302
|
+
delta=True,
|
|
303
|
+
index=index,
|
|
304
|
+
text=text.removeprefix(
|
|
305
|
+
local_truncate_memory,
|
|
306
|
+
),
|
|
307
|
+
)
|
|
308
|
+
local_truncate_memory = element.get(
|
|
309
|
+
"text",
|
|
310
|
+
"",
|
|
311
|
+
)
|
|
312
|
+
text_delta_content = (
|
|
313
|
+
message.add_delta_content(
|
|
314
|
+
new_content=text_delta_content,
|
|
315
|
+
)
|
|
316
|
+
)
|
|
317
|
+
index = text_delta_content.index
|
|
318
|
+
yield text_delta_content
|
|
319
|
+
if hasattr(msg, "is_last"):
|
|
320
|
+
yield message.completed()
|
|
321
|
+
message = Message(
|
|
322
|
+
type=MessageType.MESSAGE,
|
|
323
|
+
role="assistant",
|
|
324
|
+
)
|
|
325
|
+
index = None
|
|
326
|
+
|
|
277
327
|
elif element.get("type") == "tool_use":
|
|
278
328
|
json_str = json.dumps(element.get("input"))
|
|
279
|
-
|
|
329
|
+
data_delta_content = DataContent(
|
|
330
|
+
index=index,
|
|
280
331
|
data=FunctionCall(
|
|
281
332
|
call_id=element.get("id"),
|
|
282
333
|
name=element.get("name"),
|
|
283
334
|
arguments=json_str,
|
|
284
335
|
).model_dump(),
|
|
285
336
|
)
|
|
286
|
-
|
|
337
|
+
plugin_call_message = Message(
|
|
287
338
|
type=MessageType.PLUGIN_CALL,
|
|
288
339
|
role="assistant",
|
|
289
|
-
|
|
290
|
-
content=[data],
|
|
340
|
+
content=[data_delta_content],
|
|
291
341
|
)
|
|
292
|
-
yield
|
|
342
|
+
yield plugin_call_message.completed()
|
|
293
343
|
elif element.get("type") == "tool_result":
|
|
294
|
-
|
|
344
|
+
data_delta_content = DataContent(
|
|
345
|
+
index=index,
|
|
295
346
|
data=FunctionCallOutput(
|
|
296
347
|
call_id=element.get("id"),
|
|
297
348
|
output=str(element.get("output")),
|
|
298
349
|
).model_dump(),
|
|
299
350
|
)
|
|
300
|
-
|
|
351
|
+
plugin_output_message = Message(
|
|
301
352
|
type=MessageType.PLUGIN_CALL_OUTPUT,
|
|
302
353
|
role="assistant",
|
|
303
|
-
|
|
304
|
-
content=[data],
|
|
354
|
+
content=[data_delta_content],
|
|
305
355
|
)
|
|
306
|
-
yield
|
|
356
|
+
yield plugin_output_message.completed()
|
|
307
357
|
else:
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
content=[
|
|
313
|
-
TextContent(text=f"{element}"),
|
|
314
|
-
],
|
|
358
|
+
text_delta_content = TextContent(
|
|
359
|
+
delta=True,
|
|
360
|
+
index=index,
|
|
361
|
+
text=f"{element}",
|
|
315
362
|
)
|
|
316
|
-
|
|
363
|
+
text_delta_content = (
|
|
364
|
+
message.add_delta_content(
|
|
365
|
+
new_content=text_delta_content,
|
|
366
|
+
)
|
|
367
|
+
)
|
|
368
|
+
index = text_delta_content.index
|
|
369
|
+
yield text_delta_content
|
|
317
370
|
|
|
318
371
|
# Break if the thread is dead and no more messages are expected
|
|
319
372
|
if not thread.is_alive() and msg_len == 0:
|
|
320
373
|
break
|
|
321
374
|
|
|
322
375
|
if last_content:
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
376
|
+
text_delta_content = TextContent(
|
|
377
|
+
delta=True,
|
|
378
|
+
index=index,
|
|
379
|
+
text=last_content,
|
|
380
|
+
)
|
|
381
|
+
text_delta_content = message.add_delta_content(
|
|
382
|
+
new_content=text_delta_content,
|
|
329
383
|
)
|
|
330
|
-
yield
|
|
384
|
+
yield text_delta_content
|
|
385
|
+
yield message.completed()
|
|
331
386
|
|
|
332
387
|
# Wait for the function to finish
|
|
333
388
|
thread.join()
|
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
""" Hooks for stream output """
|
|
3
3
|
# pylint: disable=unused-argument,too-many-nested-blocks
|
|
4
4
|
import asyncio
|
|
5
|
+
import os
|
|
5
6
|
import time
|
|
6
7
|
import threading
|
|
7
8
|
import logging
|
|
8
9
|
|
|
9
10
|
from collections import defaultdict
|
|
10
|
-
from typing import Union, Optional, Generator, Any
|
|
11
|
+
from typing import Union, Optional, Generator, Any, List
|
|
11
12
|
|
|
12
13
|
from agentscope.agent import AgentBase
|
|
13
14
|
from agentscope.message import Msg
|
|
14
15
|
|
|
15
16
|
_MSG_INSTANCE = defaultdict(list)
|
|
16
17
|
_LOCKS = defaultdict(threading.Lock)
|
|
17
|
-
TIMEOUT = 30
|
|
18
|
+
TIMEOUT = int(os.getenv("AGENTSCOPE_AGENT_TIMEOUT", "30"))
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
def run_async_in_thread(coro):
|
|
@@ -83,7 +84,19 @@ def pre_speak_msg_buffer_hook(
|
|
|
83
84
|
thread_id = threading.current_thread().name
|
|
84
85
|
if thread_id.startswith("pipeline"):
|
|
85
86
|
with _LOCKS[thread_id]:
|
|
86
|
-
|
|
87
|
+
if kwargs.get("last", True):
|
|
88
|
+
msg.is_last = True
|
|
89
|
+
_MSG_INSTANCE[thread_id].append(msg)
|
|
90
|
+
else:
|
|
91
|
+
new_blocks = []
|
|
92
|
+
if isinstance(msg.content, List):
|
|
93
|
+
for block in msg.content:
|
|
94
|
+
if block.get("type", "") != "tool_use":
|
|
95
|
+
new_blocks.append(block)
|
|
96
|
+
msg.content = new_blocks
|
|
97
|
+
if msg.content:
|
|
98
|
+
_MSG_INSTANCE[thread_id].append(msg)
|
|
99
|
+
|
|
87
100
|
return kwargs
|
|
88
101
|
|
|
89
102
|
|
|
@@ -93,6 +93,39 @@ async def simple_call_agent_tool(agent, query):
|
|
|
93
93
|
return all_result
|
|
94
94
|
|
|
95
95
|
|
|
96
|
+
async def simple_call_agent_tool_auto_lifecycle(agent, query):
|
|
97
|
+
all_result = ""
|
|
98
|
+
async with Runner(
|
|
99
|
+
agent=agent,
|
|
100
|
+
context_manager=create_context_manager(),
|
|
101
|
+
environment_manager=create_environment_manager(),
|
|
102
|
+
) as runner:
|
|
103
|
+
request = AgentRequest(
|
|
104
|
+
input=[
|
|
105
|
+
{
|
|
106
|
+
"role": "user",
|
|
107
|
+
"content": [
|
|
108
|
+
{
|
|
109
|
+
"type": "text",
|
|
110
|
+
"text": query,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
async for message in runner.stream_query(
|
|
118
|
+
request=request,
|
|
119
|
+
):
|
|
120
|
+
if (
|
|
121
|
+
message.object == "message"
|
|
122
|
+
and MessageType.MESSAGE == message.type
|
|
123
|
+
and RunStatus.Completed == message.status
|
|
124
|
+
):
|
|
125
|
+
all_result = message.content[0].text
|
|
126
|
+
return all_result
|
|
127
|
+
|
|
128
|
+
|
|
96
129
|
async def simple_call_agent_tool_wo_env(agent, query):
|
|
97
130
|
all_result = ""
|
|
98
131
|
async with create_context_manager() as context_manager:
|
{agentscope_runtime-0.1.2 → agentscope_runtime-0.1.3}/src/agentscope_runtime/engine/runner.py
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
import uuid
|
|
3
3
|
from typing import Optional, List, AsyncGenerator, Any
|
|
4
|
+
from contextlib import AsyncExitStack
|
|
4
5
|
|
|
5
6
|
from openai.types.chat import ChatCompletion
|
|
6
7
|
|
|
@@ -41,8 +42,35 @@ class Runner:
|
|
|
41
42
|
self._environment_manager = environment_manager
|
|
42
43
|
self._context_manager = context_manager
|
|
43
44
|
self._deploy_managers = {}
|
|
45
|
+
self._exit_stack = AsyncExitStack()
|
|
46
|
+
|
|
47
|
+
async def __aenter__(self) -> "Runner":
|
|
48
|
+
"""
|
|
49
|
+
Initializes the runner and ensures context/environment managers
|
|
50
|
+
are fully entered so that attributes like compose_session are
|
|
51
|
+
available.
|
|
52
|
+
"""
|
|
53
|
+
if self._environment_manager:
|
|
54
|
+
# enter_async_context returns the "real" object
|
|
55
|
+
self._environment_manager = (
|
|
56
|
+
await self._exit_stack.enter_async_context(
|
|
57
|
+
self._environment_manager,
|
|
58
|
+
)
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
if self._context_manager:
|
|
62
|
+
self._context_manager = await self._exit_stack.enter_async_context(
|
|
63
|
+
self._context_manager,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
return self
|
|
67
|
+
|
|
68
|
+
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
|
69
|
+
try:
|
|
70
|
+
await self._exit_stack.aclose()
|
|
71
|
+
except Exception:
|
|
72
|
+
pass
|
|
44
73
|
|
|
45
|
-
# TODO: should be sync method?
|
|
46
74
|
async def deploy(
|
|
47
75
|
self,
|
|
48
76
|
deploy_manager: DeployManager = LocalDeployManager(),
|
|
@@ -139,18 +167,22 @@ class Runner:
|
|
|
139
167
|
request_input=request_input,
|
|
140
168
|
)
|
|
141
169
|
|
|
170
|
+
sequence_number = 0
|
|
142
171
|
async for event in context.agent.run_async(context):
|
|
143
172
|
if (
|
|
144
173
|
event.status == RunStatus.Completed
|
|
145
174
|
and event.object == "message"
|
|
146
175
|
):
|
|
147
176
|
response.add_new_message(event)
|
|
177
|
+
event.sequence_number = sequence_number
|
|
148
178
|
yield event
|
|
179
|
+
sequence_number += 1
|
|
149
180
|
|
|
150
181
|
await context.context_manager.append(
|
|
151
182
|
session=context.session,
|
|
152
183
|
event_output=response.output,
|
|
153
184
|
)
|
|
185
|
+
response.sequence_number = sequence_number
|
|
154
186
|
yield response.completed()
|
|
155
187
|
|
|
156
188
|
@trace(TraceType.AGENT_STEP)
|