diff --git a/guardrails/guard.py b/guardrails/guard.py index 38fae77d0..0fc2d89ac 100644 --- a/guardrails/guard.py +++ b/guardrails/guard.py @@ -584,6 +584,7 @@ def __call( *args, **kwargs, ): + llm_api_str = f"{llm_api.__module__}.{llm_api.__name__}" if llm_api else "None" if metadata is None: metadata = {} if full_schema_reask is None: @@ -598,7 +599,7 @@ def __call( attributes=[ ("guard_id", self._guard_id), ("user_id", self._user_id), - ("llm_api", llm_api.__name__ if llm_api else "None"), + ("llm_api", llm_api_str), ( "custom_reask_prompt", self.rail.output_schema.reask_prompt_template is not None, @@ -932,6 +933,7 @@ def __parse( *args, **kwargs, ): + llm_api_str = f"{llm_api.__module__}.{llm_api.__name__}" if llm_api else "None" final_num_reasks = ( num_reasks if num_reasks is not None else 0 if llm_api is None else None ) @@ -942,7 +944,7 @@ def __parse( attributes=[ ("guard_id", self._guard_id), ("user_id", self._user_id), - ("llm_api", llm_api.__name__ if llm_api else "None"), + ("llm_api", llm_api_str), ( "custom_reask_prompt", self.rail.output_schema.reask_prompt_template is not None,