Prerequisites
- Create an API key for authentication.
-
Save the API key to an environment variable:
-
Install LlamaIndex packages:
Prepare a script
-
Copy the following part of the script:
-
Add one of the following methods, depending on your use case:
Examples
Multi-message request
The script below adds a chat to the request and asks in the last message to write a poem:Prompt request with streaming output
The script below sends the promptAmsterdam is the capital of and returns the output that is printed out word by word: