refactor(cookbooks): answer with the chat library - #1264
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
vishxrad
added this pull request to stack #1262
September 29, 2026 08:51
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 29, 2026 09:37
fdd5171 to
8fa29a7
Compare
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 29, 2026 09:43
8fa29a7 to
b78c1b8
Compare
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 29, 2026 09:58
b78c1b8 to
dbdd078
Compare
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 29, 2026 10:01
dbdd078 to
352b1f4
Compare
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 29, 2026 10:11
352b1f4 to
09f8ed4
Compare
Base automatically changed from
visharad/cookbooks-run-tools
to
visharad/cookbooks-gateway-conversations
September 29, 2026 10:11
14 tasks done
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 29, 2026 11:12
09f8ed4 to
b3d8b90
Compare
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
2 times, most recently
from
September 29, 2026 11:28
350c26e to
d21b89f
Compare
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 29, 2026 11:28
350c26e to
d21b89f
Compare
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 29, 2026 12:49
d21b89f to
fe8af4c
Compare
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 29, 2026 14:12
fe8af4c to
b129b60
Compare
|
Asгнней |
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 30, 2026 07:46
a40d872 to
a48d83b
Compare
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 30, 2026 07:58
a48d83b to
4563cef
Compare
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 30, 2026 08:48
4563cef to
0a3bbdc
Compare
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 30, 2026 09:06
0a3bbdc to
e1ce4cb
Compare
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 30, 2026 09:12
e1ce4cb to
b10846e
Compare
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 30, 2026 09:21
b10846e to
76f8841
Compare
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 30, 2026 09:49
76f8841 to
49c904c
Compare
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 30, 2026 12:25
49c904c to
f270566
Compare
abhithesys
previously approved these changes
Sep 30, 2026
Base automatically changed from
visharad/cookbooks-gateway-conversations
to
main
September 30, 2026 14:03
The cookbooks built each library from string lookups into openuiLibrary, with a Stack root, plus FollowUpBlock and FollowUpItem borrowed from openuiChatLibrary. The chat library is the one made for Agent Interface answers and already has every component the cookbooks picked, so: - Document comparison and conversational analytics export openuiChatLibrary unchanged. - Booking assistant uses the chat library with its DatePicker replaced. - Document comparison drops its custom Sources component and passes the sources as the chat Card's second argument, which renders the same source strip. - Prompt examples and rules use a Card root instead of Stack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The example now exports React UI's chat library instead of building one with createLibrary(), so drop the @openuidev/react-lang reference and name the chat library under @openuidev/react-ui. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… chat library Document comparison now exports React UI's chat library, so drop its @openuidev/react-lang reference. Both pages name the chat library under @openuidev/react-ui; booking still uses react-lang for createLibrary() and its DatePicker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vishxrad
force-pushed
the
visharad/cookbooks-chat-library
branch
from
September 30, 2026 14:03
f270566 to
6f2fa8d
Compare
abhithesys
approved these changes
Sep 30, 2026
This branch was successfully deployed
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.
Stacked on #1258. The cookbooks' component libraries were built on the wrong base, so this switches all three to
openuiChatLibrary.Summary
openuiLibrarysubset. Each cookbook built its library from string lookups intoopenuiLibrary(["Stack", "Table", …].map((name) => openuiLibrary.components[name])), with aStackroot andFollowUpBlock/FollowUpItemborrowed from the chat library. The chat library is the one made for Agent Interface answers, and it already has every component the cookbooks picked.export { openuiChatLibrary as library } from "@openuidev/react-ui/genui-lib".DatePickeroverride on top of it:Object.values({ ...openuiChatLibrary.components, DatePicker }), with the chat library's root and component groups.Sourcescomponent. The chatCardtakessources({ title, sourceName, url }[]) as its second argument and renders the sameCardSourceProvider+Sourcesstrip thatsources.tsxwrapped, sosources.tsxis deleted.root = Card([...])(document comparison:Card([...], sources)), and the rules that namedStackor theSourcescomponent now name theCard.Card([...], sources)example in place of thesources.tsxsample. One line of that example is about 180 characters and scrolls sideways, since OpenUI Lang statements can't wrap.Why
componentsis aRecord<string, …>, so a typo compiles and then throwsCannot read properties of undefined (reading 'props')when the module loads.Stack'schildrenisany[]. The spec told the model nothing about what an answer can contain.Card's signature, including components outside the subset. Keeping the chat library's component groups makesgenerateSystemPrompt({ cloud: true })throw, because the groups name components outside the subset. So using the whole library is the clean option.What changes in behavior
Card, not a bareStack.Cardalways renders its sources strip last.onePerPagemerged two quotes from the same page because the strip keys its cards by URL. A prompt rule now asks for one item per page.generateSystemPrompt({ cloud: true, library })sends, and for a one-line question with no cookbook rules it reports 2,059 prompt tokens with the old document-comparison library and 7,249 with the chat library (usage.prompt_tokens). The spec sent with each request grows from about 6 KB to 55 KB.runTools()sends the system prompt with every completion, so a question that searches once pays the difference at least twice. The cookbook rules still name the components each answer uses and rule out forms and queries.Test plan
npm ciandnpm run verify(spec generation andnext buildwith type checking) in all three cookbooks at this PR's head, rebased on mainCardroot, andgenerateSystemPrompt({ cloud: true, library })accepts all three specsCardwith the table, two charts, the fiscal-year callout, follow-ups, and a sources strip with one card per page (NVIDIA p. 37, AMD p. 50, Intel p. 76). No console errors.DatePickeroverride still works. Submitting it renders the stay cards with photos. One transientsrc=""warning appeared while anImagestreamed; both libraries use the sameImagecomponent, so it isn't from this change.🤖 Generated with Claude Code