agentrun-sdk 0.0.4__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 (128) hide show
  1. agentrun/__init__.py +209 -0
  2. agentrun/agent_runtime/__client_async_template.py +466 -0
  3. agentrun/agent_runtime/__endpoint_async_template.py +345 -0
  4. agentrun/agent_runtime/__init__.py +53 -0
  5. agentrun/agent_runtime/__runtime_async_template.py +477 -0
  6. agentrun/agent_runtime/api/__data_async_template.py +58 -0
  7. agentrun/agent_runtime/api/__init__.py +6 -0
  8. agentrun/agent_runtime/api/control.py +1362 -0
  9. agentrun/agent_runtime/api/data.py +98 -0
  10. agentrun/agent_runtime/client.py +868 -0
  11. agentrun/agent_runtime/endpoint.py +649 -0
  12. agentrun/agent_runtime/model.py +362 -0
  13. agentrun/agent_runtime/runtime.py +904 -0
  14. agentrun/credential/__client_async_template.py +177 -0
  15. agentrun/credential/__credential_async_template.py +216 -0
  16. agentrun/credential/__init__.py +28 -0
  17. agentrun/credential/api/__init__.py +5 -0
  18. agentrun/credential/api/control.py +606 -0
  19. agentrun/credential/client.py +319 -0
  20. agentrun/credential/credential.py +381 -0
  21. agentrun/credential/model.py +248 -0
  22. agentrun/integration/__init__.py +21 -0
  23. agentrun/integration/agentscope/__init__.py +12 -0
  24. agentrun/integration/agentscope/adapter.py +17 -0
  25. agentrun/integration/agentscope/builtin.py +65 -0
  26. agentrun/integration/agentscope/message_adapter.py +185 -0
  27. agentrun/integration/agentscope/model_adapter.py +60 -0
  28. agentrun/integration/agentscope/tool_adapter.py +59 -0
  29. agentrun/integration/builtin/__init__.py +16 -0
  30. agentrun/integration/builtin/model.py +97 -0
  31. agentrun/integration/builtin/sandbox.py +276 -0
  32. agentrun/integration/builtin/toolset.py +47 -0
  33. agentrun/integration/crewai/__init__.py +12 -0
  34. agentrun/integration/crewai/adapter.py +9 -0
  35. agentrun/integration/crewai/builtin.py +65 -0
  36. agentrun/integration/crewai/model_adapter.py +27 -0
  37. agentrun/integration/crewai/tool_adapter.py +26 -0
  38. agentrun/integration/google_adk/__init__.py +12 -0
  39. agentrun/integration/google_adk/adapter.py +15 -0
  40. agentrun/integration/google_adk/builtin.py +65 -0
  41. agentrun/integration/google_adk/message_adapter.py +144 -0
  42. agentrun/integration/google_adk/model_adapter.py +43 -0
  43. agentrun/integration/google_adk/tool_adapter.py +25 -0
  44. agentrun/integration/langchain/__init__.py +9 -0
  45. agentrun/integration/langchain/adapter.py +15 -0
  46. agentrun/integration/langchain/builtin.py +71 -0
  47. agentrun/integration/langchain/message_adapter.py +141 -0
  48. agentrun/integration/langchain/model_adapter.py +37 -0
  49. agentrun/integration/langchain/tool_adapter.py +50 -0
  50. agentrun/integration/langgraph/__init__.py +13 -0
  51. agentrun/integration/langgraph/adapter.py +20 -0
  52. agentrun/integration/langgraph/builtin.py +65 -0
  53. agentrun/integration/pydantic_ai/__init__.py +12 -0
  54. agentrun/integration/pydantic_ai/adapter.py +13 -0
  55. agentrun/integration/pydantic_ai/builtin.py +65 -0
  56. agentrun/integration/pydantic_ai/model_adapter.py +44 -0
  57. agentrun/integration/pydantic_ai/tool_adapter.py +19 -0
  58. agentrun/integration/utils/__init__.py +112 -0
  59. agentrun/integration/utils/adapter.py +167 -0
  60. agentrun/integration/utils/canonical.py +157 -0
  61. agentrun/integration/utils/converter.py +134 -0
  62. agentrun/integration/utils/model.py +107 -0
  63. agentrun/integration/utils/tool.py +1714 -0
  64. agentrun/model/__client_async_template.py +357 -0
  65. agentrun/model/__init__.py +57 -0
  66. agentrun/model/__model_proxy_async_template.py +270 -0
  67. agentrun/model/__model_service_async_template.py +267 -0
  68. agentrun/model/api/__init__.py +6 -0
  69. agentrun/model/api/control.py +1173 -0
  70. agentrun/model/api/data.py +196 -0
  71. agentrun/model/client.py +674 -0
  72. agentrun/model/model.py +218 -0
  73. agentrun/model/model_proxy.py +439 -0
  74. agentrun/model/model_service.py +438 -0
  75. agentrun/sandbox/__browser_sandbox_async_template.py +113 -0
  76. agentrun/sandbox/__client_async_template.py +466 -0
  77. agentrun/sandbox/__code_interpreter_sandbox_async_template.py +466 -0
  78. agentrun/sandbox/__init__.py +54 -0
  79. agentrun/sandbox/__sandbox_async_template.py +398 -0
  80. agentrun/sandbox/__template_async_template.py +150 -0
  81. agentrun/sandbox/api/__browser_data_async_template.py +140 -0
  82. agentrun/sandbox/api/__code_interpreter_data_async_template.py +206 -0
  83. agentrun/sandbox/api/__init__.py +17 -0
  84. agentrun/sandbox/api/__sandbox_data_async_template.py +100 -0
  85. agentrun/sandbox/api/browser_data.py +172 -0
  86. agentrun/sandbox/api/code_interpreter_data.py +396 -0
  87. agentrun/sandbox/api/control.py +1051 -0
  88. agentrun/sandbox/api/playwright_async.py +492 -0
  89. agentrun/sandbox/api/playwright_sync.py +492 -0
  90. agentrun/sandbox/api/sandbox_data.py +140 -0
  91. agentrun/sandbox/browser_sandbox.py +191 -0
  92. agentrun/sandbox/client.py +878 -0
  93. agentrun/sandbox/code_interpreter_sandbox.py +829 -0
  94. agentrun/sandbox/model.py +269 -0
  95. agentrun/sandbox/sandbox.py +737 -0
  96. agentrun/sandbox/template.py +215 -0
  97. agentrun/server/__init__.py +82 -0
  98. agentrun/server/invoker.py +131 -0
  99. agentrun/server/model.py +225 -0
  100. agentrun/server/openai_protocol.py +798 -0
  101. agentrun/server/protocol.py +96 -0
  102. agentrun/server/server.py +192 -0
  103. agentrun/toolset/__client_async_template.py +62 -0
  104. agentrun/toolset/__init__.py +51 -0
  105. agentrun/toolset/__toolset_async_template.py +204 -0
  106. agentrun/toolset/api/__init__.py +17 -0
  107. agentrun/toolset/api/control.py +262 -0
  108. agentrun/toolset/api/mcp.py +100 -0
  109. agentrun/toolset/api/openapi.py +1184 -0
  110. agentrun/toolset/client.py +102 -0
  111. agentrun/toolset/model.py +160 -0
  112. agentrun/toolset/toolset.py +271 -0
  113. agentrun/utils/__data_api_async_template.py +715 -0
  114. agentrun/utils/__init__.py +5 -0
  115. agentrun/utils/__resource_async_template.py +158 -0
  116. agentrun/utils/config.py +258 -0
  117. agentrun/utils/control_api.py +78 -0
  118. agentrun/utils/data_api.py +1110 -0
  119. agentrun/utils/exception.py +149 -0
  120. agentrun/utils/helper.py +34 -0
  121. agentrun/utils/log.py +77 -0
  122. agentrun/utils/model.py +168 -0
  123. agentrun/utils/resource.py +291 -0
  124. agentrun_sdk-0.0.4.dist-info/METADATA +262 -0
  125. agentrun_sdk-0.0.4.dist-info/RECORD +128 -0
  126. agentrun_sdk-0.0.4.dist-info/WHEEL +5 -0
  127. agentrun_sdk-0.0.4.dist-info/licenses/LICENSE +201 -0
  128. agentrun_sdk-0.0.4.dist-info/top_level.txt +1 -0
