Skip to content

update guardrails create to create sync guards by default and update … #1130

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 1 commit into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion guardrails/cli/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def generate_template_config(
guard_instantiations = []

for i, guard in enumerate(template["guards"]):
guard_instantiations.append(f"guard{i} = AsyncGuard.from_dict(guards[{i}])")
guard_instantiations.append(f"guard{i} = Guard.from_dict(guards[{i}])")
guard_instantiations = "\n".join(guard_instantiations)
# Interpolate variables
output_content = template_content.format(
Expand Down
2 changes: 1 addition & 1 deletion guardrails/cli/hub/template_config.py.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
import os
from guardrails import AsyncGuard, Guard
from guardrails import Guard
from guardrails.hub import {VALIDATOR_IMPORTS}

try:
Expand Down
4 changes: 2 additions & 2 deletions server_ci/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
import os
from guardrails import AsyncGuard
from guardrails import Guard

try:
file_path = os.path.join(os.getcwd(), "guard-template.json")
Expand All @@ -11,4 +11,4 @@
SystemExit(1)

# instantiate guards
guard0 = AsyncGuard.from_dict(guards[0])
guard0 = Guard.from_dict(guards[0])
Loading