agentkit-sdk-python 0.5.8__py3-none-any.whl → 0.5.9__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.
@@ -29,7 +29,6 @@ class ServiceMeta:
29
29
  DEFAULT_REGION_RULES = {
30
30
  "cn-shanghai": {
31
31
  "cp": "cn-beijing",
32
- "tos": "cn-beijing",
33
32
  }
34
33
  }
35
34
 
@@ -952,6 +952,7 @@ class VeCPCRBuilder(Builder):
952
952
  import time
953
953
 
954
954
  created_in_this_run = False
955
+ name_conflict_not_created = False
955
956
 
956
957
  # Step 1: ensure bucket exists / accessible
957
958
  if auto_created_bucket:
@@ -988,9 +989,7 @@ class VeCPCRBuilder(Builder):
988
989
  created_in_this_run = True
989
990
  except tos.exceptions.TosServerError as e:
990
991
  if e.status_code == 409:
991
- # The bucket name is already taken (possibly by another account).
992
- # Ownership verification in step 2 will block the upload.
993
- pass
992
+ name_conflict_not_created = True
994
993
  else:
995
994
  raise
996
995
 
@@ -1032,10 +1031,43 @@ class VeCPCRBuilder(Builder):
1032
1031
  )
1033
1032
  raise Exception(error_msg)
1034
1033
 
1034
+ if name_conflict_not_created and owned:
1035
+ actual_location = tos_service.get_bucket_location(bucket_name)
1036
+ current_region = getattr(
1037
+ tos_service, "actual_region", config.tos_region
1038
+ )
1039
+ if actual_location:
1040
+ raise Exception(
1041
+ f"TOS bucket '{bucket_name}' exists in region '{actual_location}', "
1042
+ f"but the current configuration targets region '{current_region}'. "
1043
+ "TOS buckets are region-scoped and cannot be accessed across regions. "
1044
+ "Please either switch to the bucket's region or use a different bucket name "
1045
+ f"(e.g. '{bucket_name}-{current_region.split('-')[-1]}')."
1046
+ )
1047
+ else:
1048
+ raise Exception(
1049
+ f"TOS bucket '{bucket_name}' is owned by your account but does not exist "
1050
+ f"in the current region '{current_region}'. It may reside in another region. "
1051
+ "TOS buckets are region-scoped and cannot be accessed across regions. "
1052
+ "Please either switch to the bucket's region or use a different bucket name."
1053
+ )
1054
+
1035
1055
  self.reporter.success(
1036
1056
  f"TOS bucket ownership verified for current account: {bucket_name}"
1037
1057
  )
1038
1058
 
1059
+ if created_in_this_run:
1060
+ data_plane_timeout_s = 30
1061
+ data_plane_interval_s = 3
1062
+ data_plane_deadline = time.time() + data_plane_timeout_s
1063
+ while not tos_service.bucket_exists():
1064
+ if time.time() >= data_plane_deadline:
1065
+ raise Exception(
1066
+ f"TOS bucket '{bucket_name}' was created but is not yet "
1067
+ "available for uploads. Please retry in a few seconds."
1068
+ )
1069
+ time.sleep(data_plane_interval_s)
1070
+
1039
1071
  # Update config with auto-generated bucket name if applicable
1040
1072
  if auto_created_bucket:
1041
1073
  config.tos_bucket = bucket_name
@@ -266,6 +266,30 @@ class TOSService:
266
266
  return False
267
267
  return name in set(self.list_bucket_names())
268
268
 
269
+ def get_bucket_location(self, bucket_name: Optional[str] = None) -> Optional[str]:
270
+ """Return the region (location) of a bucket owned by this account.
271
+
272
+ Uses the already-available ListBuckets data so no extra API call is needed
273
+ beyond what ``bucket_is_owned`` / ``list_bucket_names`` already do.
274
+
275
+ Args:
276
+ bucket_name: Bucket name to look up. Defaults to configured bucket.
277
+
278
+ Returns:
279
+ The region string (e.g. ``"cn-beijing"``) or ``None`` if not found.
280
+ """
281
+ name = bucket_name or self.config.bucket
282
+ if not name:
283
+ return None
284
+ try:
285
+ out = self.client.list_buckets()
286
+ for b in getattr(out, "buckets", None) or []:
287
+ if getattr(b, "name", None) == name:
288
+ return getattr(b, "location", None)
289
+ except Exception as e:
290
+ logger.warning(f"Failed to get bucket location: {str(e)}")
291
+ return None
292
+
269
293
  def bucket_exists(self) -> bool:
