Skip to content

Commit a8c7b0e

Browse files
authored
Merge pull request #42 from Serverless-Devs/copilot/fix-authentication-in-dataapi
Add missing auth() calls to file upload/download methods
2 parents 2950133 + 4b4b97f commit a8c7b0e

File tree

16 files changed

+73
-48
lines changed

16 files changed

+73
-48
lines changed

agentrun/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@
100100
)
101101
# Sandbox
102102
from agentrun.sandbox import (
103+
AioSandbox,
103104
BrowserSandbox,
104105
CodeInterpreterSandbox,
106+
CustomSandbox,
105107
SandboxClient,
106108
Template,
107109
)
@@ -239,6 +241,8 @@
239241
"SandboxClient",
240242
"BrowserSandbox",
241243
"CodeInterpreterSandbox",
244+
"AioSandbox",
245+
"CustomSandbox",
242246
"Template",
243247
######## ToolSet ########
244248
"ToolSetClient",

agentrun/agent_runtime/client.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ async def create_async(
111111
def create(
112112
self, input: AgentRuntimeCreateInput, config: Optional[Config] = None
113113
) -> AgentRuntime:
114-
"""同步创建 Agent Runtime / Create Agent Runtime asynchronously
114+
"""同步创建 Agent Runtime / Create Agent Runtime synchronously
115115
116116
Args:
117117
input: Agent Runtime 创建配置 / Agent Runtime creation configuration
@@ -176,7 +176,7 @@ async def delete_async(
176176
raise e.to_resource_error("AgentRuntime", id) from e
177177

178178
def delete(self, id: str, config: Optional[Config] = None) -> AgentRuntime:
179-
"""同步删除 Agent Runtime / Delete Agent Runtime asynchronously
179+
"""同步删除 Agent Runtime / Delete Agent Runtime synchronously
180180
181181
Args:
182182
id: Agent Runtime ID
@@ -231,7 +231,7 @@ def update(
231231
input: AgentRuntimeUpdateInput,
232232
config: Optional[Config] = None,
233233
) -> AgentRuntime:
234-
"""同步更新 Agent Runtime / Update Agent Runtime asynchronously
234+
"""同步更新 Agent Runtime / Update Agent Runtime synchronously
235235
236236
Args:
237237
id: Agent Runtime ID
@@ -286,7 +286,7 @@ def get(
286286
id: str,
287287
config: Optional[Config] = None,
288288
) -> AgentRuntime:
289-
"""同步获取 Agent Runtime / Get Agent Runtime asynchronously
289+
"""同步获取 Agent Runtime / Get Agent Runtime synchronously
290290
291291
Args:
292292
id: Agent Runtime ID
@@ -343,7 +343,7 @@ def list(
343343
input: Optional[AgentRuntimeListInput] = None,
344344
config: Optional[Config] = None,
345345
) -> List[AgentRuntime]:
346-
"""同步列出 Agent Runtimes / List Agent Runtimes asynchronously
346+
"""同步列出 Agent Runtimes / List Agent Runtimes synchronously
347347
348348
Args:
349349
input: 列表查询配置,可选 / List query configuration, optional
@@ -417,7 +417,7 @@ def create_endpoint(
417417
endpoint: AgentRuntimeEndpointCreateInput,
418418
config: Optional[Config] = None,
419419
) -> AgentRuntimeEndpoint:
420-
"""同步创建 Agent Runtime 端点 / Create Agent Runtime Endpoint asynchronously
420+
"""同步创建 Agent Runtime 端点 / Create Agent Runtime Endpoint synchronously
421421
422422
Args:
423423
agent_runtime_id: Agent Runtime ID
@@ -496,7 +496,7 @@ def delete_endpoint(
496496
endpoint_id: str,
497497
config: Optional[Config] = None,
498498
) -> AgentRuntimeEndpoint:
499-
"""同步删除 Agent Runtime 端点 / Delete Agent Runtime Endpoint asynchronously
499+
"""同步删除 Agent Runtime 端点 / Delete Agent Runtime Endpoint synchronously
500500
501501
Args:
502502
agent_runtime_id: Agent Runtime ID
@@ -578,7 +578,7 @@ def update_endpoint(
578578
endpoint: AgentRuntimeEndpointUpdateInput,
579579
config: Optional[Config] = None,
580580
) -> AgentRuntimeEndpoint:
581-
"""同步更新 Agent Runtime 端点 / Update Agent Runtime Endpoint asynchronously
581+
"""同步更新 Agent Runtime 端点 / Update Agent Runtime Endpoint synchronously
582582
583583
Args:
584584
agent_runtime_id: Agent Runtime ID
@@ -656,7 +656,7 @@ def get_endpoint(
656656
endpoint_id: str,
657657
config: Optional[Config] = None,
658658
) -> AgentRuntimeEndpoint:
659-
"""同步获取 Agent Runtime 端点 / Get Agent Runtime Endpoint asynchronously
659+
"""同步获取 Agent Runtime 端点 / Get Agent Runtime Endpoint synchronously
660660
661661
Args:
662662
agent_runtime_id: Agent Runtime ID
@@ -732,7 +732,7 @@ def list_endpoints(
732732
input: Optional[AgentRuntimeEndpointListInput] = None,
733733
config: Optional[Config] = None,
734734
) -> List[AgentRuntimeEndpoint]:
735-
"""同步列出 Agent Runtime 端点 / List Agent Runtime Endpoints asynchronously
735+
"""同步列出 Agent Runtime 端点 / List Agent Runtime Endpoints synchronously
736736
737737
Args:
738738
agent_runtime_id: Agent Runtime ID
@@ -806,7 +806,7 @@ def list_versions(
806806
input: Optional[AgentRuntimeVersionListInput] = None,
807807
config: Optional[Config] = None,
808808
) -> List[AgentRuntimeVersion]:
809-
"""同步列出 Agent Runtime 版本 / List Agent Runtime Versions asynchronously
809+
"""同步列出 Agent Runtime 版本 / List Agent Runtime Versions synchronously
810810
811811
Args:
812812
agent_runtime_id: Agent Runtime ID

agentrun/agent_runtime/endpoint.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def create_by_id(
9191
input: AgentRuntimeEndpointCreateInput,
9292
config: Optional[Config] = None,
9393
):
94-
"""根据 ID 同步创建端点 / Create endpoint by ID asynchronously
94+
"""根据 ID 同步创建端点 / Create endpoint by ID synchronously
9595
9696
Args:
9797
agent_runtime_id: Agent Runtime ID
@@ -148,7 +148,7 @@ def delete_by_id(
148148
endpoint_id: str,
149149
config: Optional[Config] = None,
150150
):
151-
"""根据 ID 同步删除端点 / Delete endpoint by ID asynchronously
151+
"""根据 ID 同步删除端点 / Delete endpoint by ID synchronously
152152
153153
Args:
154154
agent_runtime_id: Agent Runtime ID
@@ -208,7 +208,7 @@ def update_by_id(
208208
input: AgentRuntimeEndpointUpdateInput,
209209
config: Optional[Config] = None,
210210
):
211-
"""根据 ID 同步更新端点 / Update endpoint by ID asynchronously
211+
"""根据 ID 同步更新端点 / Update endpoint by ID synchronously
212212
213213
Args:
214214
agent_runtime_id: Agent Runtime ID
@@ -266,7 +266,7 @@ def get_by_id(
266266
endpoint_id: str,
267267
config: Optional[Config] = None,
268268
):
269-
"""根据 ID 同步获取端点 / Get endpoint by ID asynchronously
269+
"""根据 ID 同步获取端点 / Get endpoint by ID synchronously
270270
271271
Args:
272272
agent_runtime_id: Agent Runtime ID
@@ -414,7 +414,7 @@ async def list_by_id_async(
414414

415415
@classmethod
416416
def list_by_id(cls, agent_runtime_id: str, config: Optional[Config] = None):
417-
"""根据 Agent Runtime ID 同步列出所有端点 / List all endpoints by Agent Runtime ID asynchronously
417+
"""根据 Agent Runtime ID 同步列出所有端点 / List all endpoints by Agent Runtime ID synchronously
418418
419419
此方法会自动分页获取所有端点并去重。
420420
This method automatically paginates to get all endpoints and deduplicates them.
@@ -489,7 +489,7 @@ async def delete_async(
489489
return self
490490

491491
def delete(self, config: Optional[Config] = None) -> "AgentRuntimeEndpoint":
492-
"""同步删除当前端点 / Delete current endpoint asynchronously
492+
"""同步删除当前端点 / Delete current endpoint synchronously
493493
494494
Args:
495495
config: 配置对象,可选 / Configuration object, optional
@@ -559,7 +559,7 @@ def update(
559559
input: AgentRuntimeEndpointUpdateInput,
560560
config: Optional[Config] = None,
561561
) -> Self:
562-
"""同步更新当前端点 / Update current endpoint asynchronously
562+
"""同步更新当前端点 / Update current endpoint synchronously
563563
564564
Args:
565565
input: 端点更新配置 / Endpoint update configuration
@@ -621,7 +621,7 @@ async def get_async(self, config: Optional[Config] = None):
621621
return self
622622

623623
def get(self, config: Optional[Config] = None):
624-
"""同步获取当前端点信息 / Get current endpoint information asynchronously
624+
"""同步获取当前端点信息 / Get current endpoint information synchronously
625625
626626
Args:
627627
config: 配置对象,可选 / Configuration object, optional

agentrun/agent_runtime/runtime.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ async def create_async(
8888
def create(
8989
cls, input: AgentRuntimeCreateInput, config: Optional[Config] = None
9090
):
91-
"""同步创建 Agent Runtime / Create Agent Runtime asynchronously
91+
"""同步创建 Agent Runtime / Create Agent Runtime synchronously
9292
9393
Args:
9494
input: Agent Runtime 创建配置 / Agent Runtime creation configuration
@@ -142,7 +142,7 @@ async def delete_by_id_async(cls, id: str, config: Optional[Config] = None):
142142

143143
@classmethod
144144
def delete_by_id(cls, id: str, config: Optional[Config] = None):
145-
"""根据 ID 同步删除 Agent Runtime / Delete Agent Runtime by ID asynchronously
145+
"""根据 ID 同步删除 Agent Runtime / Delete Agent Runtime by ID synchronously
146146
147147
此方法会先删除所有关联的端点,然后再删除 Agent Runtime。
148148
This method will first delete all associated endpoints, then delete the Agent Runtime.
@@ -205,7 +205,7 @@ def update_by_id(
205205
input: AgentRuntimeUpdateInput,
206206
config: Optional[Config] = None,
207207
):
208-
"""根据 ID 同步更新 Agent Runtime / Update Agent Runtime by ID asynchronously
208+
"""根据 ID 同步更新 Agent Runtime / Update Agent Runtime by ID synchronously
209209
210210
Args:
211211
id: Agent Runtime ID
@@ -240,7 +240,7 @@ async def get_by_id_async(cls, id: str, config: Optional[Config] = None):
240240

241241
@classmethod
242242
def get_by_id(cls, id: str, config: Optional[Config] = None):
243-
"""根据 ID 同步获取 Agent Runtime / Get Agent Runtime by ID asynchronously
243+
"""根据 ID 同步获取 Agent Runtime / Get Agent Runtime by ID synchronously
244244
245245
Args:
246246
id: Agent Runtime ID
@@ -359,7 +359,7 @@ async def list_async(cls, config: Optional[Config] = None):
359359

360360
@classmethod
361361
def list(cls, config: Optional[Config] = None):
362-
"""同步列出所有 Agent Runtimes / List all Agent Runtimes asynchronously
362+
"""同步列出所有 Agent Runtimes / List all Agent Runtimes synchronously
363363
364364
此方法会自动分页获取所有 Agent Runtimes 并去重。
365365
This method automatically paginates to get all Agent Runtimes and deduplicates them.

agentrun/credential/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async def create_async(
8484
def create(
8585
self, input: CredentialCreateInput, config: Optional[Config] = None
8686
):
87-
"""创建凭证(同步) / Create credential asynchronously
87+
"""创建凭证(同步) / Create credential synchronously
8888
8989
Args:
9090
input: 凭证输入参数 / Credential input parameters

agentrun/knowledgebase/api/control.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
)
2626
from alibabacloud_tea_openapi.exceptions._client import ClientException
2727
from alibabacloud_tea_openapi.exceptions._server import ServerException
28-
from alibabacloud_tea_util.models import RuntimeOptions
28+
from darabonba.runtime import RuntimeOptions
2929
import pydash
3030

3131
from agentrun.utils.config import Config

agentrun/knowledgebase/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ async def create_async(
8181
def create(
8282
self, input: KnowledgeBaseCreateInput, config: Optional[Config] = None
8383
):
84-
"""创建知识库(同步) / Create knowledge base asynchronously
84+
"""创建知识库(同步) / Create knowledge base synchronously
8585
8686
Args:
8787
input: 知识库输入参数 / KnowledgeBase input parameters
@@ -131,7 +131,7 @@ async def delete_async(
131131
) from e
132132

133133
def delete(self, knowledge_base_name: str, config: Optional[Config] = None):
134-
"""删除知识库(同步)/ Delete knowledge base asynchronously
134+
"""删除知识库(同步)/ Delete knowledge base synchronously
135135
136136
Args:
137137
knowledge_base_name: 知识库名称 / KnowledgeBase name
@@ -190,7 +190,7 @@ def update(
190190
input: KnowledgeBaseUpdateInput,
191191
config: Optional[Config] = None,
192192
):
193-
"""更新知识库(同步)/ Update knowledge base asynchronously
193+
"""更新知识库(同步)/ Update knowledge base synchronously
194194
195195
Args:
196196
knowledge_base_name: 知识库名称 / KnowledgeBase name
@@ -242,7 +242,7 @@ async def get_async(
242242
) from e
243243

244244
def get(self, knowledge_base_name: str, config: Optional[Config] = None):
245-
"""获取知识库(同步)/ Get knowledge base asynchronously
245+
"""获取知识库(同步)/ Get knowledge base synchronously
246246
247247
Args:
248248
knowledge_base_name: 知识库名称 / KnowledgeBase name
@@ -292,7 +292,7 @@ def list(
292292
input: Optional[KnowledgeBaseListInput] = None,
293293
config: Optional[Config] = None,
294294
):
295-
"""列出知识库(同步)/ List knowledge bases asynchronously
295+
"""列出知识库(同步)/ List knowledge bases synchronously
296296
297297
Args:
298298
input: 分页查询参数 / Pagination query parameters

0 commit comments

Comments
 (0)