In this article we show how the API can extract names and company domains from a list of emails.

We discuss the following parts of the prompt in this article:

  • Instruction - A description that helps the API understand what task we want to do

  • Examples - This shows the API how to take the input and create the output

  • Input data - The text we want the API to format

  • Separators - characters that separate sections

  • Temperature parameter

Extract the names and company domain from a list of emails.



names: bot1a




names: bo2a, bot9a, bot10a





Open this example in the Playground


The instruction is the first line of the prompt: “Extract the names and company domains from a list of emails.”


Our desired output is a list of names and company domains. so t wo examples are provided, which extract names and company domains from a list of emails. These examples show the format we want the API to present in the completion.


We use “###” as separators. A newline character could also be used, however the “###” acts as a stronger delimiter and can be used as a Stop Sequence.


The input section begins with “emails”. You can try this yourself by adding a list of comma separated email addresses after the final emails entry. When programmatically running this prompt you will need to add the word “names:” on a newline, after your list of emails, to ensure that the API does not generate additional email addresses.


There is no need for randomness or creativity in the completion so we use a temperature value of 0. This signals to the API to only generate content that is related to the text included in the prompt.

Did this answer your question?