agentscope-runtime 0.1.5b2__py3-none-any.whl → 0.2.0b1__py3-none-any.whl

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 (105) hide show
  1. agentscope_runtime/common/__init__.py +0 -0
  2. agentscope_runtime/common/collections/in_memory_mapping.py +27 -0
  3. agentscope_runtime/common/collections/redis_mapping.py +42 -0
  4. agentscope_runtime/common/container_clients/__init__.py +0 -0
  5. agentscope_runtime/common/container_clients/agentrun_client.py +1098 -0
  6. agentscope_runtime/common/container_clients/docker_client.py +250 -0
  7. agentscope_runtime/engine/__init__.py +12 -0
  8. agentscope_runtime/engine/agents/agentscope_agent.py +488 -0
  9. agentscope_runtime/engine/agents/agno_agent.py +19 -18
  10. agentscope_runtime/engine/agents/autogen_agent.py +13 -8
  11. agentscope_runtime/engine/agents/utils.py +53 -0
  12. agentscope_runtime/engine/app/__init__.py +6 -0
  13. agentscope_runtime/engine/app/agent_app.py +239 -0
  14. agentscope_runtime/engine/app/base_app.py +181 -0
  15. agentscope_runtime/engine/app/celery_mixin.py +92 -0
  16. agentscope_runtime/engine/deployers/base.py +1 -0
  17. agentscope_runtime/engine/deployers/cli_fc_deploy.py +39 -20
  18. agentscope_runtime/engine/deployers/kubernetes_deployer.py +12 -5
  19. agentscope_runtime/engine/deployers/local_deployer.py +61 -3
  20. agentscope_runtime/engine/deployers/modelstudio_deployer.py +10 -11
  21. agentscope_runtime/engine/deployers/utils/docker_image_utils/runner_image_factory.py +9 -0
  22. agentscope_runtime/engine/deployers/utils/package_project_utils.py +234 -3
  23. agentscope_runtime/engine/deployers/utils/service_utils/fastapi_factory.py +567 -7
  24. agentscope_runtime/engine/deployers/utils/service_utils/standalone_main.py.j2 +211 -0
  25. agentscope_runtime/engine/deployers/utils/wheel_packager.py +1 -1
  26. agentscope_runtime/engine/helpers/helper.py +60 -41
  27. agentscope_runtime/engine/runner.py +35 -24
  28. agentscope_runtime/engine/schemas/agent_schemas.py +42 -0
  29. agentscope_runtime/engine/schemas/modelstudio_llm.py +14 -14
  30. agentscope_runtime/engine/services/sandbox_service.py +62 -70
  31. agentscope_runtime/engine/services/tablestore_memory_service.py +304 -0
  32. agentscope_runtime/engine/services/tablestore_rag_service.py +143 -0
  33. agentscope_runtime/engine/services/tablestore_session_history_service.py +293 -0
  34. agentscope_runtime/engine/services/utils/__init__.py +0 -0
  35. agentscope_runtime/engine/services/utils/tablestore_service_utils.py +352 -0
  36. agentscope_runtime/engine/tracing/__init__.py +9 -3
  37. agentscope_runtime/engine/tracing/asyncio_util.py +24 -0
  38. agentscope_runtime/engine/tracing/base.py +66 -34
  39. agentscope_runtime/engine/tracing/local_logging_handler.py +45 -31
  40. agentscope_runtime/engine/tracing/message_util.py +528 -0
  41. agentscope_runtime/engine/tracing/tracing_metric.py +20 -8
  42. agentscope_runtime/engine/tracing/tracing_util.py +130 -0
  43. agentscope_runtime/engine/tracing/wrapper.py +794 -169
  44. agentscope_runtime/sandbox/__init__.py +2 -0
  45. agentscope_runtime/sandbox/box/base/__init__.py +4 -0
  46. agentscope_runtime/sandbox/box/base/base_sandbox.py +6 -4
  47. agentscope_runtime/sandbox/box/browser/__init__.py +4 -0
  48. agentscope_runtime/sandbox/box/browser/browser_sandbox.py +10 -14
  49. agentscope_runtime/sandbox/box/dummy/__init__.py +4 -0
  50. agentscope_runtime/sandbox/box/dummy/dummy_sandbox.py +2 -1
  51. agentscope_runtime/sandbox/box/filesystem/__init__.py +4 -0
  52. agentscope_runtime/sandbox/box/filesystem/filesystem_sandbox.py +10 -7
  53. agentscope_runtime/sandbox/box/gui/__init__.py +4 -0
  54. agentscope_runtime/sandbox/box/gui/box/__init__.py +0 -0
  55. agentscope_runtime/sandbox/box/gui/gui_sandbox.py +81 -0
  56. agentscope_runtime/sandbox/box/sandbox.py +5 -2
  57. agentscope_runtime/sandbox/box/shared/routers/generic.py +20 -1
  58. agentscope_runtime/sandbox/box/training_box/__init__.py +4 -0
  59. agentscope_runtime/sandbox/box/training_box/training_box.py +10 -15
  60. agentscope_runtime/sandbox/build.py +143 -58
  61. agentscope_runtime/sandbox/client/http_client.py +87 -59
  62. agentscope_runtime/sandbox/client/training_client.py +0 -1
  63. agentscope_runtime/sandbox/constant.py +27 -1
  64. agentscope_runtime/sandbox/custom/custom_sandbox.py +7 -6
  65. agentscope_runtime/sandbox/custom/example.py +4 -3
  66. agentscope_runtime/sandbox/enums.py +1 -0
  67. agentscope_runtime/sandbox/manager/sandbox_manager.py +212 -106
  68. agentscope_runtime/sandbox/manager/server/app.py +82 -14
  69. agentscope_runtime/sandbox/manager/server/config.py +50 -3
  70. agentscope_runtime/sandbox/model/container.py +12 -23
  71. agentscope_runtime/sandbox/model/manager_config.py +93 -5
  72. agentscope_runtime/sandbox/registry.py +1 -1
  73. agentscope_runtime/sandbox/tools/gui/__init__.py +7 -0
  74. agentscope_runtime/sandbox/tools/gui/tool.py +77 -0
  75. agentscope_runtime/sandbox/tools/mcp_tool.py +6 -2
  76. agentscope_runtime/sandbox/tools/tool.py +4 -0
  77. agentscope_runtime/sandbox/utils.py +124 -0
  78. agentscope_runtime/version.py +1 -1
  79. {agentscope_runtime-0.1.5b2.dist-info → agentscope_runtime-0.2.0b1.dist-info}/METADATA +209 -101
  80. {agentscope_runtime-0.1.5b2.dist-info → agentscope_runtime-0.2.0b1.dist-info}/RECORD +94 -78
  81. agentscope_runtime/engine/agents/agentscope_agent/__init__.py +0 -6
  82. agentscope_runtime/engine/agents/agentscope_agent/agent.py +0 -401
  83. agentscope_runtime/engine/agents/agentscope_agent/hooks.py +0 -169
  84. agentscope_runtime/engine/agents/llm_agent.py +0 -51
  85. agentscope_runtime/engine/llms/__init__.py +0 -3
  86. agentscope_runtime/engine/llms/base_llm.py +0 -60
  87. agentscope_runtime/engine/llms/qwen_llm.py +0 -47
  88. agentscope_runtime/sandbox/manager/collections/in_memory_mapping.py +0 -22
  89. agentscope_runtime/sandbox/manager/collections/redis_mapping.py +0 -26
  90. agentscope_runtime/sandbox/manager/container_clients/__init__.py +0 -10
  91. agentscope_runtime/sandbox/manager/container_clients/docker_client.py +0 -422
  92. /agentscope_runtime/{sandbox/manager → common}/collections/__init__.py +0 -0
  93. /agentscope_runtime/{sandbox/manager → common}/collections/base_mapping.py +0 -0
  94. /agentscope_runtime/{sandbox/manager → common}/collections/base_queue.py +0 -0
  95. /agentscope_runtime/{sandbox/manager → common}/collections/base_set.py +0 -0
  96. /agentscope_runtime/{sandbox/manager → common}/collections/in_memory_queue.py +0 -0
  97. /agentscope_runtime/{sandbox/manager → common}/collections/in_memory_set.py +0 -0
  98. /agentscope_runtime/{sandbox/manager → common}/collections/redis_queue.py +0 -0
  99. /agentscope_runtime/{sandbox/manager → common}/collections/redis_set.py +0 -0
  100. /agentscope_runtime/{sandbox/manager → common}/container_clients/base_client.py +0 -0
  101. /agentscope_runtime/{sandbox/manager → common}/container_clients/kubernetes_client.py +0 -0
  102. {agentscope_runtime-0.1.5b2.dist-info → agentscope_runtime-0.2.0b1.dist-info}/WHEEL +0 -0
  103. {agentscope_runtime-0.1.5b2.dist-info → agentscope_runtime-0.2.0b1.dist-info}/entry_points.txt +0 -0
  104. {agentscope_runtime-0.1.5b2.dist-info → agentscope_runtime-0.2.0b1.dist-info}/licenses/LICENSE +0 -0
  105. {agentscope_runtime-0.1.5b2.dist-info → agentscope_runtime-0.2.0b1.dist-info}/top_level.txt +0 -0
