genie: return final summary text from _parse_attachments#443
Open
nisha2003 wants to merge 5 commits into
Open
Conversation
Contributor
|
@nisha2003 the openai_test failures are known to be breaking on master but could you look into fixing the failures for Linting / typechecking for integrations/langchain (pull_request)? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Genie.poll_for_resultwas surfacing only the trailing follow-up/clarifying question instead of the full answer for some Genie responses._parse_attachments(since #419) picked the first text attachment following the last query, but internally-created messages emit a follow-up question text attachment before the final summary. The follow-up has anattachment_id; the final summary text attachment has noattachment_id.This change makes
_parse_attachments:attachment_id— falling back to the first kept text attachment when no id-less attachment is present.Identifying the summary by the absence of
attachment_idmatches the agreed short-term approach from the incident discussion (the FinalSummaryAttachment is the only public-API attachment without an id).Tests
_parse_attachmentscase: follow-up question (withattachment_id) emitted before the id-less summary → the summary wins.tests/databricks_ai_bridge/test_genie.pysuite passes (75 passed).Context: ES-1953657. Supersedes the concat-all approach in #432.
This pull request and its description were written by Isaac.