gatewaysdk 0.3.2__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 (376) hide show
  1. gatewaysdk/__init__.py +540 -0
  2. gatewaysdk/adapter/__init__.py +15 -0
  3. gatewaysdk/adapter/base.py +94 -0
  4. gatewaysdk/adapter/messages.py +270 -0
  5. gatewaysdk/adapter/triplet.py +1026 -0
  6. gatewaysdk/algorithm/__init__.py +39 -0
  7. gatewaysdk/algorithm/apo/__init__.py +5 -0
  8. gatewaysdk/algorithm/apo/apo.py +898 -0
  9. gatewaysdk/algorithm/apo/prompts/apply_edit_variant01.poml +22 -0
  10. gatewaysdk/algorithm/apo/prompts/apply_edit_variant02.poml +18 -0
  11. gatewaysdk/algorithm/apo/prompts/text_gradient_variant01.poml +18 -0
  12. gatewaysdk/algorithm/apo/prompts/text_gradient_variant02.poml +16 -0
  13. gatewaysdk/algorithm/apo/prompts/text_gradient_variant03.poml +107 -0
  14. gatewaysdk/algorithm/base.py +262 -0
  15. gatewaysdk/algorithm/decorator.py +264 -0
  16. gatewaysdk/algorithm/evals/__init__.py +7 -0
  17. gatewaysdk/algorithm/evals/evals.py +217 -0
  18. gatewaysdk/algorithm/fast.py +250 -0
  19. gatewaysdk/algorithm/gepa/__init__.py +61 -0
  20. gatewaysdk/algorithm/gepa/adapter.py +495 -0
  21. gatewaysdk/algorithm/gepa/gepa.py +570 -0
  22. gatewaysdk/algorithm/gepa/lib/__init__.py +18 -0
  23. gatewaysdk/algorithm/gepa/lib/adapters/README.md +12 -0
  24. gatewaysdk/algorithm/gepa/lib/adapters/__init__.py +0 -0
  25. gatewaysdk/algorithm/gepa/lib/adapters/anymaths_adapter/README.md +341 -0
  26. gatewaysdk/algorithm/gepa/lib/adapters/anymaths_adapter/__init__.py +1 -0
  27. gatewaysdk/algorithm/gepa/lib/adapters/anymaths_adapter/anymaths_adapter.py +174 -0
  28. gatewaysdk/algorithm/gepa/lib/adapters/anymaths_adapter/requirements.txt +1 -0
  29. gatewaysdk/algorithm/gepa/lib/adapters/default_adapter/README.md +0 -0
  30. gatewaysdk/algorithm/gepa/lib/adapters/default_adapter/__init__.py +0 -0
  31. gatewaysdk/algorithm/gepa/lib/adapters/default_adapter/default_adapter.py +209 -0
  32. gatewaysdk/algorithm/gepa/lib/adapters/dspy_adapter/README.md +7 -0
  33. gatewaysdk/algorithm/gepa/lib/adapters/dspy_adapter/__init__.py +0 -0
  34. gatewaysdk/algorithm/gepa/lib/adapters/dspy_adapter/dspy_adapter.py +307 -0
  35. gatewaysdk/algorithm/gepa/lib/adapters/dspy_full_program_adapter/README.md +99 -0
  36. gatewaysdk/algorithm/gepa/lib/adapters/dspy_full_program_adapter/dspy_program_proposal_signature.py +137 -0
  37. gatewaysdk/algorithm/gepa/lib/adapters/dspy_full_program_adapter/full_program_adapter.py +268 -0
  38. gatewaysdk/algorithm/gepa/lib/adapters/generic_rag_adapter/GEPA_RAG.md +621 -0
  39. gatewaysdk/algorithm/gepa/lib/adapters/generic_rag_adapter/__init__.py +56 -0
  40. gatewaysdk/algorithm/gepa/lib/adapters/generic_rag_adapter/evaluation_metrics.py +226 -0
  41. gatewaysdk/algorithm/gepa/lib/adapters/generic_rag_adapter/generic_rag_adapter.py +496 -0
  42. gatewaysdk/algorithm/gepa/lib/adapters/generic_rag_adapter/rag_pipeline.py +238 -0
  43. gatewaysdk/algorithm/gepa/lib/adapters/generic_rag_adapter/vector_store_interface.py +212 -0
  44. gatewaysdk/algorithm/gepa/lib/adapters/generic_rag_adapter/vector_stores/__init__.py +2 -0
  45. gatewaysdk/algorithm/gepa/lib/adapters/generic_rag_adapter/vector_stores/chroma_store.py +196 -0
  46. gatewaysdk/algorithm/gepa/lib/adapters/generic_rag_adapter/vector_stores/lancedb_store.py +422 -0
  47. gatewaysdk/algorithm/gepa/lib/adapters/generic_rag_adapter/vector_stores/milvus_store.py +409 -0
  48. gatewaysdk/algorithm/gepa/lib/adapters/generic_rag_adapter/vector_stores/qdrant_store.py +368 -0
  49. gatewaysdk/algorithm/gepa/lib/adapters/generic_rag_adapter/vector_stores/weaviate_store.py +418 -0
  50. gatewaysdk/algorithm/gepa/lib/adapters/mcp_adapter/README.md +552 -0
  51. gatewaysdk/algorithm/gepa/lib/adapters/mcp_adapter/__init__.py +37 -0
  52. gatewaysdk/algorithm/gepa/lib/adapters/mcp_adapter/mcp_adapter.py +699 -0
  53. gatewaysdk/algorithm/gepa/lib/adapters/mcp_adapter/mcp_client.py +364 -0
  54. gatewaysdk/algorithm/gepa/lib/adapters/terminal_bench_adapter/README.md +9 -0
  55. gatewaysdk/algorithm/gepa/lib/adapters/terminal_bench_adapter/__init__.py +0 -0
  56. gatewaysdk/algorithm/gepa/lib/adapters/terminal_bench_adapter/terminal_bench_adapter.py +217 -0
  57. gatewaysdk/algorithm/gepa/lib/api.py +382 -0
  58. gatewaysdk/algorithm/gepa/lib/core/__init__.py +0 -0
  59. gatewaysdk/algorithm/gepa/lib/core/adapter.py +180 -0
  60. gatewaysdk/algorithm/gepa/lib/core/data_loader.py +74 -0
  61. gatewaysdk/algorithm/gepa/lib/core/engine.py +379 -0
  62. gatewaysdk/algorithm/gepa/lib/core/result.py +233 -0
  63. gatewaysdk/algorithm/gepa/lib/core/state.py +636 -0
  64. gatewaysdk/algorithm/gepa/lib/examples/__init__.py +0 -0
  65. gatewaysdk/algorithm/gepa/lib/examples/aime.py +24 -0
  66. gatewaysdk/algorithm/gepa/lib/examples/anymaths-bench/eval_default.py +111 -0
  67. gatewaysdk/algorithm/gepa/lib/examples/anymaths-bench/prompt-templates/instruction_prompt.txt +9 -0
  68. gatewaysdk/algorithm/gepa/lib/examples/anymaths-bench/prompt-templates/optimal_prompt.txt +24 -0
  69. gatewaysdk/algorithm/gepa/lib/examples/anymaths-bench/train_anymaths.py +177 -0
  70. gatewaysdk/algorithm/gepa/lib/examples/dspy_full_program_evolution/arc_agi.ipynb +25705 -0
  71. gatewaysdk/algorithm/gepa/lib/examples/dspy_full_program_evolution/example.ipynb +348 -0
  72. gatewaysdk/algorithm/gepa/lib/examples/mcp_adapter/__init__.py +4 -0
  73. gatewaysdk/algorithm/gepa/lib/examples/mcp_adapter/mcp_optimization_example.py +456 -0
  74. gatewaysdk/algorithm/gepa/lib/examples/rag_adapter/RAG_GUIDE.md +613 -0
  75. gatewaysdk/algorithm/gepa/lib/examples/rag_adapter/__init__.py +9 -0
  76. gatewaysdk/algorithm/gepa/lib/examples/rag_adapter/rag_optimization.py +820 -0
  77. gatewaysdk/algorithm/gepa/lib/examples/rag_adapter/requirements-rag.txt +29 -0
  78. gatewaysdk/algorithm/gepa/lib/examples/terminal-bench/prompt-templates/instruction_prompt.txt +16 -0
  79. gatewaysdk/algorithm/gepa/lib/examples/terminal-bench/prompt-templates/terminus.txt +9 -0
  80. gatewaysdk/algorithm/gepa/lib/examples/terminal-bench/train_terminus.py +161 -0
  81. gatewaysdk/algorithm/gepa/lib/gepa_utils.py +117 -0
  82. gatewaysdk/algorithm/gepa/lib/logging/__init__.py +0 -0
  83. gatewaysdk/algorithm/gepa/lib/logging/experiment_tracker.py +187 -0
  84. gatewaysdk/algorithm/gepa/lib/logging/logger.py +75 -0
  85. gatewaysdk/algorithm/gepa/lib/logging/utils.py +103 -0
  86. gatewaysdk/algorithm/gepa/lib/proposer/__init__.py +0 -0
  87. gatewaysdk/algorithm/gepa/lib/proposer/base.py +31 -0
  88. gatewaysdk/algorithm/gepa/lib/proposer/merge.py +357 -0
  89. gatewaysdk/algorithm/gepa/lib/proposer/reflective_mutation/__init__.py +0 -0
  90. gatewaysdk/algorithm/gepa/lib/proposer/reflective_mutation/base.py +49 -0
  91. gatewaysdk/algorithm/gepa/lib/proposer/reflective_mutation/reflective_mutation.py +176 -0
  92. gatewaysdk/algorithm/gepa/lib/py.typed +0 -0
  93. gatewaysdk/algorithm/gepa/lib/strategies/__init__.py +0 -0
  94. gatewaysdk/algorithm/gepa/lib/strategies/batch_sampler.py +77 -0
  95. gatewaysdk/algorithm/gepa/lib/strategies/candidate_selector.py +50 -0
  96. gatewaysdk/algorithm/gepa/lib/strategies/component_selector.py +36 -0
  97. gatewaysdk/algorithm/gepa/lib/strategies/eval_policy.py +64 -0
  98. gatewaysdk/algorithm/gepa/lib/strategies/instruction_proposal.py +126 -0
  99. gatewaysdk/algorithm/gepa/lib/utils/__init__.py +10 -0
  100. gatewaysdk/algorithm/gepa/lib/utils/stop_condition.py +196 -0
  101. gatewaysdk/algorithm/gepa/tracing.py +105 -0
  102. gatewaysdk/algorithm/utils.py +177 -0
  103. gatewaysdk/algorithm/verl/__init__.py +5 -0
  104. gatewaysdk/algorithm/verl/interface.py +202 -0
  105. gatewaysdk/automations.py +111 -0
  106. gatewaysdk/benchmark_hub/README.md +88 -0
  107. gatewaysdk/benchmark_hub/__init__.py +119 -0
  108. gatewaysdk/benchmark_hub/_archive.py +189 -0
  109. gatewaysdk/benchmark_hub/_tar.py +6 -0
  110. gatewaysdk/benchmark_hub/client.py +992 -0
  111. gatewaysdk/benchmark_hub/dispatch_shard.py +34 -0
  112. gatewaysdk/benchmark_hub/eval_config.py +20 -0
  113. gatewaysdk/benchmark_hub/evals.py +351 -0
  114. gatewaysdk/benchmark_hub/harbor_adapter.py +673 -0
  115. gatewaysdk/benchmark_hub/path_utils.py +81 -0
  116. gatewaysdk/benchmark_hub/save_utils.py +101 -0
  117. gatewaysdk/benchmark_hub/verifiers_adapter.py +327 -0
  118. gatewaysdk/benchmark_hub/versioning.py +72 -0
  119. gatewaysdk/build.py +515 -0
  120. gatewaysdk/cli/__init__.py +58 -0
  121. gatewaysdk/cli/agent_runner.py +132 -0
  122. gatewaysdk/cli/http_client.py +115 -0
  123. gatewaysdk/cli/platform.py +4086 -0
  124. gatewaysdk/cli/prometheus.py +115 -0
  125. gatewaysdk/cli/release_gate.py +215 -0
  126. gatewaysdk/cli/store.py +131 -0
  127. gatewaysdk/cli/vllm.py +29 -0
  128. gatewaysdk/client.py +406 -0
  129. gatewaysdk/config.py +348 -0
  130. gatewaysdk/connectors/__init__.py +25 -0
  131. gatewaysdk/connectors/client.py +203 -0
  132. gatewaysdk/connectors/skill.py +25 -0
  133. gatewaysdk/connectors/template.py +106 -0
  134. gatewaysdk/context.py +606 -0
  135. gatewaysdk/emitter/__init__.py +43 -0
  136. gatewaysdk/emitter/annotation.py +370 -0
  137. gatewaysdk/emitter/exception.py +54 -0
  138. gatewaysdk/emitter/message.py +61 -0
  139. gatewaysdk/emitter/object.py +117 -0
  140. gatewaysdk/emitter/reward.py +320 -0
  141. gatewaysdk/env_var.py +156 -0
  142. gatewaysdk/environment/__init__.py +108 -0
  143. gatewaysdk/environment/_bundle.py +281 -0
  144. gatewaysdk/environment/_harbor.py +276 -0
  145. gatewaysdk/environment/_materialize.py +97 -0
  146. gatewaysdk/environment/_tar.py +33 -0
  147. gatewaysdk/environment/_world.py +346 -0
  148. gatewaysdk/environment/core.py +527 -0
  149. gatewaysdk/environment/errors.py +58 -0
  150. gatewaysdk/environment/runtime.py +150 -0
  151. gatewaysdk/environment/schema/__init__.py +35 -0
  152. gatewaysdk/environment/schema/__main__.py +225 -0
  153. gatewaysdk/environment/schema/_slack_fidelity.py +116 -0
  154. gatewaysdk/environment/schema/_slack_scenario.py +183 -0
  155. gatewaysdk/environment/schema/api.py +1628 -0
  156. gatewaysdk/environment/schema/batch.py +755 -0
  157. gatewaysdk/environment/schema/compiler.py +615 -0
  158. gatewaysdk/environment/schema/conform.py +428 -0
  159. gatewaysdk/environment/schema/connector.py +777 -0
  160. gatewaysdk/environment/schema/connectors/apple-business-manager/handlers.py +17 -0
  161. gatewaysdk/environment/schema/connectors/apple-business-manager/parity.json +28 -0
  162. gatewaysdk/environment/schema/connectors/apple-business-manager/provenance.json +233 -0
  163. gatewaysdk/environment/schema/connectors/apple-business-manager/scope.toml +112 -0
  164. gatewaysdk/environment/schema/connectors/apple-business-manager/world.json +1380 -0
  165. gatewaysdk/environment/schema/connectors/base.json +28 -0
  166. gatewaysdk/environment/schema/connectors/custom/handlers.py +18 -0
  167. gatewaysdk/environment/schema/connectors/custom/world.json +123 -0
  168. gatewaysdk/environment/schema/connectors/github/handlers.py +81 -0
  169. gatewaysdk/environment/schema/connectors/github/parity.json +37 -0
  170. gatewaysdk/environment/schema/connectors/github/provenance.json +134 -0
  171. gatewaysdk/environment/schema/connectors/github/scope.toml +158 -0
  172. gatewaysdk/environment/schema/connectors/github/world.json +5869 -0
  173. gatewaysdk/environment/schema/connectors/google-calendar/handlers.py +23 -0
  174. gatewaysdk/environment/schema/connectors/google-calendar/world.json +209 -0
  175. gatewaysdk/environment/schema/connectors/google-drive/handlers.py +18 -0
  176. gatewaysdk/environment/schema/connectors/google-drive/world.json +286 -0
  177. gatewaysdk/environment/schema/connectors/jamf/handlers.py +34 -0
  178. gatewaysdk/environment/schema/connectors/jamf/parity.json +49 -0
  179. gatewaysdk/environment/schema/connectors/jamf/provenance.json +181 -0
  180. gatewaysdk/environment/schema/connectors/jamf/scope.toml +128 -0
  181. gatewaysdk/environment/schema/connectors/jamf/world.json +2218 -0
  182. gatewaysdk/environment/schema/connectors/jira/handlers.py +28 -0
  183. gatewaysdk/environment/schema/connectors/jira/world.json +389 -0
  184. gatewaysdk/environment/schema/connectors/kandji/handlers.py +38 -0
  185. gatewaysdk/environment/schema/connectors/kandji/parity.json +29 -0
  186. gatewaysdk/environment/schema/connectors/kandji/provenance.json +152 -0
  187. gatewaysdk/environment/schema/connectors/kandji/scope.toml +120 -0
  188. gatewaysdk/environment/schema/connectors/kandji/world.json +765 -0
  189. gatewaysdk/environment/schema/connectors/linear/handlers.py +20 -0
  190. gatewaysdk/environment/schema/connectors/linear/world.json +363 -0
  191. gatewaysdk/environment/schema/connectors/microsoft-teams/fidelity.json +45 -0
  192. gatewaysdk/environment/schema/connectors/microsoft-teams/handlers.py +1 -0
  193. gatewaysdk/environment/schema/connectors/microsoft-teams/provenance.json +851 -0
  194. gatewaysdk/environment/schema/connectors/microsoft-teams/scope.md +231 -0
  195. gatewaysdk/environment/schema/connectors/microsoft-teams/teams-types.json +1710 -0
  196. gatewaysdk/environment/schema/connectors/microsoft-teams/world.json +858 -0
  197. gatewaysdk/environment/schema/connectors/netsuite/handlers.py +32 -0
  198. gatewaysdk/environment/schema/connectors/netsuite/parity.json +50 -0
  199. gatewaysdk/environment/schema/connectors/netsuite/provenance.json +137 -0
  200. gatewaysdk/environment/schema/connectors/netsuite/scope.toml +78 -0
  201. gatewaysdk/environment/schema/connectors/netsuite/world.json +16243 -0
  202. gatewaysdk/environment/schema/connectors/salesforce/handlers.py +806 -0
  203. gatewaysdk/environment/schema/connectors/salesforce/parity.json +46 -0
  204. gatewaysdk/environment/schema/connectors/salesforce/provenance.json +143 -0
  205. gatewaysdk/environment/schema/connectors/salesforce/scope.toml +174 -0
  206. gatewaysdk/environment/schema/connectors/salesforce/world.json +4695 -0
  207. gatewaysdk/environment/schema/connectors/slack/MODEL.md +236 -0
  208. gatewaysdk/environment/schema/connectors/slack/capabilities.json +1039 -0
  209. gatewaysdk/environment/schema/connectors/slack/handlers.py +762 -0
  210. gatewaysdk/environment/schema/connectors/slack/parity.json +65 -0
  211. gatewaysdk/environment/schema/connectors/slack/provenance.json +294 -0
  212. gatewaysdk/environment/schema/connectors/slack/scope.toml +44 -0
  213. gatewaysdk/environment/schema/connectors/slack/world.json +4993 -0
  214. gatewaysdk/environment/schema/connectors/workday/handlers.py +75 -0
  215. gatewaysdk/environment/schema/connectors/workday/parity.json +36 -0
  216. gatewaysdk/environment/schema/connectors/workday/provenance.json +179 -0
  217. gatewaysdk/environment/schema/connectors/workday/scope.toml +180 -0
  218. gatewaysdk/environment/schema/connectors/workday/world.json +806 -0
  219. gatewaysdk/environment/schema/data.py +593 -0
  220. gatewaysdk/environment/schema/extract.py +263 -0
  221. gatewaysdk/environment/schema/host.py +2437 -0
  222. gatewaysdk/environment/schema/host_surfaces.py +275 -0
  223. gatewaysdk/environment/schema/platform.py +1272 -0
  224. gatewaysdk/environment/schema/scaffold.py +250 -0
  225. gatewaysdk/environment/schema/skill.py +118 -0
  226. gatewaysdk/environment/schema/skills/agents/connector-template-author.md +202 -0
  227. gatewaysdk/environment/schema/skills/connector-schema-authoring/CONNECTORS.md +331 -0
  228. gatewaysdk/environment/schema/skills/connector-schema-authoring/CONVENTIONS.md +100 -0
  229. gatewaysdk/environment/schema/skills/connector-schema-authoring/SKILL.md +313 -0
  230. gatewaysdk/environment/schema/skills/world-data-ingestion/ROWS.md +223 -0
  231. gatewaysdk/environment/schema/skills/world-data-ingestion/SKILL.md +293 -0
  232. gatewaysdk/environment/schema/skills/worlds-getting-started/SKILL.md +390 -0
  233. gatewaysdk/environment/schema/slack.py +757 -0
  234. gatewaysdk/environment/schema/snapshot.py +479 -0
  235. gatewaysdk/environment/schema/store.py +904 -0
  236. gatewaysdk/environment/schema/tasks.py +525 -0
  237. gatewaysdk/environment/schema/tools_world.py +322 -0
  238. gatewaysdk/environment/schema/validation.py +577 -0
  239. gatewaysdk/environment/schema/worker.py +78 -0
  240. gatewaysdk/environment/schema/workers.py +500 -0
  241. gatewaysdk/environment/schema/world_tests.py +336 -0
  242. gatewaysdk/environments/__init__.py +24 -0
  243. gatewaysdk/environments/client.py +486 -0
  244. gatewaysdk/environments/types.py +318 -0
  245. gatewaysdk/execution/__init__.py +15 -0
  246. gatewaysdk/execution/base.py +64 -0
  247. gatewaysdk/execution/client_server.py +443 -0
  248. gatewaysdk/execution/events.py +69 -0
  249. gatewaysdk/execution/inter_process.py +16 -0
  250. gatewaysdk/execution/shared_memory.py +282 -0
  251. gatewaysdk/experiments/__init__.py +90 -0
  252. gatewaysdk/experiments/assignment.py +177 -0
  253. gatewaysdk/experiments/client.py +877 -0
  254. gatewaysdk/experiments/exposure.py +222 -0
  255. gatewaysdk/experiments/types.py +81 -0
  256. gatewaysdk/importers/__init__.py +49 -0
  257. gatewaysdk/importers/_normalize.py +91 -0
  258. gatewaysdk/importers/builder.py +173 -0
  259. gatewaysdk/importers/client.py +95 -0
  260. gatewaysdk/importers/langsmith.py +196 -0
  261. gatewaysdk/importers/recipes.py +249 -0
  262. gatewaysdk/instrumentation/__init__.py +300 -0
  263. gatewaysdk/instrumentation/agentops.py +314 -0
  264. gatewaysdk/instrumentation/agentops_langchain.py +45 -0
  265. gatewaysdk/instrumentation/base.py +119 -0
  266. gatewaysdk/instrumentation/litellm.py +83 -0
  267. gatewaysdk/instrumentation/registry.py +273 -0
  268. gatewaysdk/instrumentation/vllm.py +81 -0
  269. gatewaysdk/instrumentation/weave.py +500 -0
  270. gatewaysdk/integrations/__init__.py +15 -0
  271. gatewaysdk/integrations/gateway/__init__.py +11 -0
  272. gatewaysdk/integrations/gateway/client.py +171 -0
  273. gatewaysdk/integrations/tool_access.py +549 -0
  274. gatewaysdk/litagent/__init__.py +11 -0
  275. gatewaysdk/litagent/decorator.py +536 -0
  276. gatewaysdk/litagent/litagent.py +252 -0
  277. gatewaysdk/llm_proxy.py +1742 -0
  278. gatewaysdk/logging.py +370 -0
  279. gatewaysdk/memory.py +278 -0
  280. gatewaysdk/personas.py +186 -0
  281. gatewaysdk/platform/__init__.py +17 -0
  282. gatewaysdk/platform/builder.py +221 -0
  283. gatewaysdk/platform/compatibility.py +67 -0
  284. gatewaysdk/platform/manifest.py +185 -0
  285. gatewaysdk/platform/orchestrator.py +901 -0
  286. gatewaysdk/platform/registry.py +122 -0
  287. gatewaysdk/platform/worker.py +864 -0
  288. gatewaysdk/replay/__init__.py +1032 -0
  289. gatewaysdk/replay/pytest.py +56 -0
  290. gatewaysdk/reward.py +7 -0
  291. gatewaysdk/run.py +1781 -0
  292. gatewaysdk/runner/__init__.py +11 -0
  293. gatewaysdk/runner/agent.py +878 -0
  294. gatewaysdk/runner/base.py +182 -0
  295. gatewaysdk/runner/legacy.py +309 -0
  296. gatewaysdk/security.py +700 -0
  297. gatewaysdk/semconv.py +170 -0
  298. gatewaysdk/server.py +399 -0
  299. gatewaysdk/sessions.py +282 -0
  300. gatewaysdk/store/__init__.py +45 -0
  301. gatewaysdk/store/base.py +908 -0
  302. gatewaysdk/store/client_server.py +2093 -0
  303. gatewaysdk/store/collection/__init__.py +30 -0
  304. gatewaysdk/store/collection/base.py +587 -0
  305. gatewaysdk/store/collection/memory.py +970 -0
  306. gatewaysdk/store/collection/mongo.py +1412 -0
  307. gatewaysdk/store/collection_based.py +1823 -0
  308. gatewaysdk/store/gateway.py +983 -0
  309. gatewaysdk/store/gateway_listener.py +465 -0
  310. gatewaysdk/store/listener.py +58 -0
  311. gatewaysdk/store/memory.py +396 -0
  312. gatewaysdk/store/mongo.py +165 -0
  313. gatewaysdk/store/redis_stream.py +517 -0
  314. gatewaysdk/store/sqlite.py +3 -0
  315. gatewaysdk/store/threading.py +370 -0
  316. gatewaysdk/store/utils.py +142 -0
  317. gatewaysdk/tracer/__init__.py +14 -0
  318. gatewaysdk/tracer/base.py +286 -0
  319. gatewaysdk/tracer/dummy.py +106 -0
  320. gatewaysdk/tracer/otel.py +559 -0
  321. gatewaysdk/tracing/__init__.py +110 -0
  322. gatewaysdk/tracing/api.py +808 -0
  323. gatewaysdk/tracing/attributes.py +9 -0
  324. gatewaysdk/tracing/context.py +272 -0
  325. gatewaysdk/tracing/exporters/__init__.py +10 -0
  326. gatewaysdk/tracing/exporters/gateway.py +228 -0
  327. gatewaysdk/tracing/identity.py +288 -0
  328. gatewaysdk/tracing/init.py +620 -0
  329. gatewaysdk/tracing/instrumentors/__init__.py +15 -0
  330. gatewaysdk/tracing/instrumentors/claude_agent_sdk.py +766 -0
  331. gatewaysdk/tracing/instrumentors/instrumentation_principles.md +294 -0
  332. gatewaysdk/tracing/instrumentors/registry.py +352 -0
  333. gatewaysdk/tracing/mapping.py +729 -0
  334. gatewaysdk/tracing/processors.py +393 -0
  335. gatewaysdk/tracing/push.py +617 -0
  336. gatewaysdk/tracing/push_models.py +247 -0
  337. gatewaysdk/tracing/semconv.py +294 -0
  338. gatewaysdk/tracing/span_builder.py +356 -0
  339. gatewaysdk/trainer/__init__.py +6 -0
  340. gatewaysdk/trainer/init_utils.py +263 -0
  341. gatewaysdk/trainer/legacy.py +359 -0
  342. gatewaysdk/trainer/registry.py +12 -0
  343. gatewaysdk/trainer/trainer.py +638 -0
  344. gatewaysdk/types/__init__.py +63 -0
  345. gatewaysdk/types/core.py +556 -0
  346. gatewaysdk/types/resources.py +204 -0
  347. gatewaysdk/types/tracer.py +515 -0
  348. gatewaysdk/types/tracing.py +162 -0
  349. gatewaysdk/users.py +251 -0
  350. gatewaysdk/utils/__init__.py +1 -0
  351. gatewaysdk/utils/id.py +18 -0
  352. gatewaysdk/utils/metrics.py +1025 -0
  353. gatewaysdk/utils/otel.py +550 -0
  354. gatewaysdk/utils/otlp.py +556 -0
  355. gatewaysdk/utils/redact.py +22 -0
  356. gatewaysdk/utils/server_launcher.py +1045 -0
  357. gatewaysdk/utils/system_snapshot.py +90 -0
  358. gatewaysdk/verl/__init__.py +8 -0
  359. gatewaysdk/verl/__main__.py +6 -0
  360. gatewaysdk/verl/async_server.py +46 -0
  361. gatewaysdk/verl/config.yaml +27 -0
  362. gatewaysdk/verl/daemon.py +1154 -0
  363. gatewaysdk/verl/dataset.py +44 -0
  364. gatewaysdk/verl/entrypoint.py +248 -0
  365. gatewaysdk/verl/trainer.py +549 -0
  366. gatewaysdk/world_browser.py +748 -0
  367. gatewaysdk/world_data.py +453 -0
  368. gatewaysdk/world_sessions.py +978 -0
  369. gatewaysdk/world_tasks.py +285 -0
  370. gatewaysdk/world_tools.py +115 -0
  371. gatewaysdk/worlds.py +639 -0
  372. gatewaysdk-0.3.2.dist-info/METADATA +236 -0
  373. gatewaysdk-0.3.2.dist-info/RECORD +376 -0
  374. gatewaysdk-0.3.2.dist-info/WHEEL +4 -0
  375. gatewaysdk-0.3.2.dist-info/entry_points.txt +5 -0
  376. gatewaysdk-0.3.2.dist-info/licenses/LICENSE +19 -0
