Add AI Model and chat with your data
Add an OpenAI model and chat with the NYC Taxi Trips dataset
Last updated
Add an OpenAI model and chat with the NYC Taxi Trips dataset
Last updated
An OpenAI API Platform account and API key is required.
Navigate to Code tab.
In Components sidebar, click Model Providers tab, and select OpenAI.
Enter the Model name.
Enter the Model ID, (e.g. gpt-4o
).
Set the OpenAI API Key secret
API keys and other secrets are securely stored and encrypted.
Insert tools: auto
in the params
section of the gpt-4o
Model to automatically connect datasets to the model.
The final Spicepod configuration in the editor should be as follows:
Click Save in the code toolbar and then Deploy in the popup card that appears in the bottom right to deploy the changes.
Navigate to Playground and select AI Chat in the sidebar.
Ask a question about the NYC Taxi Trips dataset in the chat. For example:
"What datasets are available?"
"What is the average fare amount of a taxi trip?"
Replace [API-KEY]
in the sample below with the app API Key and execute in a terminal.
🎉 Congratulations, you've now added an OpenAI model and can use it to ask questions of the NYC Taxi Trips dataset.
Continue to Next Steps to explore use-cases to do more with the Spice.ai Cloud Platform.
Need help? Ask a question, raise issues, and provide feedback to the Spice AI team on Discord.