Skip to content

Commit 85a00f1

Browse files
author
liuhuiqi.7
committed
feat(vlm_for_e2e): use warnings
Change-Id: Ib901fa8ae7053b59310f81e81b7c44c2e7e82ce5
1 parent cdd5ce3 commit 85a00f1

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

volcenginesdkarkruntime/_utils/_logs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ def setup_logging() -> None:
2222
_basic_config()
2323
logger.setLevel(logging.INFO)
2424
httpx_logger.setLevel(logging.INFO)
25-
_basic_config()
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
from .chat import Chat, AsyncChat
2-
from ..._utils._logs import setup_logging as _setup_logging
32

43
__all__ = ["Chat", "AsyncChat"]
5-
6-
_setup_logging()

volcenginesdkarkruntime/resources/chat/completions.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import Dict, List, Union, Iterable, Optional, Callable, Iterator, AsyncIterator
44

55
import httpx
6-
import logging
6+
import warnings
77
from typing_extensions import Literal
88

99
from ..._types import Body, Query, Headers
@@ -33,8 +33,6 @@
3333

3434
__all__ = ["Completions", "AsyncCompletions"]
3535

36-
log: logging.Logger = logging.getLogger(__name__)
37-
3836
class Completions(SyncAPIResource):
3937
@cached_property
4038
def with_raw_response(self) -> CompletionsWithRawResponse:
@@ -59,7 +57,7 @@ def _process_messages(self, messages: Iterable[ChatCompletionMessageParam],
5957
if part["image_url"]["url"].startswith('data:'):
6058
part["image_url"]["url"] = f(part["image_url"]["url"])
6159
else:
62-
log.warning("end-to-end encryption is not supported for image url, "
60+
warnings.warn("end-to-end encryption is not supported for image url, "
6361
"please use base64 image if you want encryption")
6462
else:
6563
raise TypeError("end-to-end encryption is not supported for content type {}".
@@ -197,7 +195,7 @@ def _process_messages(self, messages: Iterable[ChatCompletionMessageParam],
197195
if part["image_url"]["url"].startswith('data:'):
198196
part["image_url"]["url"] = f(part["image_url"]["url"])
199197
else:
200-
log.warning("end-to-end encryption is not supported for image url, "
198+
warnings.warn("end-to-end encryption is not supported for image url, "
201199
"please use base64 image if you want encryption")
202200
else:
203201
raise TypeError("end-to-end encryption is not supported for content type {}".

0 commit comments

Comments
 (0)