OPENAI_API_KEY
PINECONE_API_KEY
PROMPTLAYER_API_KEY
variables
dictionary containing the values we want to pass in. Using these values, we’ll construct the full prompt then pass it to OpenAI to obtain a recipe suggestion.
I like {food}
, try using the text My favorite food is {food}
.
This simple change in the phrasing of the prompt can significantly alter the response from the AI. Using more affirmative language like “My favorite food is” rather than just “I like” puts more emphasis on the user’s preference. This signals to the AI that it should pay close attention to tailoring the suggestion to that specific food.
Prompt engineering involves systematically experimenting with different ways of phrasing the input prompt to find what works best. Some key aspects to tweak can include:
score()
method after making a request:
metadata()
method: