Skip to content

Commit 1ba9087

Browse files
author
liuhuiqi.7
committed
feat(vlm_for_e2e): error and warning code
Change-Id: Ia6e5143d7110dd0fb403781dc937f710f21dd28d
1 parent 1ec6fc8 commit 1ba9087

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

volcenginesdkarkruntime/_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def _load_cert_by_ak_sk(self, ep: str) -> str:
325325
resp: volcenginesdkark.GetEndpointCertificateResponse = self.api_instance.get_endpoint_certificate(
326326
get_endpoint_certificate_request)
327327
except ApiException as e:
328-
raise ArkAPIError("Getting Certificate failed: %s\n" % e)
328+
raise ArkAPIError("Getting end-to-end encryption certificate failed: %s\n" % e)
329329

330330
return resp.pca_instance_certificate
331331

volcenginesdkarkruntime/resources/chat/completions.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ def _process_messages(self, messages: Iterable[ChatCompletionMessageParam],
5959
if part["image_url"]["url"].startswith('data:'):
6060
part["image_url"]["url"] = f(part["image_url"]["url"])
6161
else:
62-
log.warning("image url is not supported end-to-end encryption")
62+
log.warning("end-to-end encryption is not supported for image url")
6363
else:
64-
raise TypeError("content type {} is not supported end-to-end encryption".
64+
raise TypeError("end-to-end encryption is not supported for content type {}".
6565
format(type(part)))
6666
else:
67-
raise TypeError("content type {} is not supported end-to-end encryption".
67+
raise TypeError("end-to-end encryption is not supported for content type {}".
6868
format(type(message.get('content'))))
6969

7070
def _encrypt(self, model: str, messages: Iterable[ChatCompletionMessageParam], extra_headers: Headers
@@ -196,12 +196,12 @@ def _process_messages(self, messages: Iterable[ChatCompletionMessageParam],
196196
if part["image_url"]["url"].startswith('data:'):
197197
part["image_url"]["url"] = f(part["image_url"]["url"])
198198
else:
199-
log.warning("image url is not supported end-to-end encryption")
199+
log.warning("end-to-end encryption is not supported for image url")
200200
else:
201-
raise TypeError("content type {} is not supported end-to-end encryption".
201+
raise TypeError("end-to-end encryption is not supported for content type {}".
202202
format(type(part)))
203203
else:
204-
raise TypeError("content type {} is not supported end-to-end encryption".
204+
raise TypeError("end-to-end encryption is not supported for content type {}".
205205
format(type(message.get('content'))))
206206

207207
def _encrypt(self, model: str, messages: Iterable[ChatCompletionMessageParam], extra_headers: Headers

0 commit comments

Comments
 (0)