agentkit-sdk-python 0.9.2__py3-none-any.whl → 0.9.3__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.
- agentkit/__init__.py +5 -5
- agentkit/apps/a2a_app/a2a_app.py +68 -10
- agentkit/client/base_service_client.py +102 -8
- agentkit/frameworks/_agentsentry.py +5 -0
- agentkit/sdk/organizations/__init__.py +63 -0
- agentkit/sdk/organizations/client.py +175 -0
- agentkit/sdk/organizations/types.py +368 -0
- agentkit/sdk/users/__init__.py +73 -0
- agentkit/sdk/users/client.py +181 -0
- agentkit/sdk/users/types.py +548 -0
- agentkit/sdk/workspaces/__init__.py +91 -0
- agentkit/sdk/workspaces/client.py +272 -0
- agentkit/sdk/workspaces/types.py +539 -0
- agentkit/toolkit/resources/samples/a2a.py +14 -2
- agentkit/version.py +1 -1
- {agentkit_sdk_python-0.9.2.dist-info → agentkit_sdk_python-0.9.3.dist-info}/METADATA +2 -2
- {agentkit_sdk_python-0.9.2.dist-info → agentkit_sdk_python-0.9.3.dist-info}/RECORD +21 -12
- {agentkit_sdk_python-0.9.2.dist-info → agentkit_sdk_python-0.9.3.dist-info}/WHEEL +0 -0
- {agentkit_sdk_python-0.9.2.dist-info → agentkit_sdk_python-0.9.3.dist-info}/entry_points.txt +0 -0
- {agentkit_sdk_python-0.9.2.dist-info → agentkit_sdk_python-0.9.3.dist-info}/licenses/LICENSE +0 -0
- {agentkit_sdk_python-0.9.2.dist-info → agentkit_sdk_python-0.9.3.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""Pydantic models for the AgentKit Workspaces OpenAPI (amon workspace
|
|
16
|
+
service, signing service ``agentkit``).
|
|
17
|
+
|
|
18
|
+
Wire-format notes (mirroring the published OpenAPI definition):
|
|
19
|
+
- GET-declared actions (``ListWorkspaces``, ``GetWorkspace``,
|
|
20
|
+
``ListWorkspaceMembers``, ``GetWorkspaceMember``) carry business params
|
|
21
|
+
in the query string with PascalCase keys.
|
|
22
|
+
- ``CreateWorkspace`` additionally requires the unsigned ``X-Top-Region``
|
|
23
|
+
request header (the server reads the workspace region from it); handled
|
|
24
|
+
by the client, not the models.
|
|
25
|
+
- Single-object responses nest under a ``Workspace``/``Binding`` key.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
from __future__ import annotations
|
|
29
|
+
|
|
30
|
+
from typing import List, Optional
|
|
31
|
+
|
|
32
|
+
from pydantic import BaseModel, Field, field_validator, model_validator
|
|
33
|
+
|
|
34
|
+
# Workspace member roles the OpenAPI supports.
|
|
35
|
+
WORKSPACE_ROLES = (
|
|
36
|
+
"global_admin",
|
|
37
|
+
"system_admin",
|
|
38
|
+
"workspace_admin",
|
|
39
|
+
"workspace_developer",
|
|
40
|
+
"workspace_user",
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
# Operations accepted by BatchUpdateWorkspaceMembers.
|
|
44
|
+
BATCH_MEMBER_OPERATIONS = ("create", "update", "delete")
|
|
45
|
+
|
|
46
|
+
MAX_LIST_WORKSPACES_RESULTS = 100
|
|
47
|
+
MAX_LIST_WORKSPACE_MEMBERS_RESULTS = 100
|
|
48
|
+
MAX_BATCH_MEMBER_OPERATIONS = 100
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class WorkspacesBaseModel(BaseModel):
|
|
52
|
+
"""AgentKit Workspaces base model"""
|
|
53
|
+
|
|
54
|
+
model_config = {"populate_by_name": True, "arbitrary_types_allowed": True}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _normalize_optional(v: Optional[str]) -> Optional[str]:
|
|
58
|
+
"""Trim an optional string; blank means "not provided"."""
|
|
59
|
+
if v is None:
|
|
60
|
+
return None
|
|
61
|
+
v = v.strip()
|
|
62
|
+
return v or None
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def _validate_workspace_role(role: str) -> str:
|
|
66
|
+
if role not in WORKSPACE_ROLES:
|
|
67
|
+
raise ValueError(
|
|
68
|
+
f"role {role!r} is invalid; supported roles: "
|
|
69
|
+
f"{', '.join(WORKSPACE_ROLES)}."
|
|
70
|
+
)
|
|
71
|
+
return role
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
# Data Types
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class WorkspaceData(WorkspacesBaseModel):
|
|
78
|
+
"""One workspace as returned by the workspace lifecycle actions."""
|
|
79
|
+
|
|
80
|
+
workspace_id: Optional[str] = Field(default=None, alias="WorkspaceId")
|
|
81
|
+
org_id: Optional[str] = Field(default=None, alias="OrgId")
|
|
82
|
+
name: Optional[str] = Field(default=None, alias="Name")
|
|
83
|
+
description: Optional[str] = Field(default=None, alias="Description")
|
|
84
|
+
workspace_type: Optional[str] = Field(default=None, alias="WorkspaceType")
|
|
85
|
+
status: Optional[str] = Field(default=None, alias="Status")
|
|
86
|
+
project_name: Optional[str] = Field(default=None, alias="ProjectName")
|
|
87
|
+
region: Optional[str] = Field(default=None, alias="Region")
|
|
88
|
+
create_time: Optional[str] = Field(default=None, alias="CreateTime")
|
|
89
|
+
update_time: Optional[str] = Field(default=None, alias="UpdateTime")
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class WorkspaceMemberBindingData(WorkspacesBaseModel):
|
|
93
|
+
"""One workspace member binding as returned by the member actions."""
|
|
94
|
+
|
|
95
|
+
binding_id: Optional[str] = Field(default=None, alias="BindingId")
|
|
96
|
+
workspace_id: Optional[str] = Field(default=None, alias="WorkspaceId")
|
|
97
|
+
user_id: Optional[str] = Field(default=None, alias="UserId")
|
|
98
|
+
org_id: Optional[str] = Field(default=None, alias="OrgId")
|
|
99
|
+
account_id: Optional[str] = Field(default=None, alias="AccountId")
|
|
100
|
+
role: Optional[str] = Field(default=None, alias="Role")
|
|
101
|
+
username: Optional[str] = Field(default=None, alias="Username")
|
|
102
|
+
email: Optional[str] = Field(default=None, alias="Email")
|
|
103
|
+
create_time: Optional[str] = Field(default=None, alias="CreateTime")
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class GrantSystemAdminBindingData(WorkspacesBaseModel):
|
|
107
|
+
"""One binding created by ``GrantSystemAdmin`` (IAM users, no profile
|
|
108
|
+
fields)."""
|
|
109
|
+
|
|
110
|
+
binding_id: Optional[str] = Field(default=None, alias="BindingId")
|
|
111
|
+
workspace_id: Optional[str] = Field(default=None, alias="WorkspaceId")
|
|
112
|
+
user_id: Optional[str] = Field(default=None, alias="UserId")
|
|
113
|
+
org_id: Optional[str] = Field(default=None, alias="OrgId")
|
|
114
|
+
account_id: Optional[str] = Field(default=None, alias="AccountId")
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
class WorkspaceMemberOperationItem(WorkspacesBaseModel):
|
|
118
|
+
"""One batched member change. ``role`` is required for create/update
|
|
119
|
+
and must not be set for delete."""
|
|
120
|
+
|
|
121
|
+
operation: str = Field(..., alias="Operation")
|
|
122
|
+
user_id: str = Field(..., alias="UserId")
|
|
123
|
+
role: Optional[str] = Field(default=None, alias="Role")
|
|
124
|
+
|
|
125
|
+
@field_validator("user_id")
|
|
126
|
+
@classmethod
|
|
127
|
+
def _validate_user_id(cls, v: str) -> str:
|
|
128
|
+
if not v.strip():
|
|
129
|
+
raise ValueError("userId must not be empty.")
|
|
130
|
+
return v
|
|
131
|
+
|
|
132
|
+
@model_validator(mode="after")
|
|
133
|
+
def _validate_role_rules(self) -> "WorkspaceMemberOperationItem":
|
|
134
|
+
if self.operation not in BATCH_MEMBER_OPERATIONS:
|
|
135
|
+
raise ValueError(
|
|
136
|
+
f"operation {self.operation!r} is invalid; supported "
|
|
137
|
+
f"operations: {', '.join(BATCH_MEMBER_OPERATIONS)}."
|
|
138
|
+
)
|
|
139
|
+
if self.operation in ("create", "update"):
|
|
140
|
+
if self.role is None or not self.role.strip():
|
|
141
|
+
raise ValueError(
|
|
142
|
+
f"role is required for {self.operation} operations."
|
|
143
|
+
)
|
|
144
|
+
_validate_workspace_role(self.role)
|
|
145
|
+
elif self.role is not None and self.role.strip() != "":
|
|
146
|
+
raise ValueError("role must not be set for delete operations.")
|
|
147
|
+
return self
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
class WorkspaceMemberOperationResultItem(WorkspacesBaseModel):
|
|
151
|
+
"""Per-operation outcome from ``BatchUpdateWorkspaceMembers``, keyed by
|
|
152
|
+
the input operation's index."""
|
|
153
|
+
|
|
154
|
+
index: Optional[int] = Field(default=None, alias="Index")
|
|
155
|
+
status: Optional[str] = Field(default=None, alias="Status")
|
|
156
|
+
binding_id: Optional[str] = Field(default=None, alias="BindingId")
|
|
157
|
+
error_code: Optional[str] = Field(default=None, alias="ErrorCode")
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
# CreateWorkspace - Request / Response
|
|
161
|
+
class CreateWorkspaceRequest(WorkspacesBaseModel):
|
|
162
|
+
name: str = Field(..., alias="Name")
|
|
163
|
+
org_id: str = Field(..., alias="OrgId")
|
|
164
|
+
project_name: Optional[str] = Field(default=None, alias="ProjectName")
|
|
165
|
+
description: Optional[str] = Field(default=None, alias="Description")
|
|
166
|
+
|
|
167
|
+
@field_validator("name", "org_id")
|
|
168
|
+
@classmethod
|
|
169
|
+
def _validate_required_ids(cls, v: str) -> str:
|
|
170
|
+
if not v.strip():
|
|
171
|
+
raise ValueError("name and org_id are required to create a workspace.")
|
|
172
|
+
return v
|
|
173
|
+
|
|
174
|
+
@field_validator("project_name")
|
|
175
|
+
@classmethod
|
|
176
|
+
def _validate_project_name(cls, v: Optional[str]) -> Optional[str]:
|
|
177
|
+
if v is not None and not v.strip():
|
|
178
|
+
raise ValueError("project_name must not be empty when provided.")
|
|
179
|
+
return v
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
class CreateWorkspaceResponse(WorkspacesBaseModel):
|
|
183
|
+
workspace: Optional[WorkspaceData] = Field(default=None, alias="Workspace")
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
# ListWorkspaces - Request / Response
|
|
187
|
+
class ListWorkspacesRequest(WorkspacesBaseModel):
|
|
188
|
+
org_id: str = Field(..., alias="OrgId")
|
|
189
|
+
workspace_type: Optional[str] = Field(default=None, alias="WorkspaceType")
|
|
190
|
+
status: Optional[str] = Field(default=None, alias="Status")
|
|
191
|
+
project_name: Optional[str] = Field(default=None, alias="ProjectName")
|
|
192
|
+
# 0 means "unspecified" and lets the server default (10, max 100).
|
|
193
|
+
max_results: Optional[int] = Field(
|
|
194
|
+
default=None, alias="MaxResults", ge=0, le=MAX_LIST_WORKSPACES_RESULTS
|
|
195
|
+
)
|
|
196
|
+
next_token: Optional[str] = Field(default=None, alias="NextToken")
|
|
197
|
+
|
|
198
|
+
@field_validator("org_id")
|
|
199
|
+
@classmethod
|
|
200
|
+
def _validate_org_id(cls, v: str) -> str:
|
|
201
|
+
if not v.strip():
|
|
202
|
+
raise ValueError("org_id is required to list workspaces.")
|
|
203
|
+
return v
|
|
204
|
+
|
|
205
|
+
@field_validator("workspace_type", "status", "project_name", "next_token")
|
|
206
|
+
@classmethod
|
|
207
|
+
def _validate_non_empty(cls, v: Optional[str]) -> Optional[str]:
|
|
208
|
+
if v is not None and not v.strip():
|
|
209
|
+
raise ValueError("filter fields must not be empty when provided.")
|
|
210
|
+
return v
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
class ListWorkspacesResponse(WorkspacesBaseModel):
|
|
214
|
+
workspaces: Optional[List[WorkspaceData]] = Field(
|
|
215
|
+
default=None, alias="Workspaces"
|
|
216
|
+
)
|
|
217
|
+
next_token: Optional[str] = Field(default=None, alias="NextToken")
|
|
218
|
+
|
|
219
|
+
@field_validator("next_token")
|
|
220
|
+
@classmethod
|
|
221
|
+
def _empty_token_is_none(cls, v: Optional[str]) -> Optional[str]:
|
|
222
|
+
# The server returns an empty NextToken on the last page.
|
|
223
|
+
return v or None
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
# GetWorkspace - Request / Response
|
|
227
|
+
class GetWorkspaceRequest(WorkspacesBaseModel):
|
|
228
|
+
"""Lookup by workspace ID (takes precedence) or by project name (the
|
|
229
|
+
org's default workspace in that project); one of them is required."""
|
|
230
|
+
|
|
231
|
+
workspace_id: Optional[str] = Field(default=None, alias="WorkspaceId")
|
|
232
|
+
project_name: Optional[str] = Field(default=None, alias="ProjectName")
|
|
233
|
+
# Also fetch per-role member counts (sent as "true" in the query).
|
|
234
|
+
count_member: Optional[bool] = Field(default=None, alias="CountMember")
|
|
235
|
+
|
|
236
|
+
@field_validator("workspace_id", "project_name")
|
|
237
|
+
@classmethod
|
|
238
|
+
def _normalize_ids(cls, v: Optional[str]) -> Optional[str]:
|
|
239
|
+
return _normalize_optional(v)
|
|
240
|
+
|
|
241
|
+
@model_validator(mode="after")
|
|
242
|
+
def _validate_lookup_key(self) -> "GetWorkspaceRequest":
|
|
243
|
+
if not (self.workspace_id or self.project_name):
|
|
244
|
+
raise ValueError(
|
|
245
|
+
"Either workspace_id or project_name is required to fetch "
|
|
246
|
+
"a workspace."
|
|
247
|
+
)
|
|
248
|
+
return self
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
class GetWorkspaceResponse(WorkspacesBaseModel):
|
|
252
|
+
workspace: Optional[WorkspaceData] = Field(default=None, alias="Workspace")
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
# UpdateWorkspace - Request / Response
|
|
256
|
+
class UpdateWorkspaceRequest(WorkspacesBaseModel):
|
|
257
|
+
workspace_id: str = Field(..., alias="WorkspaceId")
|
|
258
|
+
name: Optional[str] = Field(default=None, alias="Name")
|
|
259
|
+
description: Optional[str] = Field(default=None, alias="Description")
|
|
260
|
+
|
|
261
|
+
@field_validator("workspace_id")
|
|
262
|
+
@classmethod
|
|
263
|
+
def _validate_workspace_id(cls, v: str) -> str:
|
|
264
|
+
if not v.strip():
|
|
265
|
+
raise ValueError("workspace_id is required to update a workspace.")
|
|
266
|
+
return v
|
|
267
|
+
|
|
268
|
+
@field_validator("name", "description")
|
|
269
|
+
@classmethod
|
|
270
|
+
def _validate_non_empty(cls, v: Optional[str]) -> Optional[str]:
|
|
271
|
+
# Empty strings do not update server-side -- there is no
|
|
272
|
+
# clear-by-empty-string semantics.
|
|
273
|
+
if v is not None and not v.strip():
|
|
274
|
+
raise ValueError(
|
|
275
|
+
"name/description must not be empty; omit them to keep the "
|
|
276
|
+
"current values."
|
|
277
|
+
)
|
|
278
|
+
return v
|
|
279
|
+
|
|
280
|
+
@model_validator(mode="after")
|
|
281
|
+
def _validate_has_change(self) -> "UpdateWorkspaceRequest":
|
|
282
|
+
if self.name is None and self.description is None:
|
|
283
|
+
raise ValueError(
|
|
284
|
+
"Nothing to update. Pass at least one of name/description."
|
|
285
|
+
)
|
|
286
|
+
return self
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
class UpdateWorkspaceResponse(WorkspacesBaseModel):
|
|
290
|
+
workspace: Optional[WorkspaceData] = Field(default=None, alias="Workspace")
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
# DeleteWorkspace - Request / Response
|
|
294
|
+
class DeleteWorkspaceRequest(WorkspacesBaseModel):
|
|
295
|
+
workspace_id: str = Field(..., alias="WorkspaceId")
|
|
296
|
+
|
|
297
|
+
@field_validator("workspace_id")
|
|
298
|
+
@classmethod
|
|
299
|
+
def _validate_workspace_id(cls, v: str) -> str:
|
|
300
|
+
if not v.strip():
|
|
301
|
+
raise ValueError("workspace_id is required to delete a workspace.")
|
|
302
|
+
return v
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
class DeleteWorkspaceResponse(WorkspacesBaseModel):
|
|
306
|
+
deleted: Optional[bool] = Field(default=None, alias="Deleted")
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
# GrantSystemAdmin - Request / Response
|
|
310
|
+
class GrantSystemAdminRequest(WorkspacesBaseModel):
|
|
311
|
+
workspace_id: str = Field(..., alias="WorkspaceId")
|
|
312
|
+
# IAM user ids; the server requires a non-empty list without blanks.
|
|
313
|
+
iam_user_ids: List[str] = Field(..., alias="IamUserIdList")
|
|
314
|
+
|
|
315
|
+
@field_validator("workspace_id")
|
|
316
|
+
@classmethod
|
|
317
|
+
def _validate_workspace_id(cls, v: str) -> str:
|
|
318
|
+
if not v.strip():
|
|
319
|
+
raise ValueError("workspace_id is required to grant system admin.")
|
|
320
|
+
return v
|
|
321
|
+
|
|
322
|
+
@model_validator(mode="after")
|
|
323
|
+
def _validate_user_ids(self) -> "GrantSystemAdminRequest":
|
|
324
|
+
if not self.iam_user_ids:
|
|
325
|
+
raise ValueError("iam_user_ids must contain at least one user id.")
|
|
326
|
+
for i, user_id in enumerate(self.iam_user_ids):
|
|
327
|
+
if not user_id.strip():
|
|
328
|
+
raise ValueError(f"iam_user_ids[{i}] must not be empty.")
|
|
329
|
+
return self
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
class GrantSystemAdminResponse(WorkspacesBaseModel):
|
|
333
|
+
bindings: Optional[List[GrantSystemAdminBindingData]] = Field(
|
|
334
|
+
default=None, alias="Bindings"
|
|
335
|
+
)
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
# AddWorkspaceMember - Request / Response
|
|
339
|
+
class AddWorkspaceMemberRequest(WorkspacesBaseModel):
|
|
340
|
+
workspace_id: str = Field(..., alias="WorkspaceId")
|
|
341
|
+
user_id: str = Field(..., alias="UserId")
|
|
342
|
+
role: str = Field(..., alias="Role")
|
|
343
|
+
|
|
344
|
+
@field_validator("workspace_id", "user_id")
|
|
345
|
+
@classmethod
|
|
346
|
+
def _validate_required_ids(cls, v: str) -> str:
|
|
347
|
+
if not v.strip():
|
|
348
|
+
raise ValueError(
|
|
349
|
+
"workspace_id and user_id are required to add a workspace "
|
|
350
|
+
"member."
|
|
351
|
+
)
|
|
352
|
+
return v
|
|
353
|
+
|
|
354
|
+
@field_validator("role")
|
|
355
|
+
@classmethod
|
|
356
|
+
def _validate_role(cls, v: str) -> str:
|
|
357
|
+
return _validate_workspace_role(v)
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
class AddWorkspaceMemberResponse(WorkspacesBaseModel):
|
|
361
|
+
binding: Optional[WorkspaceMemberBindingData] = Field(
|
|
362
|
+
default=None, alias="Binding"
|
|
363
|
+
)
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
# ListWorkspaceMembers - Request / Response
|
|
367
|
+
class ListWorkspaceMembersRequest(WorkspacesBaseModel):
|
|
368
|
+
workspace_id: str = Field(..., alias="WorkspaceId")
|
|
369
|
+
role: Optional[str] = Field(default=None, alias="Role")
|
|
370
|
+
username: Optional[str] = Field(default=None, alias="Username")
|
|
371
|
+
email: Optional[str] = Field(default=None, alias="Email")
|
|
372
|
+
user_id: Optional[str] = Field(default=None, alias="UserId")
|
|
373
|
+
# 0 means "unspecified" and lets the server default (10, max 100).
|
|
374
|
+
max_results: Optional[int] = Field(
|
|
375
|
+
default=None,
|
|
376
|
+
alias="MaxResults",
|
|
377
|
+
ge=0,
|
|
378
|
+
le=MAX_LIST_WORKSPACE_MEMBERS_RESULTS,
|
|
379
|
+
)
|
|
380
|
+
next_token: Optional[str] = Field(default=None, alias="NextToken")
|
|
381
|
+
|
|
382
|
+
@field_validator("workspace_id")
|
|
383
|
+
@classmethod
|
|
384
|
+
def _validate_workspace_id(cls, v: str) -> str:
|
|
385
|
+
if not v.strip():
|
|
386
|
+
raise ValueError(
|
|
387
|
+
"workspace_id is required to list workspace members."
|
|
388
|
+
)
|
|
389
|
+
return v
|
|
390
|
+
|
|
391
|
+
@field_validator("role")
|
|
392
|
+
@classmethod
|
|
393
|
+
def _validate_role(cls, v: Optional[str]) -> Optional[str]:
|
|
394
|
+
if v is not None:
|
|
395
|
+
if not v.strip():
|
|
396
|
+
raise ValueError("role must not be empty when provided.")
|
|
397
|
+
return _validate_workspace_role(v)
|
|
398
|
+
return v
|
|
399
|
+
|
|
400
|
+
@field_validator("username", "email", "user_id", "next_token")
|
|
401
|
+
@classmethod
|
|
402
|
+
def _validate_non_empty(cls, v: Optional[str]) -> Optional[str]:
|
|
403
|
+
if v is not None and not v.strip():
|
|
404
|
+
raise ValueError("filter fields must not be empty when provided.")
|
|
405
|
+
return v
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
class ListWorkspaceMembersResponse(WorkspacesBaseModel):
|
|
409
|
+
bindings: Optional[List[WorkspaceMemberBindingData]] = Field(
|
|
410
|
+
default=None, alias="Bindings"
|
|
411
|
+
)
|
|
412
|
+
next_token: Optional[str] = Field(default=None, alias="NextToken")
|
|
413
|
+
|
|
414
|
+
@field_validator("next_token")
|
|
415
|
+
@classmethod
|
|
416
|
+
def _empty_token_is_none(cls, v: Optional[str]) -> Optional[str]:
|
|
417
|
+
return v or None
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
# GetWorkspaceMember - Request / Response
|
|
421
|
+
class GetWorkspaceMemberRequest(WorkspacesBaseModel):
|
|
422
|
+
workspace_id: str = Field(..., alias="WorkspaceId")
|
|
423
|
+
user_id: str = Field(..., alias="UserId")
|
|
424
|
+
|
|
425
|
+
@field_validator("workspace_id", "user_id")
|
|
426
|
+
@classmethod
|
|
427
|
+
def _validate_required_ids(cls, v: str) -> str:
|
|
428
|
+
if not v.strip():
|
|
429
|
+
raise ValueError(
|
|
430
|
+
"workspace_id and user_id are required to fetch a workspace "
|
|
431
|
+
"member."
|
|
432
|
+
)
|
|
433
|
+
return v
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
class GetWorkspaceMemberResponse(WorkspacesBaseModel):
|
|
437
|
+
"""A missing ``binding`` is a legal "not a member" answer (no error):
|
|
438
|
+
the ids are still present and ``effective_roles`` is empty."""
|
|
439
|
+
|
|
440
|
+
workspace_id: Optional[str] = Field(default=None, alias="WorkspaceId")
|
|
441
|
+
user_id: Optional[str] = Field(default=None, alias="UserId")
|
|
442
|
+
binding: Optional[WorkspaceMemberBindingData] = Field(
|
|
443
|
+
default=None, alias="Binding"
|
|
444
|
+
)
|
|
445
|
+
effective_roles: Optional[List[str]] = Field(
|
|
446
|
+
default=None, alias="EffectiveRoles"
|
|
447
|
+
)
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
# UpdateWorkspaceMemberRole - Request / Response
|
|
451
|
+
class UpdateWorkspaceMemberRoleRequest(WorkspacesBaseModel):
|
|
452
|
+
workspace_id: str = Field(..., alias="WorkspaceId")
|
|
453
|
+
user_id: str = Field(..., alias="UserId")
|
|
454
|
+
role: str = Field(..., alias="Role")
|
|
455
|
+
|
|
456
|
+
@field_validator("workspace_id", "user_id")
|
|
457
|
+
@classmethod
|
|
458
|
+
def _validate_required_ids(cls, v: str) -> str:
|
|
459
|
+
if not v.strip():
|
|
460
|
+
raise ValueError(
|
|
461
|
+
"workspace_id and user_id are required to update a workspace "
|
|
462
|
+
"member role."
|
|
463
|
+
)
|
|
464
|
+
return v
|
|
465
|
+
|
|
466
|
+
@field_validator("role")
|
|
467
|
+
@classmethod
|
|
468
|
+
def _validate_role(cls, v: str) -> str:
|
|
469
|
+
return _validate_workspace_role(v)
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
class UpdateWorkspaceMemberRoleResponse(WorkspacesBaseModel):
|
|
473
|
+
binding: Optional[WorkspaceMemberBindingData] = Field(
|
|
474
|
+
default=None, alias="Binding"
|
|
475
|
+
)
|
|
476
|
+
effective_roles: Optional[List[str]] = Field(
|
|
477
|
+
default=None, alias="EffectiveRoles"
|
|
478
|
+
)
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
# RemoveWorkspaceMember - Request / Response
|
|
482
|
+
class RemoveWorkspaceMemberRequest(WorkspacesBaseModel):
|
|
483
|
+
workspace_id: str = Field(..., alias="WorkspaceId")
|
|
484
|
+
user_id: str = Field(..., alias="UserId")
|
|
485
|
+
|
|
486
|
+
@field_validator("workspace_id", "user_id")
|
|
487
|
+
@classmethod
|
|
488
|
+
def _validate_required_ids(cls, v: str) -> str:
|
|
489
|
+
if not v.strip():
|
|
490
|
+
raise ValueError(
|
|
491
|
+
"workspace_id and user_id are required to remove a workspace "
|
|
492
|
+
"member."
|
|
493
|
+
)
|
|
494
|
+
return v
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
class RemoveWorkspaceMemberResponse(WorkspacesBaseModel):
|
|
498
|
+
deleted_binding_id: Optional[str] = Field(
|
|
499
|
+
default=None, alias="DeletedBindingId"
|
|
500
|
+
)
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
# BatchUpdateWorkspaceMembers - Request / Response
|
|
504
|
+
class BatchUpdateWorkspaceMembersRequest(WorkspacesBaseModel):
|
|
505
|
+
workspace_id: str = Field(..., alias="WorkspaceId")
|
|
506
|
+
operations: List[WorkspaceMemberOperationItem] = Field(
|
|
507
|
+
..., alias="Operations"
|
|
508
|
+
)
|
|
509
|
+
|
|
510
|
+
@field_validator("workspace_id")
|
|
511
|
+
@classmethod
|
|
512
|
+
def _validate_workspace_id(cls, v: str) -> str:
|
|
513
|
+
if not v.strip():
|
|
514
|
+
raise ValueError(
|
|
515
|
+
"workspace_id is required to batch update workspace members."
|
|
516
|
+
)
|
|
517
|
+
return v
|
|
518
|
+
|
|
519
|
+
@model_validator(mode="after")
|
|
520
|
+
def _validate_batch(self) -> "BatchUpdateWorkspaceMembersRequest":
|
|
521
|
+
if not 1 <= len(self.operations) <= MAX_BATCH_MEMBER_OPERATIONS:
|
|
522
|
+
raise ValueError(
|
|
523
|
+
f"operations must contain 1-{MAX_BATCH_MEMBER_OPERATIONS} "
|
|
524
|
+
f"entries, got {len(self.operations)}."
|
|
525
|
+
)
|
|
526
|
+
return self
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
class BatchUpdateWorkspaceMembersResponse(WorkspacesBaseModel):
|
|
530
|
+
"""The server is all-or-nothing: any failed pre-check rejects the whole
|
|
531
|
+
batch, so a success response carries no per-item errors."""
|
|
532
|
+
|
|
533
|
+
succeeded_count: Optional[int] = Field(
|
|
534
|
+
default=None, alias="SucceededCount"
|
|
535
|
+
)
|
|
536
|
+
failed_count: Optional[int] = Field(default=None, alias="FailedCount")
|
|
537
|
+
results: Optional[List[WorkspaceMemberOperationResultItem]] = Field(
|
|
538
|
+
default=None, alias="Results"
|
|
539
|
+
)
|
|
@@ -68,7 +68,13 @@ def ping() -> str:
|
|
|
68
68
|
return "pong!"
|
|
69
69
|
|
|
70
70
|
if __name__ == "__main__":
|
|
71
|
-
from a2a.types import
|
|
71
|
+
from a2a.types import (
|
|
72
|
+
AgentCard,
|
|
73
|
+
AgentCapabilities,
|
|
74
|
+
AgentInterface,
|
|
75
|
+
AgentProvider,
|
|
76
|
+
AgentSkill,
|
|
77
|
+
)
|
|
72
78
|
|
|
73
79
|
agent_card = AgentCard(
|
|
74
80
|
capabilities=AgentCapabilities(streaming=True),
|
|
@@ -78,7 +84,13 @@ if __name__ == "__main__":
|
|
|
78
84
|
default_output_modes=["text"],
|
|
79
85
|
provider=AgentProvider(organization="veadk", url=""),
|
|
80
86
|
skills=[AgentSkill(id="0", name="chat", description="Chat", tags=["chat"])],
|
|
81
|
-
|
|
87
|
+
supported_interfaces=[
|
|
88
|
+
AgentInterface(
|
|
89
|
+
url="http://0.0.0.0:8000",
|
|
90
|
+
protocol_binding="JSONRPC",
|
|
91
|
+
protocol_version="1.0",
|
|
92
|
+
)
|
|
93
|
+
],
|
|
82
94
|
version="1.0.0",
|
|
83
95
|
)
|
|
84
96
|
|
agentkit/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agentkit-sdk-python
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.3
|
|
4
4
|
Summary: Python SDK for transforming any AI agent into a production-ready application. Framework-agnostic primitives for runtime, memory, authentication, and tools with volcengine-managed infrastructure.
|
|
5
5
|
Author-email: Xiangrui Cheng <innsdcc@gmail.com>, Yumeng Bao <baoyumeng.123@gmail.com>, Yaozheng Fang <fangyozheng@gmail.com>, Guodong Li <cu.eric.lee@gmail.com>
|
|
6
6
|
License: Apache License
|
|
@@ -217,7 +217,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
217
217
|
Requires-Python: >=3.10
|
|
218
218
|
Description-Content-Type: text/markdown
|
|
219
219
|
License-File: LICENSE
|
|
220
|
-
Requires-Dist: a2a-sdk<
|
|
220
|
+
Requires-Dist: a2a-sdk<2,>=0.3.15
|
|
221
221
|
Requires-Dist: fastapi>=0.117.1
|
|
222
222
|
Requires-Dist: fastmcp>=2.12.3
|
|
223
223
|
Requires-Dist: opentelemetry-api>=1.32.1
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
agentkit/__init__.py,sha256=
|
|
1
|
+
agentkit/__init__.py,sha256=g-oF63KFkVpw7_JJ142RIrW9o5ThR8N28VaMFaFsZjQ,1071
|
|
2
2
|
agentkit/errors.py,sha256=UWlXv0ZsXd_oLTMlxuf4u9-XkTdRYeVZueE--Z3JsHU,1214
|
|
3
|
-
agentkit/version.py,sha256=
|
|
3
|
+
agentkit/version.py,sha256=5fy5kHzvh-kP4Z0MRTFYGaGkBIm9PHRn0hIaKeJGraY,653
|
|
4
4
|
agentkit/apps/__init__.py,sha256=_Na1A4NSaMbVfPbsFKj2U-yI5mytD7W5skMaAOGbauY,2328
|
|
5
5
|
agentkit/apps/base_app.py,sha256=3hZZExL1wyTGWveJEZZoqXN086MzmkVS_WU1vyulIWg,754
|
|
6
6
|
agentkit/apps/utils.py,sha256=IzimIDmT6FS6PV9MLimPh46mq5zT-EjVmnYPxBdyEq0,1934
|
|
7
7
|
agentkit/apps/a2a_app/__init__.py,sha256=pkSabKw7_ai4NOo56pXKL40EcaxIDh6HYxPXOY7qWbo,634
|
|
8
|
-
agentkit/apps/a2a_app/a2a_app.py,sha256=
|
|
8
|
+
agentkit/apps/a2a_app/a2a_app.py,sha256=0HeN4J36aSTYePyVOObt68IjnY7KOrftpmck5EdFMkg,9744
|
|
9
9
|
agentkit/apps/a2a_app/telemetry.py,sha256=vR8tf7EHLor62cxs5PBx4mrfHeOaV1a7Xryqlu8nGCU,4290
|
|
10
10
|
agentkit/apps/agent_server_app/__init__.py,sha256=pkSabKw7_ai4NOo56pXKL40EcaxIDh6HYxPXOY7qWbo,634
|
|
11
11
|
agentkit/apps/agent_server_app/agent_server_app.py,sha256=ZNhmBtazxQKyfHsLPl8GDJsausziXtYfAsdO3be06jQ,28620
|
|
@@ -46,9 +46,9 @@ agentkit/auth/sts.py,sha256=VE18SsI6GTJBJmtIrxqs-ECeOstC79qe99UizO3EExE,5535
|
|
|
46
46
|
agentkit/client/__init__.py,sha256=WHKgNGkpYsJp0xD20drYcxAMDclwDqrfURqxEVv0V1Y,1053
|
|
47
47
|
agentkit/client/base_agentkit_client.py,sha256=NV1m2FtboUcMdVUJL2ep75nAwDQ42roiWgl3YKaUSn8,2955
|
|
48
48
|
agentkit/client/base_iam_client.py,sha256=F3ggcZjt14CAcgDYpncF2XGr1zTGnhaOzqEJl4NGHwU,2432
|
|
49
|
-
agentkit/client/base_service_client.py,sha256=
|
|
49
|
+
agentkit/client/base_service_client.py,sha256=dVq_dAUyA8mUJ6Zb38jPE1yopKAnF2Us6SOLFrbSRU8,18684
|
|
50
50
|
agentkit/frameworks/__init__.py,sha256=a9fu6cjLFn8Mq82sIo7rPT1gZGzi_QfCuFWpyoa2Ij4,1363
|
|
51
|
-
agentkit/frameworks/_agentsentry.py,sha256=
|
|
51
|
+
agentkit/frameworks/_agentsentry.py,sha256=2RiPHom98ViTVE1deXF_7ILxzr0mN442mZ2y9o3GOpI,7209
|
|
52
52
|
agentkit/frameworks/_common.py,sha256=0L0cyBQxtlOdi3GbQ_UgaOoHWwenztlKrxUsyvV3hXw,3859
|
|
53
53
|
agentkit/frameworks/agentcore.py,sha256=L5bdqzVukm7V6esIttPZSHFEc8JiqysU8YxA6_pBYRQ,12849
|
|
54
54
|
agentkit/frameworks/langchain.py,sha256=IdSE-6dDkWnLLX-9YbJDr3HlKGRqZeoyZMeh20kDJn0,6523
|
|
@@ -100,6 +100,9 @@ agentkit/sdk/memory/types.py,sha256=K6F6B5azB-hbMAKX9qdEkbSicYqyGZVttczcONoYP8s,
|
|
|
100
100
|
agentkit/sdk/model_gateway/__init__.py,sha256=1hbDLUkRCdyposo17sL6PfRKLKYVME_BpPtXr29Gnco,3708
|
|
101
101
|
agentkit/sdk/model_gateway/client.py,sha256=5fhWACbwFe_sYy-jH53pdlzTl1qNIck9_XBHdK5td2Q,6852
|
|
102
102
|
agentkit/sdk/model_gateway/types.py,sha256=Z6IHikbmlvNsVJhUDC93W4VpIuHfVuQtwT-VXwi3NyY,15677
|
|
103
|
+
agentkit/sdk/organizations/__init__.py,sha256=PAfQd2zKWXQEKAT7Owxq0-kzuzCYgc8KekKrnHN0D2g,2154
|
|
104
|
+
agentkit/sdk/organizations/client.py,sha256=xB5IWsitRFfRBhIJBFZ8yA5G8ObD9DP0a3yl0T6kzkA,6824
|
|
105
|
+
agentkit/sdk/organizations/types.py,sha256=UDlKXUXhPhBQ-mBeAKS2Zv5O1VE7_qSDZfoFnLLJiew,13114
|
|
103
106
|
agentkit/sdk/runtime/__init__.py,sha256=pkSabKw7_ai4NOo56pXKL40EcaxIDh6HYxPXOY7qWbo,634
|
|
104
107
|
agentkit/sdk/runtime/client.py,sha256=Puni7oruHTeQmCeEURfA3yC2HpXj8y5ThHA_wXgRr2I,5908
|
|
105
108
|
agentkit/sdk/runtime/gateway.py,sha256=p35LUh7B6VFitoV3JDroI6-tH-nQg7l5DSnWUurYfYI,2846
|
|
@@ -110,6 +113,12 @@ agentkit/sdk/skills/types.py,sha256=3ihqQPVJA84TNlUDIuSi_IA-Z8gZh3qHRmIVpu3ytIw,
|
|
|
110
113
|
agentkit/sdk/tools/__init__.py,sha256=YeCcKcedAqPxmS3LzkqPJOWoz9AVLoqE173cK8gtkHk,636
|
|
111
114
|
agentkit/sdk/tools/client.py,sha256=yrE_SIrHThiIfcM1YHQVWVoYRrKXD7h6d1SJy6yfr0g,7761
|
|
112
115
|
agentkit/sdk/tools/types.py,sha256=ngzMpotQCvZOl_eqyn1wJM4qinL33zBP06ErmecZ4AI,34367
|
|
116
|
+
agentkit/sdk/users/__init__.py,sha256=-9Wnr7BbdTX3aKOnkdwf3es0txfCN72gR6bdvkZ_W5U,2142
|
|
117
|
+
agentkit/sdk/users/client.py,sha256=0zYJhfqoPuAIlPD1uMeRzavE318UoEdZElgIpDUj2lA,6620
|
|
118
|
+
agentkit/sdk/users/types.py,sha256=Uop6gMZimthTFc0xAy6DIBYQAViGkkh5pcCC_QFetGI,19381
|
|
119
|
+
agentkit/sdk/workspaces/__init__.py,sha256=_jyA-T1gnkIY-VgVggCLCSftGtSn0ZocPEoAFBS415k,3008
|
|
120
|
+
agentkit/sdk/workspaces/client.py,sha256=q-lXxi1V4BWQ9N2kQ3BMqY7lJZ0n0Oq_oxpsFev7iS4,10877
|
|
121
|
+
agentkit/sdk/workspaces/types.py,sha256=0nXnWNkgHR5hwu85LcfIMPaCEyhTaTkDst78SRcmWrQ,19825
|
|
113
122
|
agentkit/toolkit/__init__.py,sha256=VZkLRcjybKRHgWvGmLHAm0Gsb1FCUpKmKuJYfZmbfE0,1249
|
|
114
123
|
agentkit/toolkit/context.py,sha256=6CPDjmUwB830JB0OrKGFVNUjeiJ17GPDtbbQBtt6L1w,7554
|
|
115
124
|
agentkit/toolkit/errors.py,sha256=dUqxeYDSBx6npiw4f1T-M1eFsfbnrp0IA0oBszHT4P4,4913
|
|
@@ -210,7 +219,7 @@ agentkit/toolkit/harness/__init__.py,sha256=EIPqG_tzXxslqHL7Zr0fd8x4VgRs14z7mNF6
|
|
|
210
219
|
agentkit/toolkit/harness/config_builder.py,sha256=QLxSs3hGaqD39JTKHAJKd7o9ysis9GsHf0fMQ1LDz6E,3328
|
|
211
220
|
agentkit/toolkit/harness/deploy.py,sha256=uxl1fPCjcpYjO7VtKdWCLi8K72AKHVHQnS16zEiAoiY,17531
|
|
212
221
|
agentkit/toolkit/harness/env_mapping.py,sha256=xcApQnVXW8ffcDoI2CpIU08llsUUxS3KbUggruFWjaQ,8567
|
|
213
|
-
agentkit/toolkit/resources/samples/a2a.py,sha256=
|
|
222
|
+
agentkit/toolkit/resources/samples/a2a.py,sha256=f4H6JqbboXjpU40NwHVM_WB87hHiVpFb8w1K4gOKvsA,3108
|
|
214
223
|
agentkit/toolkit/resources/samples/agent_server.py,sha256=tVD79gT8qhP3dLncKJPWhCjXNDKmRYB0DSyZFoRKiS0,2282
|
|
215
224
|
agentkit/toolkit/resources/samples/basic.py,sha256=QTZ0c2tRZItlrf8Fl6wPTco9iRm6jDjiPZ2iTad_9jY,2547
|
|
216
225
|
agentkit/toolkit/resources/samples/basic_stream.py,sha256=kvxZqyHnpPmakUoJq3IygDaZcnqsgF4ysaIsMimv9pQ,3785
|
|
@@ -294,9 +303,9 @@ agentkit_identity/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
|
294
303
|
agentkit_identity/runtime.py,sha256=hQHLvbAK760teFPTGZ0RG9Ed5DQAXAqIdaAm9ojzS34,14423
|
|
295
304
|
agentkit_identity/transport.py,sha256=kwGHSEQ5Qcn1kIu6N6DVid7MdDUMj5uaIRIUA_tJ3cM,7693
|
|
296
305
|
agentkit_identity/types.py,sha256=lT8KQz1pG0rgdy5Gh6WnM0mq9VqCsWSE41Z8Fw3DHZo,7358
|
|
297
|
-
agentkit_sdk_python-0.9.
|
|
298
|
-
agentkit_sdk_python-0.9.
|
|
299
|
-
agentkit_sdk_python-0.9.
|
|
300
|
-
agentkit_sdk_python-0.9.
|
|
301
|
-
agentkit_sdk_python-0.9.
|
|
302
|
-
agentkit_sdk_python-0.9.
|
|
306
|
+
agentkit_sdk_python-0.9.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
307
|
+
agentkit_sdk_python-0.9.3.dist-info/METADATA,sha256=lXM3_n75dOTN9qSLbUs3xtEMPrnUXPVD-vjm5ylHnlE,21540
|
|
308
|
+
agentkit_sdk_python-0.9.3.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
309
|
+
agentkit_sdk_python-0.9.3.dist-info/entry_points.txt,sha256=fhzZUsvsLXeB4mPaa0SBQiTBqFT404uDAKPaePAOUAE,58
|
|
310
|
+
agentkit_sdk_python-0.9.3.dist-info/top_level.txt,sha256=Kw8DVx7vzg-oUh7xC_hBZw7OwKW3Y_fo_8rkWOL1d5o,27
|
|
311
|
+
agentkit_sdk_python-0.9.3.dist-info/RECORD,,
|
|
File without changes
|
{agentkit_sdk_python-0.9.2.dist-info → agentkit_sdk_python-0.9.3.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{agentkit_sdk_python-0.9.2.dist-info → agentkit_sdk_python-0.9.3.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|