From 0f96ed624e208b36308ef120042e45a99557c8ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Morales?= Date: Tue, 29 Oct 2024 11:20:47 -0600 Subject: [PATCH] enh: warn when overriding model in Azure endpoint --- nbs/src/nixtla_client.ipynb | 3 ++- nixtla/nixtla_client.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nbs/src/nixtla_client.ipynb b/nbs/src/nixtla_client.ipynb index 94460f7d..d9fe5c0e 100644 --- a/nbs/src/nixtla_client.ipynb +++ b/nbs/src/nixtla_client.ipynb @@ -797,7 +797,8 @@ " return resp\n", "\n", " def _maybe_override_model(self, model: str) -> str:\n", - " if self._is_azure:\n", + " if self._is_azure and model != 'azureai':\n", + " warnings.warn(\"Azure endpoint detected, setting `model` to 'azureai'.\")\n", " model = 'azureai'\n", " return model\n", "\n", diff --git a/nixtla/nixtla_client.py b/nixtla/nixtla_client.py index 2298d21f..978ce0cc 100644 --- a/nixtla/nixtla_client.py +++ b/nixtla/nixtla_client.py @@ -730,7 +730,8 @@ def _make_partitioned_requests( return resp def _maybe_override_model(self, model: str) -> str: - if self._is_azure: + if self._is_azure and model != "azureai": + warnings.warn("Azure endpoint detected, setting `model` to 'azureai'.") model = "azureai" return model