Skip to content

Commit

Permalink
updated example
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroEsquivel committed Sep 25, 2024
1 parent a48a4e7 commit b4eb516
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docs/concepts/validator_on_fail_actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ ${order}
${gr.complete_xml_suffix_v2}
"""

order = """I want a burger with large fries and a coke."""
order = """I want a burger with two large fries and a coke zero."""

# MinimumOneRange is a hypothetical custom validator that an integer > 0 is supplied
class Lineitem(BaseModel):
Expand All @@ -84,12 +84,11 @@ response = guard(
"content": prompt
}],
prompt_params={"order": order},
num_reasks=2,
)

print(response.validated_output)

# [{'item': 'burger', 'quantity': 1},
# {'item': 'fries', 'quantity': 1},
# {'item': 'coke', 'quantity': 1}]
# {'item': 'fries', 'quantity': 2},
# {'item': 'coke zero', 'quantity': 1}]
```

0 comments on commit b4eb516

Please sign in to comment.