Skip to content

Fully qualify llm_api namespace path #764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions guardrails/guard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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,
Expand Down Expand Up @@ -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
)
Expand All @@ -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,
Expand Down
Loading