cancel
Showing results for 
Search instead for 
Did you mean: 
Generative AI
Explore discussions on generative artificial intelligence techniques and applications within the Databricks Community. Share ideas, challenges, and breakthroughs in this cutting-edge field.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve Genie's narrative text summary (final_summary) via API?

OliverMini
New Contributor

Dear Databricks Community,

I am trying to programmatically access the narrative text summary that Databricks Genie displays in the UI, but I cannot find it in the public API responses.

What I see in the UI: When I ask Genie a question, the UI displays a helpful narrative summary like:

 
"The top 10 records from the sales order lines table have been retrieved. Examples include:- OrderLineID: 231412, CustomerName: Example Customer, StockItemName: Example Stock Item, Quantity: 8, LineNetAmount: 252.0"

What I've tried:

  1. Using the public API endpoint: /api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}/messages/{message_id}
    • This returns attachments with query.description (e.g., "You want to see the top 10 sales order lines...") but NOT the full narrative summary
  2. Checked the Databricks SDK (WorkspaceClient().genie.start_conversation_and_wait())
    • Same issue - only returns query description, not the narrative text
  3. Used browser network inspection and found the text in: /ajax-api/2.0/data-rooms/{space_id}/conversations/{conversation_id}/messages/{message_id}
    • This endpoint returns attachments[].final_summary.result_summary with the full narrative
    • However, this endpoint requires CSRF tokens and is meant for browser use only (returns 403 error from Python)

What I have discovered: The narrative summary exists in a final_summary field that appears in the /ajax-api/ endpoint but not in the public /api/ endpoints.

Question: Is there a supported way to retrieve Genie's final_summary narrative text programmatically? Or is this feature only available through the web UI currently?

Thank you for the help!

1 REPLY 1

stbjelcevic
Databricks Employee
Databricks Employee

Hi @OliverMini ,

The “answer summary”/“final summary” shown in the UI is a newer attachment type and is not yet exposed in the public API. It is being tracked internally as a potential enhancement as there appears to be a good amount of demand for it, but I cannot guarantee if/when if will be added.

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now