This commit is contained in:
Eugene Yurtsev 2024-10-03 16:22:22 -04:00
parent 5ab96e8dcb
commit 55da3ae7a2
2 changed files with 8 additions and 4 deletions

View File

@ -95,10 +95,10 @@ class MinimaxCommon(BaseModel):
@model_validator(mode="after")
def post_init(self) -> Self:
"""Post initialization."""
self._client = _MinimaxEndpointClient(
host=self.minimax_api_host,
api_key=self.minimax_api_key,
group_id=self.minimax_group_id,
self._client = _MinimaxEndpointClient( # type: ignore
host=self.minimax_api_host, # type: ignore
api_key=self.minimax_api_key, # type: ignore
group_id=self.minimax_group_id, # type: ignore
)
return self

View File

@ -95,6 +95,10 @@ class SolarCommon(BaseModel):
@model_validator(mode="after")
def post_init(self) -> Self:
if not isinstance(self.solar_api_key, SecretStr):
raise ValueError(
f"solar_api_key must be specified. Got type: {type(self.solar_api_key)}"
)
self._client = _SolarClient(api_key=self.solar_api_key, base_url=self.base_url)
return self