Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Databricks Certified Generative AI Engineer Associate Exam - Topic 4 Question 27 Discussion

Actual exam question for Databricks's Databricks Certified Generative AI Engineer Associate exam
Question #: 27
Topic #: 4
[All Databricks Certified Generative AI Engineer Associate Questions]

All of the following are Python APIs used to query Databricks foundation models. When running in an interactive notebook, which of the following libraries does not automatically use the current session credentials?

Show Suggested Answer Hide Answer
Suggested Answer: B

When working within a Databricks notebook, several high-level SDKs are 'Databricks-aware.' The MLflow Deployments SDK (C) and the Databricks Python SDK (D) are designed to automatically look for the DATABRICKS_HOST and DATABRICKS_TOKEN environment variables provided by the notebook context. The OpenAI client (A), when configured for Databricks via Mosaic AI Gateway, also typically handles authentication via workspace integration in recent versions. However, the REST API via the requests library (B) is a generic Python HTTP client. It has no intrinsic knowledge of the Databricks environment. To use it, an engineer must manually extract the token (e.g., via dbutils.notebook.entry_point...) and explicitly pass it in the Authorization: Bearer <token> header of the request. Without this manual step, the requests library will fail with a 401 Unauthorized error.


Contribute your Thoughts:

0/2000 characters
Dulce
18 hours ago
I remember practicing a question similar to this, and I think the REST API via requests library might not use session credentials by default.
upvoted 0 times
...
Lino
6 days ago
I think the Databricks Python SDK uses the current session credentials automatically, but I'm not sure about the others.
upvoted 0 times
...

Save Cancel