Skip to content

Commit

Permalink
Fix prompt string concatenation in OpenAI API example
Browse files Browse the repository at this point in the history
  • Loading branch information
os1ma committed Jan 14, 2025
1 parent 242b9c0 commit 081b722
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions examples/openai_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
input_scanners = [Anonymize(vault), Toxicity(), TokenLimit(), PromptInjection()]
output_scanners = [Deanonymize(vault), NoRefusal(), Relevance(), Sensitive()]

prompt = "Make an SQL insert statement to add a new user to our database. Name is John Doe. Email is [email protected] "
"but also possible to contact him with [email protected] email. Phone number is 555-123-4567 and "
"the IP address is 192.168.1.100. And credit card number is 4567-8901-2345-6789. "
"He works in Test LLC."
prompt = (
"Make an SQL insert statement to add a new user to our database. Name is John Doe. Email is [email protected] "
"but also possible to contact him with [email protected] email. Phone number is 555-123-4567 and "
"the IP address is 192.168.1.100. And credit card number is 4567-8901-2345-6789. "
"He works in Test LLC."
)

sanitized_prompt, results_valid, results_score = scan_prompt(input_scanners, prompt)
if any(results_valid.values()) is False:
Expand Down

0 comments on commit 081b722

Please sign in to comment.