@@ -0,0 +1,206 @@
1
+ """代码解释器沙箱数据API模板 / Code Interpreter Sandbox Data API Template
2
+
3
+ 此模板用于生成代码解释器沙箱数据API代码。
4
+ This template is used to generate code interpreter sandbox data API code.
5
+ """
6
+
7
+ from typing import Any, Dict, Optional
8
+
9
+ from agentrun.sandbox.model import CodeLanguage
10
+ from agentrun.utils.config import Config
11
+
12
+ from .sandbox_data import SandboxDataAPI
13
+
14
+
15
+ class CodeInterpreterDataAPI(SandboxDataAPI):
16
+
17
+ def __init__(
18
+ self,
19
+ sandbox_id: str,
20
+ config: Optional[Config] = None,
21
+ ):
22
+
23
+ super().__init__(
24
+ sandbox_id=sandbox_id,
25
+ config=config,
26
+ )
27
+
28
+ async def list_directory_async(
29
+ self,
30
+ path: Optional[str] = None,
31
+ depth: Optional[int] = None,
32
+ ):
33
+ query = {}
34
+ if path is not None:
35
+ query["path"] = path
36
+ if depth is not None:
37
+ query["depth"] = depth
38
+
39
+ return await self.get_async("/filesystem", query=query)
40
+
41
+ async def stat_async(
42
+ self,
43
+ path: str,
44
+ ):
45
+ query = {
46
+ "path": path,
47
+ }
48
+ return await self.get_async("/filesystem/stat", query=query)
49
+
50
+ async def mkdir_async(
51
+ self,
52
+ path: str,
53
+ parents: Optional[bool] = True,
54
+ mode: Optional[str] = "0755",
55
+ ):
56
+ data = {
57
+ "path": path,
58
+ "parents": parents,
59
+ "mode": mode,
60
+ }
61
+ return await self.post_async("/filesystem/mkdir", data=data)
62
+
63
+ async def move_file_async(
64
+ self,
65
+ source: str,
66
+ destination: str,
67
+ ):
68
+ data = {
69
+ "source": source,
70
+ "destination": destination,
71
+ }
72
+ return await self.post_async("/filesystem/move", data=data)
73
+
74
+ async def remove_file_async(
75
+ self,
76
+ path: str,
77
+ ):
78
+ data = {
79
+ "path": path,
80
+ }
81
+ return await self.post_async("/filesystem/remove", data=data)
82
+
83
+ async def list_contexts_async(self):
84
+ return await self.get_async("/contexts")
85
+
86
+ async def create_context_async(
87
+ self,
88
+ language: Optional[CodeLanguage] = CodeLanguage.PYTHON,
89
+ cwd: str = "/home/user",
90
+ ):
91
+ # Validate language parameter
92
+ if language not in ("python", "javascript"):
93
+ raise ValueError(
94
+ f"language must be 'python' or 'javascript', got: {language}"
95
+ )
96
+
97
+ data: Dict[str, Any] = {
98
+ "cwd": cwd,
99
+ "language": language,
100
+ }
101
+ return await self.post_async("/contexts", data=data)
102
+
103
+ async def get_context_async(
104
+ self,
105
+ context_id: str,
106
+ ):
107
+ return await self.get_async(f"/contexts/{context_id}")
108
+
109
+ async def execute_code_async(
110
+ self,
111
+ code: str,
112
+ context_id: Optional[str],
113
+ language: Optional[CodeLanguage] = None,
114
+ timeout: Optional[int] = 30,
115
+ ):
116
+ if language and language not in ("python", "javascript"):
117
+ raise ValueError(
118
+ f"language must be 'python' or 'javascript', got: {language}"
119
+ )
120
+
121
+ data: Dict[str, Any] = {
122
+ "code": code,
123
+ }
124
+ if timeout is not None:
125
+ data["timeout"] = timeout
126
+ if language is not None:
127
+ data["language"] = language
128
+ if context_id is not None:
129
+ data["contextId"] = context_id
130
+ return await self.post_async(f"/contexts/execute", data=data)
131
+
132
+ async def delete_context_async(
133
+ self,
134
+ context_id: str,
135
+ ):
136
+ return await self.delete_async(f"/contexts/{context_id}")
137
+
138
+ async def read_file_async(
139
+ self,
140
+ path: str,
141
+ ):
142
+ query = {
143
+ "path": path,
144
+ }
145
+ return await self.get_async("/files", query=query)
146
+
147
+ async def write_file_async(
148
+ self,
149
+ path: str,
150
+ content: str,
151
+ mode: Optional[str] = "644",
152
+ encoding: Optional[str] = "utf-8",
153
+ create_dir: Optional[bool] = True,
154
+ ):
155
+ data = {
156
+ "path": path,
157
+ "content": content,
158
+ "mode": mode,
159
+ "encoding": encoding,
160
+ "createDir": create_dir,
161
+ }
162
+ return await self.post_async("/files", data=data)
163
+
164
+ async def upload_file_async(
165
+ self,
166
+ local_file_path: str,
167
+ target_file_path: str,
168
+ ):
169
+ return await self.post_file_async(
170
+ path="/filesystem/upload",
171
+ local_file_path=local_file_path,
172
+ target_file_path=target_file_path,
173
+ )
174
+
175
+ async def download_file_async(
176
+ self,
177
+ path: str,
178
+ save_path: str,
179
+ ):
180
+ query = {"path": path}
181
+ return await self.get_file_async(
182
+ path="/filesystem/download", save_path=save_path, query=query
183
+ )
184
+
185
+ async def cmd_async(
186
+ self,
187
+ command: str,
188
+ cwd: str,
189
+ timeout: Optional[int] = 30,
190
+ ):
191
+ data: Dict[str, Any] = {
192
+ "command": command,
193
+ "cwd": cwd,
194
+ }
195
+ if timeout is not None:
196
+ data["timeout"] = timeout
197
+ return await self.post_async("/processes/cmd", data=data)
198
+
199
+ async def list_processes_async(self):
200
+ return await self.get_async("/processes")
201
+
202
+ async def get_process_async(self, pid: str):
203
+ return await self.get_async(f"/processes/{pid}")
204
+
205
+ async def kill_process_async(self, pid: str):
206
+ return await self.delete_async(f"/processes/{pid}")
@@ -0,0 +1,17 @@
1
+ """Sandbox API 模块 / Sandbox API Module
2
+
3
+ 此模块包含沙箱环境的 API 接口。
4
+ This module contains API interfaces for sandbox environments.
5
+ """
6
+
7
+ from .browser_data import BrowserDataAPI
8
+ from .code_interpreter_data import CodeInterpreterDataAPI
9
+ from .control import SandboxControlAPI
10
+ from .sandbox_data import SandboxDataAPI
11
+
12
+ __all__ = [
13
+ "SandboxControlAPI",
14
+ "SandboxDataAPI",
15
+ "CodeInterpreterDataAPI",
16
+ "BrowserDataAPI",
17
+ ]
@@ -0,0 +1,100 @@
1
+ """Sandbox数据API模板 / Sandbox Data API Template
2
+
3
+ 此模板用于生成沙箱数据API代码。
4
+ This template is used to generate sandbox data API code.
5
+ """
6
+
7
+ from typing import Optional
8
+
9
+ from agentrun.utils.config import Config
10
+ from agentrun.utils.data_api import DataAPI, ResourceType
11
+
12
+
13
+ class SandboxDataAPI(DataAPI):
14
+
15
+ def __init__(
16
+ self,
17
+ *,
18
+ sandbox_id: Optional[str] = None,
19
+ template_name: Optional[str] = None,
20
+ config: Optional[Config] = None,
21
+ ):
22
+
23
+ super().__init__(
24
+ resource_name="",
25
+ resource_type=ResourceType.Template,
26
+ namespace="sandboxes",
27
+ config=config,
28
+ )
29
+ self.access_token_map = {}
30
+
31
+ if sandbox_id or template_name:
32
+ self.__refresh_access_token(
33
+ sandbox_id=sandbox_id,
34
+ template_name=template_name,
35
+ config=config,
36
+ )
37
+
38
+ def __refresh_access_token(
39
+ self,
40
+ *,
41
+ sandbox_id: Optional[str] = None,
42
+ template_name: Optional[str] = None,
43
+ config: Optional[Config] = None,
44
+ ):
45
+ cfg = Config.with_configs(config, self.config)
46
+ token = self.access_token_map.get(sandbox_id or template_name)
47
+ if sandbox_id:
48
+ self.resource_name = sandbox_id
49
+ self.resource_type = ResourceType.Sandbox
50
+ self.namespace = f"sandboxes/{sandbox_id}"
51
+ else:
52
+ self.resource_name = template_name
53
+ self.resource_type = ResourceType.Template
54
+ self.namespace = "sandboxes"
55
+
56
+ if token:
57
+ self.access_token = token
58
+ return
59
+
60
+ # 没有缓存过的 token
61
+
62
+ self.access_token = None
63
+ self.auth(config=cfg)
64
+ self.access_token_map[sandbox_id or template_name] = self.access_token
65
+
66
+ async def check_health_async(self):
67
+ return await self.get_async("/health")
68
+
69
+ async def create_sandbox_async(
70
+ self,
71
+ template_name: str,
72
+ sandbox_idle_timeout_seconds: Optional[int] = 600,
73
+ config: Optional[Config] = None,
74
+ ):
75
+ self.__refresh_access_token(template_name=template_name, config=config)
76
+ return await self.post_async(
77
+ "/",
78
+ data={
79
+ "templateName": template_name,
80
+ "sandboxIdleTimeoutSeconds": sandbox_idle_timeout_seconds,
81
+ },
82
+ )
83
+
84
+ async def delete_sandbox_async(
85
+ self, sandbox_id: str, config: Optional[Config] = None
86
+ ):
87
+ self.__refresh_access_token(sandbox_id=sandbox_id, config=config)
88
+ return await self.delete_async("/")
89
+
90
+ async def stop_sandbox_async(
91
+ self, sandbox_id: str, config: Optional[Config] = None
92
+ ):
93
+ self.__refresh_access_token(sandbox_id=sandbox_id, config=config)
94
+ return await self.post_async("/stop")
95
+
96
+ async def get_sandbox_async(
97
+ self, sandbox_id: str, config: Optional[Config] = None
98
+ ):
99
+ self.__refresh_access_token(sandbox_id=sandbox_id, config=config)
100
+ return await self.get_async("/")
@@ -0,0 +1,172 @@
1
+ """
2
+ This file is auto generated by the code generation script.
3
+ Do not modify this file manually.
4
+ Use the `make codegen` command to regenerate.
5
+
6
+ 当前文件为自动生成的控制 API 客户端代码。请勿手动修改此文件。
7
+ 使用 `make codegen` 命令重新生成。
8
+
9
+ source: agentrun/sandbox/api/__browser_data_async_template.py
10
+
11
+ 浏览器沙箱数据API模板 / Browser Sandbox Data API Template
12
+
13
+ 此模板用于生成浏览器沙箱数据API代码。
14
+ This template is used to generate browser sandbox data API code.
15
+ """
16
+
17
+ from typing import Optional
18
+ from urllib.parse import parse_qs, urlencode, urlparse
19
+
20
+ from agentrun.utils.config import Config
21
+
22
+ from .sandbox_data import SandboxDataAPI
23
+
24
+
25
+ class BrowserDataAPI(SandboxDataAPI):
26
+
27
+ def __init__(
28
+ self,
29
+ sandbox_id: str,
30
+ config: Optional[Config] = None,
31
+ ):
32
+ self.sandbox_id = sandbox_id
33
+ super().__init__(
34
+ sandbox_id=sandbox_id,
35
+ config=config,
36
+ )
37
+
38
+ def get_cdp_url(self, record: Optional[bool] = False):
39
+ """
40
+ Generate the WebSocket URL for Chrome DevTools Protocol (CDP) connection.
41
+
42
+ This method constructs a WebSocket URL by:
43
+ 1. Converting the HTTP endpoint to WebSocket protocol (ws://)
44
+ 2. Parsing the existing URL and query parameters
45
+ 3. Adding the session ID to the query parameters
46
+ 4. Reconstructing the complete WebSocket URL
47
+
48
+ Returns:
49
+ str: The complete WebSocket URL for CDP automation connection,
50
+ including the session ID in the query parameters.
51
+
52
+ Example:
53
+ >>> api = BrowserDataAPI("browser123", "session456")
54
+ >>> api.get_cdp_url()
55
+ 'ws://example.com/ws/automation?sessionId=session456'
56
+ """
57
+ cdp_url = self.with_path("/ws/automation").replace("http", "ws")
58
+ u = urlparse(cdp_url)
59
+ query_dict = parse_qs(u.query)
60
+ query_dict["tenantId"] = [self.config.get_account_id()]
61
+ if record:
62
+ query_dict["recording"] = ["true"]
63
+ new_query = urlencode(query_dict, doseq=True)
64
+ new_u = u._replace(query=new_query)
65
+ return new_u.geturl()
66
+
67
+ def get_vnc_url(self, record: Optional[bool] = False):
68
+ """
69
+ Generate the WebSocket URL for VNC (Virtual Network Computing) live view connection.
70
+
71
+ This method constructs a WebSocket URL for real-time browser viewing by:
72
+ 1. Converting the HTTP endpoint to WebSocket protocol (ws://)
73
+ 2. Parsing the existing URL and query parameters
74
+ 3. Adding the session ID to the query parameters
75
+ 4. Reconstructing the complete WebSocket URL
76
+
77
+ Returns:
78
+ str: The complete WebSocket URL for VNC live view connection,
79
+ including the session ID in the query parameters.
80
+
81
+ Example:
82
+ >>> api = BrowserDataAPI("browser123", "session456")
83
+ >>> api.get_vnc_url()
84
+ 'ws://example.com/ws/liveview?sessionId=session456'
85
+ """
86
+ vnc_url = self.with_path("/ws/liveview").replace("http", "ws")
87
+ u = urlparse(vnc_url)
88
+ query_dict = parse_qs(u.query)
89
+ query_dict["tenantId"] = [self.config.get_account_id()]
90
+ if record:
91
+ query_dict["recording"] = ["true"]
92
+ new_query = urlencode(query_dict, doseq=True)
93
+ new_u = u._replace(query=new_query)
94
+ return new_u.geturl()
95
+
96
+ def sync_playwright(
97
+ self,
98
+ browser_type: str = "chrome",
99
+ record: Optional[bool] = False,
100
+ config: Optional[Config] = None,
101
+ ):
102
+ from .playwright_sync import BrowserPlaywrightSync
103
+
104
+ cfg = Config.with_configs(self.config, config)
105
+ _, headers, _ = self.auth(headers=cfg.get_headers(), config=cfg)
106
+ return BrowserPlaywrightSync(
107
+ self.get_cdp_url(record=record),
108
+ browser_type=browser_type,
109
+ headers=headers,
110
+ )
111
+
112
+ def async_playwright(
113
+ self,
114
+ browser_type: str = "chrome",
115
+ record: Optional[bool] = False,
116
+ config: Optional[Config] = None,
117
+ ):
118
+ from .playwright_async import BrowserPlaywrightAsync
119
+
120
+ cfg = Config.with_configs(self.config, config)
121
+ _, headers, _ = self.auth(headers=cfg.get_headers(), config=cfg)
122
+ return BrowserPlaywrightAsync(
123
+ self.get_cdp_url(record=record),
124
+ browser_type=browser_type,
125
+ headers=headers,
126
+ )
127
+
128
+ async def list_recordings_async(self):
129
+ return await self.get_async("/recordings")
130
+
131
+ def list_recordings(self):
132
+ return self.get("/recordings")
133
+
134
+ async def delete_recording_async(self, filename: str):
135
+ return await self.delete_async(f"/recordings/{filename}")
136
+
137
+ def delete_recording(self, filename: str):
138
+ return self.delete(f"/recordings/{filename}")
139
+
140
+ async def download_recording_async(self, filename: str, save_path: str):
141
+ """
142
+ Asynchronously download a recording video file and save it to local path.
143
+
144
+ Args:
145
+ filename: The name of the recording file to download
146
+ save_path: Local file path to save the downloaded video file (.mkv)
147
+
148
+ Returns:
149
+ Dictionary with 'saved_path' and 'size' keys
150
+
151
+ Examples:
152
+ >>> await api.download_recording_async("recording.mp4", "/local/video.mkv")
153
+ """
154
+ return await self.get_video_async(
155
+ f"/recordings/{filename}", save_path=save_path
156
+ )
157
+
158
+ def download_recording(self, filename: str, save_path: str):
159
+ """
160
+ Synchronously download a recording video file and save it to local path.
161
+
162
+ Args:
163
+ filename: The name of the recording file to download
164
+ save_path: Local file path to save the downloaded video file (.mkv)
165
+
166
+ Returns:
167
+ Dictionary with 'saved_path' and 'size' keys
168
+
169
+ Examples:
170
+ >>> api.download_recording("recording.mp4", "/local/video.mkv")
171
+ """
172
+ return self.get_video(f"/recordings/{filename}", save_path=save_path)