openai-cookbook icon indicating copy to clipboard operation
openai-cookbook copied to clipboard

add caveat around prompt injection.

Open Joshwani opened this issue 1 year ago • 2 comments

Documentation for https://github.com/openai/openai-cookbook/issues/157

  • adds similarity score threshold for ensuring enough relevant context is in the embeddings database before requesting a completion.
  • adds an example cell where the similarity threshold is not met.
  • adds an example cell of how one could co-opt the Q&A app by supplying relevant context to the prompt then injecting a negation statement.

Joshwani avatar Feb 28 '23 05:02 Joshwani

I'm doing a full rewrite of the example and I'll include some of the changes you suggest.

ted-at-openai avatar Mar 28 '23 23:03 ted-at-openai

Sounds good thanks!

Joshwani avatar Mar 28 '23 23:03 Joshwani

I rewrote the example and included a prompt injection example, as you suggested: https://github.com/openai/openai-cookbook/blob/main/examples/Question_answering_using_embeddings.ipynb

Will close this PR. Cheers.

ted-at-openai avatar May 18 '23 23:05 ted-at-openai