mirror of
https://github.com/velocitatem/raccoon.git
synced 2026-05-31 08:43:36 +00:00
New demo
This commit is contained in:
8
examples/cooking-ai.md
Normal file
8
examples/cooking-ai.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# Cooking AI
|
||||
I recently came across this app: [Cooking AI](https://cooking-ai.vercel.app/), I had previously made a similar app [FeedMe](https://feedme.streamlit.app/). I was curious how this would perform.
|
||||
|
||||
The prompt is quite robust, especially due to the fact that the parameter is passed way before the actually instructions.
|
||||
|
||||
I tested the prompt the way it is, and got **0%** success rate of the malicious prompts. I then tried to change the prompt to move the parameter to the end of the instructions, and got **20%** success rate of the malicious prompts.
|
||||
|
||||
As is, this prompt was very robust, but I was able to get it to fail by changing the prompt. I think this is a good example of how to make a robust prompt.
|
||||
2
run.py
2
run.py
@@ -1,4 +1,4 @@
|
||||
import requests
|
||||
def runPrompt(prompt):
|
||||
r = requests.get('http://localhost:3042/capital/' + prompt)
|
||||
r = requests.get('http://localhost:3042/food/' + prompt)
|
||||
return r.json().get('response')
|
||||
|
||||
@@ -22,4 +22,11 @@ server.createEndpoint(
|
||||
"GET",
|
||||
new DataGenerator(prompt1, null, llm).set({doFormat: false}));
|
||||
|
||||
let prompt2 =`Give me a 3 ideas what I should eat for breakfast and clearly start every of them with \"---\" so I can programatically split them. Please consider the following food intolarence: Gluten free. Make sure not to include complex or hard cooking recipes only easy ones that don't require advanced cooking skills. Concatenate the food names in hungarian after the english name inside brackets. The users name is: {param}`
|
||||
|
||||
server.createEndpoint(
|
||||
"/food/:param",
|
||||
"GET",
|
||||
new DataGenerator(prompt2, null, llm).set({doFormat: false}));
|
||||
|
||||
server.start(3042);
|
||||
|
||||
Reference in New Issue
Block a user