|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
3 | | -import os |
4 | 3 | from typing import TYPE_CHECKING, Any |
5 | 4 |
|
6 | 5 | from pydantic import BaseModel |
@@ -116,10 +115,7 @@ async def _acompletion( |
116 | 115 |
|
117 | 116 | model_inference = ModelInference( |
118 | 117 | model_id=params.model_id, |
119 | | - credentials=Credentials( |
120 | | - api_key=self.config.api_key, |
121 | | - url=self.config.api_base or os.getenv("WATSONX_SERVICE_URL"), |
122 | | - ), |
| 118 | + credentials=Credentials(api_key=self.config.api_key, url=self.config.api_base), |
123 | 119 | **(self.config.client_args if self.config.client_args else {}), |
124 | 120 | ) |
125 | 121 |
|
@@ -148,10 +144,8 @@ async def _alist_models(self, **kwargs: Any) -> Sequence[Model]: |
148 | 144 | Fetch available models from the /v1/models endpoint. |
149 | 145 | """ |
150 | 146 | client = WatsonxClient( |
151 | | - url=self.config.api_base or os.getenv("WATSONX_SERVICE_URL"), |
152 | | - credentials=Credentials( |
153 | | - api_key=self.config.api_key, url=self.config.api_base or os.getenv("WATSONX_SERVICE_URL") |
154 | | - ), |
| 147 | + url=self.config.api_base, |
| 148 | + credentials=Credentials(api_key=self.config.api_key, url=self.config.api_base), |
155 | 149 | **(self.config.client_args if self.config.client_args else {}), |
156 | 150 | ) |
157 | 151 | models_response = client.foundation_models.get_model_specs(**kwargs) |
|
0 commit comments