Databricks Demo Codes
This repository includes a notebook notebooks/GenerativeAI_Demo.py that
shows how to call Databricks foundation models from Python.
- Access to the Databricks foundation model APIs in your workspace.
- A cluster running Databricks Runtime 13.3 ML or later.
- Authentication configured for the Databricks SDK (for example using
environment variables
DATABRICKS_HOSTandDATABRICKS_TOKEN). databricks-sdkanddatabricks-genaiPython packages available on the cluster (they can be installed withpip install databricks-sdk databricks-genai).
- Import
notebooks/GenerativeAI_Demo.pyinto your workspace. - Attach the notebook to a cluster that meets the prerequisites.
- Run the notebook cells to authenticate and generate text using the configured foundation model.