Few-Shot Prompting

Few-Shot Prompting is a technique used to give the model a few examples of what you want it to do. This is done by using the "Message History" option and passing the examples as a list of strings. This can be done with any number of examples, but it's recommended to keep it to 1-3 examples for best results.

To take a very simple example, let's say you want it to act as a calculator and only respond with a number:

 [{ "role": "user", "content": "2+2" },   
  { "role": "assistant", "content": "4" },    
  { "role": "user", "content": "What's 5 times itself?" },    
  { "role": "assistant", "content": "25"}]

Without the examples, the model would likely respond with a sentence and explanation. given examples, it will understand that you want it to respond with a number.

Need more Help?

Please reach out to us through the live chat widget on the bottom right corner or feel free to book a call with us. We're more than excited to explore and help you with your use case!