chat Provider for text generation and other text functions, or an embedding Provider for text embeddings.
1. Configure and check a Provider
Use CREATE AI PROVIDER to register the endpoint and model. Check the resulting configuration with DESC AI PROVIDER.2. Grant access to the function and Provider
Give the calling role or userUSAGE on both the function and the Provider. See GRANT for the two statements. If you want callers to omit the Provider name, set a default for its type with SET DEFAULT AI PROVIDER.
3. Test with one input
As the calling user, pass a short prompt and the name of the chat Provider toai_complete. For embeddings, pass a short string and the name of the embedding Provider to ai_embed. Check the returned text or vector before running the function over table rows.
See Provider setup and SQL examples for both Provider types. To index and query the resulting embeddings, follow the vector search guide.