Skip to content

Commit

Permalink
refactor(model_runtime/zhipuai_sdk): syntax style
Browse files Browse the repository at this point in the history
  • Loading branch information
ox01024 committed Sep 13, 2024
1 parent 1a0f708 commit a440709
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
from .__version__ import __version__
from ._client import ZhipuAI

from .core import (
ZhipuAIError,
APIStatusError,
APIRequestFailedError,
APIAuthenticationError,
APIReachLimitError,
APIConnectionError,
APIInternalError,
APIServerFlowExceedError,
APIReachLimitError,
APIRequestFailedError,
APIResponseError,
APIResponseValidationError,
APIConnectionError,
APIServerFlowExceedError,
APIStatusError,
APITimeoutError,
ZhipuAIError,
)
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
from __future__ import annotations

from typing import Union, Mapping
import os
from collections.abc import Mapping
from typing import Union

import httpx
from httpx import Timeout
from typing_extensions import override

from .core import _jwt_token
from .core import ZhipuAIError
from .core import HttpClient, ZHIPUAI_DEFAULT_MAX_RETRIES
from .core import NotGiven, NOT_GIVEN
from . import api_resource
import os
import httpx
from httpx import Timeout
from .core import NOT_GIVEN, ZHIPUAI_DEFAULT_MAX_RETRIES, HttpClient, NotGiven, ZhipuAIError, _jwt_token


class ZhipuAI(HttpClient):
Expand Down Expand Up @@ -41,7 +39,7 @@ def __init__(
if base_url is None:
base_url = os.environ.get("ZHIPUAI_BASE_URL")
if base_url is None:
base_url = f"https://open.bigmodel.cn/api/paas/v4"
base_url = "https://open.bigmodel.cn/api/paas/v4"
from .__version__ import __version__

super().__init__(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __init__(
def __repr__(self):
data_len = len(self._data) if self._data else 0
return (
f"Event(event={self._event}, data={self._data} ,data_length={data_len}, id={self._id}, retry={self._retry}" # noqa: E501
f"Event(event={self._event}, data={self._data} ,data_length={data_len}, id={self._id}, retry={self._retry}"
)

@property
Expand Down

0 comments on commit a440709

Please sign in to comment.