Complete "Sending large follow-up messages" pattern documentation
Add new pattern showing how to combine `updateModelContext()` with `sendMessage()` when data exceeds message size limits. The example demonstrates offloading a large transcript to model context first, then sending a brief trigger message. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
89653cbb7a
commit
e626b84d44
1 changed files with 36 additions and 15 deletions
|
|
@ -64,6 +64,12 @@ Use {@link app!App.updateModelContext updateModelContext} to keep the model info
|
|||
|
||||
{@includeCode ../src/app.examples.ts#App_updateModelContext_appState}
|
||||
|
||||
## Sending large follow-up messages
|
||||
|
||||
When you need to send more data than fits in a message, use {@link app!App.updateModelContext updateModelContext} to set the context first, then {@link app!App.sendMessage sendMessage} with a brief prompt to trigger a response:
|
||||
|
||||
{@includeCode ../src/app.examples.ts#App_sendMessage_withLargeContext}
|
||||
|
||||
## Persisting widget state
|
||||
|
||||
To persist widget state across conversation reloads (e.g., current page in a PDF viewer, camera position in a map), use [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) with a stable identifier provided by the server.
|
||||
|
|
|
|||
Loading…
Reference in a new issue