Extraction
Import generateText
from AI SDK and call it.
Import the OpenAI provider and define your model.
Pass in a prompt. In this case, we want to extract all the names mentioned in the essay.
Now, let's log the resulting text generation to the console.
Run the script
Play around with the prompt to ask for different things like, "What is the key takeaway of this piece in 50 words?"
Play around with a different model to see how the response changes.
Keep playing around with the prompt. Ask for different things and see how the model responds. You can also try different models to see how the response changes.