@@ -0,0 +1,517 @@
1
+ # Copyright (c) Gateway. All rights reserved.
2
+
3
+ """RedisStreamLightningStore — distributed rollout coordination via Redis Streams.
4
+
5
+ This store wraps InMemoryLightningStore for all metadata (rollouts, attempts,
6
+ spans, resources) and replaces only the rollout queue with Redis Streams.
7
+
8
+ Redis Stream protocol:
9
+ - Stream key: ``gateway:run:{run_id}:rollouts``
10
+ - Consumer group: ``gateway-runners``
11
+ - Enqueue: ``XADD`` with rollout_id, input_json, resources_id, mode
12
+ - Dequeue: ``XREADGROUP GROUP gateway-runners {worker_id} COUNT 1 BLOCK {timeout_ms}``
13
+ - Ack: ``XACK`` after rollout reaches terminal status
14
+
15
+ Usage::
16
+
17
+ store = RedisStreamLightningStore(
18
+ redis_url="redis://:myredissecret@localhost:6379",
19
+ run_id="run-abc123",
20
+ )
21
+ await store.initialize()
22
+
23
+ # Enqueue rollouts (algorithm side)
24
+ rollout = await store.enqueue_rollout(input={"task": "solve"})
25
+
26
+ # Dequeue rollouts (runner side)
27
+ attempted = await store.dequeue_rollout(worker_id="runner-1")
28
+
29
+ await store.close()
30
+ """
31
+
32
+ from __future__ import annotations
33
+
34
+ import json
35
+ import logging
36
+ import time
37
+ from typing import Any, Dict, List, Optional, Sequence
38
+
39
+ from gatewaysdk.store.base import (
40
+ UNSET,
41
+ LightningStore,
42
+ LightningStoreCapabilities,
43
+ LightningStoreStatistics,
44
+ Unset,
45
+ )
46
+ from gatewaysdk.store.memory import InMemoryLightningStore
47
+ from gatewaysdk.types import (
48
+ Attempt,
49
+ AttemptedRollout,
50
+ AttemptStatus,
51
+ EnqueueRolloutRequest,
52
+ NamedResources,
53
+ PaginatedResult,
54
+ ResourcesUpdate,
55
+ Rollout,
56
+ RolloutConfig,
57
+ RolloutMode,
58
+ RolloutStatus,
59
+ Span,
60
+ TaskInput,
61
+ Worker,
62
+ WorkerStatus,
63
+ )
64
+ from gatewaysdk.utils.redact import redact_url
65
+
66
+ try:
67
+ import redis.asyncio as aioredis
68
+ except ImportError:
69
+ aioredis = None # type: ignore[assignment]
70
+
71
+ logger = logging.getLogger(__name__)
72
+
73
+
74
+ class RedisStreamLightningStore(LightningStore):
75
+ """DEPRECATED: Use LightningStoreServer + LightningStoreClient instead.
76
+
77
+ This store wraps InMemoryLightningStore with Redis Streams for distributed
78
+ rollout coordination. It has been superseded by the StoreServer/Client
79
+ architecture which avoids the rollout desync bug (separate memory stores
80
+ on algorithm and agent sides can't see each other's state).
81
+
82
+ For platform runs, the worker now creates an InMemoryLightningStore
83
+ wrapped in a LightningStoreServer. Agent containers connect via
84
+ LightningStoreClient (HTTP). See platform/worker.py AlgorithmContext.
85
+ """
86
+
87
+ @classmethod
88
+ def from_env(cls) -> "RedisStreamLightningStore":
89
+ """Create a store from environment variables set by DockerOrchestrator.
90
+
91
+ Expected env vars:
92
+ ``GATEWAY_RUN_ID``: The GatewayRun ID.
93
+ ``REDIS_HOST``: Redis hostname (default ``localhost``).
94
+ ``REDIS_PORT``: Redis port (default ``6379``).
95
+ ``REDIS_AUTH``: Redis password (optional).
96
+
97
+ Returns:
98
+ A configured but not-yet-initialized store.
99
+ Caller must ``await store.initialize()`` before use.
100
+
101
+ Raises:
102
+ EnvironmentError: If ``GATEWAY_RUN_ID`` is not set.
103
+ """
104
+ import os
105
+
106
+ run_id = os.environ.get("GATEWAY_RUN_ID")
107
+ if not run_id:
108
+ raise EnvironmentError(
109
+ "GATEWAY_RUN_ID environment variable is required. "
110
+ "This is set automatically by the Gateway platform orchestrator."
111
+ )
112
+ host = os.environ.get("REDIS_HOST", "localhost")
113
+ port = os.environ.get("REDIS_PORT", "6379")
114
+ auth = os.environ.get("REDIS_AUTH", "")
115
+ redis_url = f"redis://:{auth}@{host}:{port}" if auth else f"redis://{host}:{port}"
116
+ return cls(redis_url=redis_url, run_id=run_id)
117
+
118
+ def __init__(
119
+ self,
120
+ *,
121
+ redis_url: str,
122
+ run_id: str,
123
+ consumer_group: str = "gateway-runners",
124
+ thread_safe: bool = False,
125
+ listeners: Optional[Sequence] = None,
126
+ block_timeout_ms: int = 5000,
127
+ ):
128
+ """
129
+ Args:
130
+ redis_url: Redis connection string (e.g., redis://:password@host:6379/0).
131
+ run_id: The GatewayRun ID. Used to namespace the Redis stream key.
132
+ consumer_group: Consumer group name for XREADGROUP.
133
+ thread_safe: Whether the underlying InMemoryLightningStore is thread-safe.
134
+ listeners: StorageListener instances to attach.
135
+ block_timeout_ms: Timeout for XREADGROUP BLOCK (milliseconds).
136
+ """
137
+ self._redis_url = redis_url
138
+ self._run_id = run_id
139
+ self._consumer_group = consumer_group
140
+ self._block_timeout_ms = block_timeout_ms
141
+ self._redis = None
142
+ self._stream_key = f"gateway:run:{run_id}:rollouts"
143
+
144
+ # Create the inner in-memory store for all metadata
145
+ self._inner = InMemoryLightningStore(
146
+ thread_safe=thread_safe,
147
+ listeners=list(listeners) if listeners else None,
148
+ )
149
+
150
+ @property
151
+ def run_id(self) -> str:
152
+ return self._run_id
153
+
154
+ @property
155
+ def capabilities(self) -> LightningStoreCapabilities:
156
+ caps = self._inner.capabilities
157
+ caps["async_safe"] = True
158
+ caps["thread_safe"] = True # Redis handles concurrency at server level
159
+ return caps
160
+
161
+ async def initialize(self) -> None:
162
+ """Create Redis connection and consumer group."""
163
+ if aioredis is None:
164
+ raise ImportError(
165
+ "redis[asyncio] is required for RedisStreamLightningStore. Install with: pip install redis>=5.0.0"
166
+ )
167
+
168
+ try:
169
+ self._redis = aioredis.from_url(self._redis_url, decode_responses=True)
170
+ await self._redis.ping()
171
+ except Exception as e:
172
+ self._redis = None
173
+ raise ConnectionError(f"Failed to connect to Redis at {redact_url(self._redis_url)}: {e}") from e
174
+
175
+ # Create consumer group (MKSTREAM creates the stream if it doesn't exist)
176
+ try:
177
+ await self._redis.xgroup_create(self._stream_key, self._consumer_group, id="0", mkstream=True)
178
+ logger.info(f"Created consumer group '{self._consumer_group}' on stream '{self._stream_key}'")
179
+ except Exception as e:
180
+ if "BUSYGROUP" in str(e):
181
+ logger.debug(f"Consumer group '{self._consumer_group}' already exists")
182
+ else:
183
+ raise
184
+
185
+ async def close(self, *, cleanup: bool = True) -> None:
186
+ """Close Redis connection and optionally clean up stream resources.
187
+
188
+ Args:
189
+ cleanup: If True (default), delete the stream key and consumer group
190
+ to prevent Redis memory growth from orphaned streams.
191
+ """
192
+ if self._redis:
193
+ if cleanup:
194
+ try:
195
+ await self._redis.xgroup_destroy(self._stream_key, self._consumer_group)
196
+ logger.debug(f"Destroyed consumer group '{self._consumer_group}' " f"on '{self._stream_key}'")
197
+ except Exception:
198
+ pass # Group may not exist or Redis may be closing
199
+
200
+ try:
201
+ await self._redis.delete(self._stream_key)
202
+ logger.debug(f"Deleted stream key '{self._stream_key}'")
203
+ except Exception:
204
+ pass
205
+
206
+ # Clean up cancellation signal key if it exists
207
+ try:
208
+ await self._redis.delete(f"gateway:run:{self._run_id}:cancel")
209
+ except Exception:
210
+ pass
211
+
212
+ await self._redis.aclose()
213
+ self._redis = None
214
+
215
+ # =========================================================================
216
+ # Rollout Queue — Redis Stream backed
217
+ # =========================================================================
218
+
219
+ async def enqueue_rollout(
220
+ self,
221
+ input: TaskInput,
222
+ *,
223
+ mode: Optional[RolloutMode] = None,
224
+ resources_id: Optional[str] = None,
225
+ config: Optional[RolloutConfig] = None,
226
+ metadata: Optional[Dict[str, Any]] = None,
227
+ ) -> Rollout:
228
+ """Create rollout in memory, then XADD to Redis stream."""
229
+ # Create rollout in the inner store (status="queuing")
230
+ rollout = await self._inner.enqueue_rollout(
231
+ input=input,
232
+ mode=mode,
233
+ resources_id=resources_id,
234
+ config=config,
235
+ metadata=metadata,
236
+ )
237
+
238
+ # Add to Redis stream for distributed consumption
239
+ if self._redis:
240
+ try:
241
+ await self._redis.xadd(
242
+ self._stream_key,
243
+ {
244
+ "rollout_id": rollout.rollout_id,
245
+ "input_json": json.dumps(input) if not isinstance(input, str) else input,
246
+ "resources_id": resources_id or "",
247
+ "mode": mode or "",
248
+ },
249
+ )
250
+ logger.debug(f"XADD rollout {rollout.rollout_id} to {self._stream_key}")
251
+ except Exception as e:
252
+ logger.warning(
253
+ f"Failed to XADD rollout {rollout.rollout_id} to Redis: {e}. "
254
+ f"Rollout exists in memory but not on Redis stream."
255
+ )
256
+ raise RuntimeError(f"Failed to enqueue rollout {rollout.rollout_id} to Redis stream: {e}") from e
257
+
258
+ return rollout
259
+
260
+ async def enqueue_rollouts(
261
+ self,
262
+ requests: Sequence[EnqueueRolloutRequest],
263
+ ) -> List[Rollout]:
264
+ """Batch enqueue rollouts with Redis pipelining (F12)."""
265
+ import json as _json
266
+
267
+ # 1. Create all rollouts in inner (memory) store
268
+ rollouts = []
269
+ for req in requests:
270
+ rollout = await self._inner.enqueue_rollout(
271
+ input=req.input,
272
+ mode=req.mode,
273
+ resources_id=req.resources_id,
274
+ config=req.config,
275
+ metadata=req.metadata,
276
+ )
277
+ rollouts.append(rollout)
278
+
279
+ # 2. Pipeline all XADD commands in one round-trip
280
+ if self._redis and rollouts:
281
+ pipe = self._redis.pipeline()
282
+ for rollout, req in zip(rollouts, requests):
283
+ pipe.xadd(
284
+ self._stream_key,
285
+ {
286
+ "rollout_id": rollout.rollout_id,
287
+ "input_json": _json.dumps(req.input) if not isinstance(req.input, str) else req.input,
288
+ "resources_id": req.resources_id or "",
289
+ "mode": req.mode or "",
290
+ },
291
+ )
292
+ try:
293
+ await pipe.execute()
294
+ except Exception as e:
295
+ logger.error(f"Failed to pipeline enqueue {len(rollouts)} rollouts: {e}")
296
+ raise RuntimeError(f"Failed to pipeline enqueue {len(rollouts)} rollouts: {e}") from e
297
+
298
+ return rollouts
299
+
300
+ async def dequeue_rollout(self, worker_id: Optional[str] = None) -> Optional[AttemptedRollout]:
301
+ """XREADGROUP from Redis stream, then create attempt via inner store."""
302
+ if not self._redis:
303
+ return await self._inner.dequeue_rollout(worker_id=worker_id)
304
+
305
+ consumer_name = worker_id or f"consumer-{id(self)}"
306
+
307
+ # Read one message from the stream
308
+ try:
309
+ result = await self._redis.xreadgroup(
310
+ self._consumer_group,
311
+ consumer_name,
312
+ {self._stream_key: ">"},
313
+ count=1,
314
+ block=self._block_timeout_ms,
315
+ )
316
+ except Exception as e:
317
+ logger.error(f"Redis XREADGROUP failed: {e}. No fallback in distributed mode.")
318
+ return None
319
+
320
+ if not result:
321
+ return None
322
+
323
+ # result format: [[stream_key, [(message_id, {field: value})]]]
324
+ stream_messages = result[0][1]
325
+ if not stream_messages:
326
+ return None
327
+
328
+ message_id, fields = stream_messages[0]
329
+ rollout_id = fields.get("rollout_id")
330
+
331
+ if not rollout_id:
332
+ logger.warning(f"Dequeued message without rollout_id: {fields}")
333
+ await self._redis.xack(self._stream_key, self._consumer_group, message_id)
334
+ return None
335
+
336
+ # Use the inner store's dequeue to create the attempt
337
+ # The rollout is already in memory from enqueue_rollout()
338
+ attempted = await self._inner.dequeue_rollout(worker_id=worker_id)
339
+
340
+ if attempted and attempted.rollout.rollout_id != rollout_id:
341
+ logger.warning(
342
+ f"Redis delivered rollout {rollout_id} but inner store "
343
+ f"returned {attempted.rollout.rollout_id}. Possible desync."
344
+ )
345
+
346
+ if attempted:
347
+ # Store message_id for later ACK
348
+ attempted.rollout._redis_message_id = message_id # type: ignore[attr-defined]
349
+ logger.debug(f"Dequeued rollout {rollout_id} for worker {consumer_name}")
350
+ else:
351
+ # Rollout was in Redis but not in memory — ACK it to prevent redelivery
352
+ await self._redis.xack(self._stream_key, self._consumer_group, message_id)
353
+ logger.warning(f"Rollout {rollout_id} in Redis stream but not in memory store")
354
+
355
+ return attempted
356
+
357
+ async def start_rollout(
358
+ self,
359
+ input: TaskInput,
360
+ *,
361
+ mode: Optional[RolloutMode] = None,
362
+ resources_id: Optional[str] = None,
363
+ config: Optional[RolloutConfig] = None,
364
+ metadata: Optional[Dict[str, Any]] = None,
365
+ ) -> AttemptedRollout:
366
+ """Create rollout + attempt immediately (bypasses queue)."""
367
+ return await self._inner.start_rollout(
368
+ input=input,
369
+ mode=mode,
370
+ resources_id=resources_id,
371
+ config=config,
372
+ metadata=metadata,
373
+ )
374
+
375
+ async def wait_for_rollouts(
376
+ self,
377
+ *,
378
+ rollout_ids: Optional[List[str]] = None,
379
+ timeout: Optional[float] = None,
380
+ ) -> List[Rollout]:
381
+ """Wait for rollouts to reach terminal status."""
382
+ return await self._inner.wait_for_rollouts(rollout_ids=rollout_ids, timeout=timeout)
383
+
384
+ # =========================================================================
385
+ # Rollout/Attempt updates — ACK on terminal status
386
+ # =========================================================================
387
+
388
+ async def update_rollout(
389
+ self,
390
+ rollout_id: str,
391
+ *,
392
+ status: Optional[RolloutStatus] = None,
393
+ input: TaskInput | Unset = UNSET,
394
+ resources_id: Optional[str] | Unset = UNSET,
395
+ metadata: Optional[Dict[str, Any]] | Unset = UNSET,
396
+ ) -> Rollout:
397
+ """Update rollout, ACK Redis message on terminal status."""
398
+ rollout = await self._inner.update_rollout(
399
+ rollout_id,
400
+ status=status,
401
+ input=input,
402
+ resources_id=resources_id,
403
+ metadata=metadata,
404
+ )
405
+
406
+ # ACK the Redis message when rollout reaches terminal status
407
+ if self._redis and status and status in ("succeeded", "failed", "cancelled"):
408
+ msg_id = getattr(rollout, "_redis_message_id", None)
409
+ if msg_id:
410
+ try:
411
+ await self._redis.xack(self._stream_key, self._consumer_group, msg_id)
412
+ logger.debug(f"XACK rollout {rollout_id} (status={status})")
413
+ except Exception as e:
414
+ logger.warning(f"Failed to XACK rollout {rollout_id}: {e}")
415
+
416
+ return rollout
417
+
418
+ async def update_attempt(
419
+ self,
420
+ rollout_id: str,
421
+ attempt_id: str,
422
+ *,
423
+ status: Optional[AttemptStatus] = None,
424
+ worker_id: Optional[str] | Unset = UNSET,
425
+ heartbeat: bool = False,
426
+ ) -> Attempt:
427
+ """Update attempt via inner store."""
428
+ return await self._inner.update_attempt(
429
+ rollout_id,
430
+ attempt_id,
431
+ status=status,
432
+ worker_id=worker_id,
433
+ heartbeat=heartbeat,
434
+ )
435
+
436
+ # =========================================================================
437
+ # All other methods — delegate to InMemoryLightningStore
438
+ # =========================================================================
439
+
440
+ async def add_span(self, span: Span) -> Optional[Span]:
441
+ return await self._inner.add_span(span)
442
+
443
+ async def add_otel_span(
444
+ self,
445
+ rollout_id: str,
446
+ attempt_id: str,
447
+ readable_span: Any,
448
+ ) -> Optional[Span]:
449
+ return await self._inner.add_otel_span(rollout_id, attempt_id, readable_span)
450
+
451
+ async def query_rollouts(self, **kwargs: Any) -> PaginatedResult[Rollout]:
452
+ return await self._inner.query_rollouts(**kwargs)
453
+
454
+ async def query_attempts(self, rollout_id: str, **kwargs: Any) -> PaginatedResult[Attempt]:
455
+ return await self._inner.query_attempts(rollout_id, **kwargs)
456
+
457
+ async def query_spans(self, rollout_id: str, attempt_id: str, **kwargs: Any) -> PaginatedResult[Span]:
458
+ return await self._inner.query_spans(rollout_id, attempt_id, **kwargs)
459
+
460
+ async def get_rollout_by_id(self, rollout_id: str) -> Optional[Rollout]:
461
+ return await self._inner.get_rollout_by_id(rollout_id)
462
+
463
+ async def get_latest_attempt(self, rollout_id: str) -> Optional[Attempt]:
464
+ return await self._inner.get_latest_attempt(rollout_id)
465
+
466
+ async def add_resources(
467
+ self,
468
+ resources: ResourcesUpdate,
469
+ *,
470
+ default: bool = False,
471
+ ) -> ResourcesUpdate:
472
+ return await self._inner.add_resources(resources)
473
+
474
+ async def update_resources(
475
+ self,
476
+ resources_id: str,
477
+ resources: ResourcesUpdate,
478
+ *,
479
+ default: bool = False,
480
+ ) -> ResourcesUpdate:
481
+ return await self._inner.update_resources(resources_id, resources)
482
+
483
+ async def get_latest_resources(
484
+ self,
485
+ resource_type: Optional[str] = None,
486
+ ) -> Optional[NamedResources]:
487
+ return await self._inner.get_latest_resources(resource_type=resource_type)
488
+
489
+ async def get_resources_by_id(self, resources_id: str) -> Optional[NamedResources]:
490
+ return await self._inner.get_resources_by_id(resources_id)
491
+
492
+ def get_statistics(self) -> LightningStoreStatistics:
493
+ return self._inner.get_statistics()
494
+
495
+ async def register_worker(
496
+ self,
497
+ worker_id: str,
498
+ *,
499
+ status: WorkerStatus = "idle",
500
+ metadata: Optional[Dict[str, Any]] = None,
501
+ ) -> Worker:
502
+ return await self._inner.register_worker(worker_id, status=status, metadata=metadata)
503
+
504
+ async def update_worker(
505
+ self,
506
+ worker_id: str,
507
+ *,
508
+ status: Optional[WorkerStatus] = None,
509
+ metadata: Optional[Dict[str, Any]] | Unset = UNSET,
510
+ ) -> Worker:
511
+ return await self._inner.update_worker(worker_id, status=status, metadata=metadata)
512
+
513
+ async def get_worker(self, worker_id: str) -> Optional[Worker]:
514
+ return await self._inner.get_worker(worker_id)
515
+
516
+ async def query_workers(self, **kwargs: Any) -> PaginatedResult[Worker]:
517
+ return await self._inner.query_workers(**kwargs)
@@ -0,0 +1,3 @@
1
+ # Copyright (c) Microsoft. All rights reserved.
2
+
3
+ # TODO: Implement this