Skip to content

Commit ac74eb3

Browse files
os1maasofter
andauthored
Fix prompt string concatenation in OpenAI API example (#208)
Co-authored-by: Oleksandr Yaremchuk <[email protected]>
1 parent 57d8066 commit ac74eb3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

examples/openai_api.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
input_scanners = [Anonymize(vault), Toxicity(), TokenLimit(), PromptInjection()]
1919
output_scanners = [Deanonymize(vault), NoRefusal(), Relevance(), Sensitive()]
2020

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

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

0 commit comments

Comments
 (0)