270
294
  """Check if the configured bucket exists.
271
295
 
agentkit/version.py CHANGED
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- VERSION = "0.5.8"
15
+ VERSION = "0.5.9"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentkit-sdk-python
3
- Version: 0.5.8
3
+ Version: 0.5.9
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
@@ -1,5 +1,5 @@
1
1
  agentkit/__init__.py,sha256=l27ZMDslc3VhmmnPZJyrqVvTDoZ0LqhCtM5hw0caHcU,1021
2
- agentkit/version.py,sha256=Ajz3UtLWMWrUVfCICLHj6XHCKhMmFJ6BQnLQ7I-TlK0,653
2
+ agentkit/version.py,sha256=pMD92i0W3nktRUhXnXFEZ2wtsRzSpCM1oxFKCiQcGik,653
3
3
  agentkit/apps/__init__.py,sha256=-oXTjxV3gejpJ8pffTUcUAXw0LfxKCYZJk-_hIJhtLM,1921
4
4
  agentkit/apps/base_app.py,sha256=3hZZExL1wyTGWveJEZZoqXN086MzmkVS_WU1vyulIWg,754
5
5
  agentkit/apps/utils.py,sha256=IzimIDmT6FS6PV9MLimPh46mq5zT-EjVmnYPxBdyEq0,1934
@@ -24,7 +24,7 @@ agentkit/client/base_service_client.py,sha256=LvD2ISx_H5vyxTWnjkzja5wzyFLCZo02s7
24
24
  agentkit/platform/__init__.py,sha256=XD1YoXWJPpLGrP410Tb_psPFKR3LUo3-47UlqayUumo,3464
25
25
  agentkit/platform/configuration.py,sha256=h5sb-FVthWsofRHJmkZqDlEd64b698suZcZDLKtk66g,20696
26
26
  agentkit/platform/console_urls.py,sha256=JcnjwyuxN5c4RuXcPevsxy6aInurVFtchqbibJBqjSk,1125
27
- agentkit/platform/constants.py,sha256=811u7xDM30YVj76kjuSoxjN48Qhd2j7GAYW3iIV8BxQ,3693
27
+ agentkit/platform/constants.py,sha256=6DbdIJ5PqBOCxoAjela3wn6RrF_yIGYVD-UfaoqyGE4,3664
28
28
  agentkit/platform/context.py,sha256=eb6ub4nUhoV1hXawjSVdY7gfc5XcgHJjFIhrzOuQ2G0,1662
29
29
  agentkit/platform/provider.py,sha256=Yy5bYveVYQOJiR8_s_DW7rEDtK4cXZQSxLaUifDozuY,2245
30
30
  agentkit/sdk/__init__.py,sha256=lT6PKXd1N-Z4kMYIe2fdNLq9Z_apddIcwkS1DOGZSZI,635
@@ -58,7 +58,7 @@ agentkit/toolkit/reporter.py,sha256=q3r2q9A3Ajmd4IVuaN-FDV3imxwf1eEDXupFerx6JyY,
58
58
  agentkit/toolkit/builders/__init__.py,sha256=iZp7tjp5HLnvqMohk82be7ct5qbrwvv0oExeP0oZHN4,1593
59
59
  agentkit/toolkit/builders/base.py,sha256=ayejVFm2DDBSL-S7egIkwHoUaNViap5AKKFULMwNlBQ,3881
60
60
  agentkit/toolkit/builders/local_docker.py,sha256=GBTLoQAUNjpWosw7NXCTL8ssYHRulSoZZAQRgQsPgdY,18025
61
- agentkit/toolkit/builders/ve_pipeline.py,sha256=vJv5CDySrE4uLNsJJhZBOFmGfadITUsyJEAWlNB4bRM,71405
61
+ agentkit/toolkit/builders/ve_pipeline.py,sha256=n2ZbjqkSBKv5oOsqD-E0SpC5NeP2ImprNKh3-ZyGjCI,73201
62
62
  agentkit/toolkit/cli/__init__.py,sha256=pkSabKw7_ai4NOo56pXKL40EcaxIDh6HYxPXOY7qWbo,634
63
63
  agentkit/toolkit/cli/__main__.py,sha256=arwJ1gHkaaoQAXb0ezo_FeyxiMqVy0FXujB2WOX_ohU,775
64
64
  agentkit/toolkit/cli/cli.py,sha256=cdv1YWArDH4PcoCc9lbPZgcj3_C70ZI6uyOSntUvIA8,3767
@@ -171,7 +171,7 @@ agentkit/toolkit/volcengine/iam.py,sha256=S-pX_TLKucroLsJD_VnDJW29qXOhwaNLWLjkc6
171
171
  agentkit/toolkit/volcengine/sts.py,sha256=b48ecAwHiRZ6Eu-YB-mzDNXTxlXqvagdA1J3lD8Bltg,2780
172
172
  agentkit/toolkit/volcengine/services/__init__.py,sha256=nUjkiE185nhc_94_F7JwaKoUD650OPM5TIl1BXPK7io,1000
173
173
  agentkit/toolkit/volcengine/services/cr_service.py,sha256=Oc2_4ZrnhVKKBGi-ECJ2CeApfz8aTmGVH0LyQodX6xk,21769
174
- agentkit/toolkit/volcengine/services/tos_service.py,sha256=zDcdAT6KCj99n8uDPDNMjZeuxd_z1zKWy1m1LxQSPOc,12132
174
+ agentkit/toolkit/volcengine/services/tos_service.py,sha256=5MHOBXku1BI-IskFkd_hkOu-Yt6Imy1gDX15a1f5tFo,13101
175
175
  agentkit/toolkit/volcengine/utils/__init__.py,sha256=rAOox1vmuWAOBBBAZrTpWZ_p6uF3OZzlBW1ZSzvnXUw,795
176
176
  agentkit/toolkit/volcengine/utils/project_archiver.py,sha256=7cH7r3ip35N1kyl_1lajVPAXg7Xo4-rj6dffMWHvjmw,15861
177
177
  agentkit/utils/__init__.py,sha256=UZq8sD4IUzT9KHy4Evv8wh2mWDikDH5pKZeYHiSbOmw,1176
@@ -181,9 +181,9 @@ agentkit/utils/misc.py,sha256=FXMlcupj3KzxfJvMYFp0uTQk3FRMx8FiEXkYiy-UQ8w,3437
181
181
  agentkit/utils/request.py,sha256=IVoat3EavR9rQ_fXi0eA2rZPCJ9lVZAXXn7uIIX6bY4,1614
182
182
  agentkit/utils/template_utils.py,sha256=Qjg9V6dEpjAd_yYezIIPwuDsDeeMmp6XTMn5ZECifNc,6336
183
183
  agentkit/utils/ve_sign.py,sha256=nrYiS2bYncvWKQVpVMzwYwPDfkA0OJS7LO9l_wfW0xc,9310
184
- agentkit_sdk_python-0.5.8.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
185
- agentkit_sdk_python-0.5.8.dist-info/METADATA,sha256=zxOX15B6uFL51GVdKkSO3OxMJeHqCrbrZUBW66la_OE,19394
186
- agentkit_sdk_python-0.5.8.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
187
- agentkit_sdk_python-0.5.8.dist-info/entry_points.txt,sha256=fhzZUsvsLXeB4mPaa0SBQiTBqFT404uDAKPaePAOUAE,58
188
- agentkit_sdk_python-0.5.8.dist-info/top_level.txt,sha256=ipy8JF-QQ-V0C1oRFLxsyaW8zwrasfJ-zjAh9vgOc7U,9
189
- agentkit_sdk_python-0.5.8.dist-info/RECORD,,
184
+ agentkit_sdk_python-0.5.9.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
185
+ agentkit_sdk_python-0.5.9.dist-info/METADATA,sha256=qIGOAfONb61aSKo7ol4qtZFsEdMHz9exXSaKHbcj5QE,19394
186
+ agentkit_sdk_python-0.5.9.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
187
+ agentkit_sdk_python-0.5.9.dist-info/entry_points.txt,sha256=fhzZUsvsLXeB4mPaa0SBQiTBqFT404uDAKPaePAOUAE,58
188
+ agentkit_sdk_python-0.5.9.dist-info/top_level.txt,sha256=ipy8JF-QQ-V0C1oRFLxsyaW8zwrasfJ-zjAh9vgOc7U,9
189
+ agentkit_sdk_python-0.5.9.dist-info/RECORD,,