One Shot Prompting
One Shot Prompting
If you add only one example to your prompt, the model will be able to perform the task with only one example. This is called one-shot prompting.
Examples of One-Shot Prompting
Write a poem about love, using the words 'heart,' 'soul,' and 'passion.'
Example:
Roses are red,
Violets are blue,
With all my heart,
I love you.
Write a Python function to calculate the factorial of a number, considering the input as a string.
Example:
def factorial(n: int) -> int:
if n == 0:
return 1
else:
return n * factorial(n - 1)
Translate the sentence from English to French: 'I love you.'
Example: 'Hello, world!' in French is 'Bonjour, monde!'