Skip to content

Commit

Permalink
Merge pull request #1130 from guardrails-ai/fix/server_config
Browse files Browse the repository at this point in the history
update guardrails create to create sync guards by default and update …
  • Loading branch information
zsimjee authored Oct 18, 2024
2 parents d130f35 + 09853bf commit 5b3aca8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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])

0 comments on commit 5b3aca8

Please sign in to comment.