File without changes
@@ -0,0 +1,27 @@
1
+ # -*- coding: utf-8 -*-
2
+ from typing import Any
3
+
4
+ from .base_mapping import Mapping
5
+
6
+
7
+ class InMemoryMapping(Mapping):
8
+ def __init__(self):
9
+ self.store = {}
10
+
11
+ def set(self, key: str, value: Any):
12
+ self.store[key] = value
13
+
14
+ def get(self, key: str) -> Any:
15
+ return self.store.get(key)
16
+
17
+ def delete(self, key: str):
18
+ if key in self.store:
19
+ del self.store[key]
20
+
21
+ def scan(self, prefix: str = None):
22
+ if prefix is None:
23
+ yield from list(self.store.keys())
24
+ else:
25
+ yield from list(
26
+ key for key in self.store if key.startswith(prefix)
27
+ )
@@ -0,0 +1,42 @@
1
+ # -*- coding: utf-8 -*-
2
+ import json
3
+
4
+ from typing import Any
5
+
6
+ from .base_mapping import Mapping
7
+
8
+
9
+ class RedisMapping(Mapping):
10
+ def __init__(self, redis_client, prefix: str = ""):
11
+ self.client = redis_client
12
+ self.prefix = prefix.rstrip(":") + ":" if prefix else ""
13
+
14
+ def _get_full_key(self, key: str) -> str:
15
+ return f"{self.prefix}{key}"
16
+
17
+ def _strip_prefix(self, full_key: str) -> str:
18
+ if self.prefix and full_key.startswith(self.prefix):
19
+ return full_key[len(self.prefix) :]
20
+ return full_key
21
+
22
+ def set(self, key: str, value: Any):
23
+ self.client.set(self._get_full_key(key), json.dumps(value))
24
+
25
+ def get(self, key: str) -> Any:
26
+ value = self.client.get(self._get_full_key(key))
27
+ return json.loads(value) if value else None
28
+
29
+ def delete(self, key: str):
30
+ self.client.delete(self._get_full_key(key))
31
+
32
+ def scan(self, prefix: str = ""):
33
+ search_pattern = f"{self._get_full_key(prefix)}*"
34
+ cursor = 0
35
+ while cursor != 0:
36
+ cursor, keys = self.client.scan(
37
+ cursor=cursor,
38
+ match=search_pattern,
39
+ )
40
+ for key in keys:
41
+ decoded_key = key.decode("utf-8")
42
+ yield self._strip_prefix(decoded_key)