diff --git a/src/promptflow-core/promptflow/core/__init__.py b/src/promptflow-core/promptflow/core/__init__.py index 6c9367f1089..f7eaf1ea61d 100644 --- a/src/promptflow-core/promptflow/core/__init__.py +++ b/src/promptflow-core/promptflow/core/__init__.py @@ -13,6 +13,7 @@ ModelConfiguration, OpenAIModelConfiguration, ) +import promptflow.core._errors as errors from ._version import __version__ @@ -30,5 +31,6 @@ "ModelConfiguration", "OpenAIModelConfiguration", "AzureOpenAIModelConfiguration", + "errors", "__version__", ] diff --git a/src/promptflow-core/promptflow/core/_errors.py b/src/promptflow-core/promptflow/core/_errors.py index f153b670f46..8981186e00f 100644 --- a/src/promptflow-core/promptflow/core/_errors.py +++ b/src/promptflow-core/promptflow/core/_errors.py @@ -234,6 +234,11 @@ def __init__(self, ex: OpenAIError, **kwargs): @property def message(self): return str(to_openai_error_message(self._ex)) + + @property + def inner_exception(self): + """Get the inner exception.""" + return self._ex @property def error_codes(self):