update querying logic to avoid token use

This commit is contained in:
Sumit Jaiswal 2025-06-04 12:34:27 +05:30
parent 8de3feb53b
commit 1a4ae92502
No known key found for this signature in database
GPG key ID: A4604B39D64D6AEC

View file

@ -89,11 +89,11 @@ class WatsonXInferenceAdapter(Inference, ModelRegistryHelper):
HealthResponse: A dictionary containing the health status. HealthResponse: A dictionary containing the health status.
""" """
try: try:
model = self._get_client(self._config.model_id) client_model = self._get_client(self._config.model_id)
model.generate("test") client_model.get_details()
return HealthResponse(status=HealthStatus.OK) return HealthResponse(status=HealthStatus.OK)
except Exception as ex: except Exception as ex:
return HealthResponse(status=HealthStatus.ERROR, message=f"Health check failed: {str(ex)}") return HealthResponse(status=HealthStatus.ERROR, message=f"Health check failure reason: {str(ex)}")
async def completion( async def completion(
self, self,