Scott/follow up fixes#386
Open
sagrimson wants to merge 15 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a structured followUpContext to track conversation history (original query and Q&A chain) for follow-up queries, replacing simple query string concatenation. It also defaults the target place to "Earth" when no explicit place is provided, stripping follow-up options in this scenario to prompt the user for a location. A critical issue was identified in route.ts where the resolved places array is not assigned back to parsed.places after fallback logic, which would prevent the default place from propagating to the client and downstream history nodes.
…llowups to send to api
…ample questions to return if the api returns no options, edit discovery skill to only show follow up if there is no data
6397485 to
70d2a1a
Compare
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.
Overview
Improves the follow-up question flow and related queries experience in DataWeaver. Previously, broad/exploratory queries triggered a follow-up disambiguation step instead of returning data directly, follow-up context (the user's original question and selected option) was lost between turns, and multi-place queries could emit multiple conflicting follow-ups. This PR restructures how follow-up context is passed through the pipeline, tightens the data discovery skill to prefer returning data over asking clarifying questions, consolidates per-place follow-ups into a single synthesized message, adds related query suggestions to card footers, strips dead hyperlinks for variables with no data, and introduces a shuffled pool of example prompts.
Changes Made
FollowUpContexttype that chains the original query and each follow-up Q&A pair, passing it from the client store through the API route into bothparseQueryandrunToolLoopso Gemini has full conversation history when resolving follow-ups.follow_upstream event type. Follow-ups are no longer embedded inside per-placeQueryResultobjects — they're collected across all places in the loop, merged into a single disambiguation message, and emitted once at the end of the stream. This fixes the issue of multiple follow-ups appearing for multi-place queries.nodeSetFollowUpstore action: Added a new store action to write the synthesized follow-up directly onto theHistoryNode, decoupling it from query results.PageHomenow readslatestNode.followUpdirectly instead of scanning through results.data_discovery.mdto only usefollowUpas a last-resort fallback (no data found / unintelligible / adversarial query) rather than a disambiguation step for broad queries. Clarified thatfollowUpis an orchestrator signal, not user-facing output. Added rules for data verification, DCID accuracy, place passing, and the newrelatedQueriesoutput field.relatedQuery(single string) →relatedQueries(string array) acrossCardChart,CardText, shape props, helpers, andsync_store. Card footers now render multiple related-query buttons in a vertical stack.footer.module.scssto use column flexbox with gap for stacked related-query buttons.render_result_html.tsnow identifies which variables actually have time-series data and converts#fetch=markdown links for empty variables into plain text — both in the table rows and in the introduction/coverage/insights prose.dismissedNodeIdstate inPageHomewith anodeDismissFollowUpstore action that removes the follow-up from the node, preventing reappearance on re-renders.Introinto a sharedconfigs/example_prompts.tspool of 20 prompts. The page server component shuffles and slices 4 at render time. The follow-up component also pulls from this pool as a fallback when the API returns no options."Earth"instead of using the raw query string as a place, and strips follow-up options so the model asks the user to specify a location.parse_query.mdandparse_query.tsto extract places from the full follow-up conversation context and to be more conservative about marking queries as follow-ups when they contain explicit places/topics.query_provider— results now always register cards, and follow-ups arrive separately via the new stream event.