Skip to content

Commit 5b3aca8

Browse files
authored
Merge pull request #1130 from guardrails-ai/fix/server_config
update guardrails create to create sync guards by default and update …
2 parents d130f35 + 09853bf commit 5b3aca8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

guardrails/cli/create.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def generate_template_config(
118118
guard_instantiations = []
119119

120120
for i, guard in enumerate(template["guards"]):
121-
guard_instantiations.append(f"guard{i} = AsyncGuard.from_dict(guards[{i}])")
121+
guard_instantiations.append(f"guard{i} = Guard.from_dict(guards[{i}])")
122122
guard_instantiations = "\n".join(guard_instantiations)
123123
# Interpolate variables
124124
output_content = template_content.format(

guardrails/cli/hub/template_config.py.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import json
22
import os
3-
from guardrails import AsyncGuard, Guard
3+
from guardrails import Guard
44
from guardrails.hub import {VALIDATOR_IMPORTS}
55

66
try:

server_ci/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import json
22
import os
3-
from guardrails import AsyncGuard
3+
from guardrails import Guard
44

55
try:
66
file_path = os.path.join(os.getcwd(), "guard-template.json")
@@ -11,4 +11,4 @@
1111
SystemExit(1)
1212

1313
# instantiate guards
14-
guard0 = AsyncGuard.from_dict(guards[0])
14+
guard0 = Guard.from_dict(guards[0])

0 commit comments

Comments
 (0)