Alberto_Umana
Databricks Employee
Databricks Employee

Hi @neha89 -

You can use below approach:

Databricks provides AI Functions that allow invoking large language models directly within SQL queries. Here’s how this approach works:

  • Define a Custom AI Function: You can define a SQL function using ai_query or similar built-in AI capabilities, which directly interact with a generative AI model (e.g., Databricks Foundation Models or OpenAI models).
  • Prompt Engineering: Build your classification prompt that receives Delta Table columns as input and generates the required classification (False Positive/True Positive).
  • Integrating with Delta Table: Use this SQL function to compute the classification and update the Delta Table
    1. Create an AI Function using ai_query.
    2. Apply the function in an UPDATE or SELECT statement for your Delta Table.
    3. Execute through standard SQL pipelines.

View solution in original post