Skip to content

Commit e752419

Browse files
committed
rename to detail to be consistent with standards
1 parent f8f06e1 commit e752419

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

nemoguardrails/actions/llm/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ def _raise_llm_call_exception(
250250
context_parts.append(f"endpoint={endpoint_url}")
251251

252252
if context_parts:
253-
context_message = f"Error invoking LLM ({', '.join(context_parts)})"
254-
raise LLMCallException(exception, context_message=context_message) from exception
253+
detail = f"Error invoking LLM ({', '.join(context_parts)})"
254+
raise LLMCallException(exception, detail=detail) from exception
255255
else:
256256
raise LLMCallException(exception) from exception
257257

nemoguardrails/exceptions.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@ class LLMCallException(Exception):
5757
"""
5858

5959
inner_exception: Union[BaseException, str]
60-
context_message: Optional[str]
60+
detail: Optional[str]
6161

62-
def __init__(self, inner_exception: Union[BaseException, str], context_message: Optional[str] = None):
62+
def __init__(self, inner_exception: Union[BaseException, str], detail: Optional[str] = None):
6363
"""Initialize LLMCallException.
6464
6565
Args:
6666
inner_exception: The original exception that occurred
67-
context_message: Optional context to prepend (for example, the model name or endpoint)
67+
detail: Optional context to prepend (for example, the model name or endpoint)
6868
"""
69-
message = f"{context_message or 'LLM Call Exception'}: {str(inner_exception)}"
69+
message = f"{detail or 'LLM Call Exception'}: {str(inner_exception)}"
7070
super().__init__(message)
7171

7272
self.inner_exception = inner_exception
73-
self.context_message = context_message
73+
self.detail = detail

0 commit comments

Comments
 (0)