
Ultimate access to all questions.
Deep dive into the quiz with AI chat providers.
We prepare a focused prompt with your quiz and certificate details so each AI can offer a more tailored, in-depth explanation.
Question: 22
You are developing an AI agent using Databricks for a customer support chatbot. To enhance its flexibility and efficiency, you decide to build prompt templates to expose available functions that the agent can call. The prompt must dynamically adjust based on user input and provide access to multiple functions like get_order_status, cancel_order, and return_order. Which of the following are correct practices when designing and using prompt templates to expose available functions in Databricks Generative AI agent development? (Select two)
A
Ensure the prompt template includes a section that describes the available functions for the agent to choose from.
B
Use placeholders in the prompt template to dynamically inject user input at runtime.
C
Hard-code all possible function options directly into the prompt template for consistency and security.
D
Construct the prompt template so that it always exposes every available function to the user, regardless of the context.
E
Avoid specifying functions in the prompt template to reduce complexity, letting the model infer which function to use.
Explanation:
A. Including a section that describes the available functions (e.g., get_order_status, cancel_order, return_order) ensures that the AI agent knows what actions it can take, making it more efficient in selecting the appropriate function based on the user's query. This helps guide the model and reduces ambiguity in handling specific requests.
B. Using placeholders in the prompt template to dynamically inject user input allows the system to adapt the prompt in real-time based on the specific information provided by the user. This ensures flexibility and customization, improving the agent's ability to generate relevant and context-aware responses.
Why not the other options?
C. Hard-coding all possible function options directly into the prompt template limits flexibility and can make the system less scalable or adaptable to new functions.
D. Exposing every available function regardless of context could overwhelm the user and increase the complexity of the model's decision-making process, leading to suboptimal results.
E. Avoiding the specification of functions in the prompt can lead to confusion and reduce the model's ability to execute specific tasks efficiently.
Thus, A and B are the best practices for building dynamic and efficient prompt templates for an AI agent in Databricks.