You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Handle direct string response from LLM as well as `.content` unwrap
* Support keyPath for useReactiveCell
* Fix empty string boolean test
* generateImage -> generateImageUrl
* Try 4.1 nano for JSON
* Clarify prompt structure
* Update LLM cache
## Important Note About useReactiveCell(keyPath: string[])
125
125
- **useReactiveCell is a React Hook** and must follow all React hook rules
126
126
- It should only be used for persistent state and must draw from the provided schema
127
127
- For any ephemeral state, use \`React.useState\`
128
128
- Only call useReactiveCell at the top level of your function components or custom hooks
129
129
- Do not call useReactiveCell inside loops, conditions, or nested functions
130
-
- useReactiveCell cannot be used outside of \`onReady\` components - it must be called during rendering
131
-
</use_doc>
130
+
</use_reactive_cell>
132
131
</charm_api>
133
132
134
133
<importing_libraries>
@@ -149,9 +148,10 @@ ${security()}
149
148
<guide>
150
149
# SDK Usage Guide
151
150
151
+
<persistent-reactive-state>
152
152
## 1. \`useReactiveCell\` Hook
153
153
154
-
The \`useReactiveCell\` hook binds to a reactive cell given key and returns a tuple \`[doc, setDoc]\`:
154
+
The \`useReactiveCell\` hook binds to a reactive cell given a key path and returns a tuple \`[doc, setDoc]\`:
155
155
156
156
Any keys from the view-model-schema are valid for useReactiveCell, any other keys will fail. Provide a default as the second argument, **do not set an initial value explicitly**.
157
157
@@ -175,12 +175,8 @@ For this schema:
175
175
\`\`\`jsx
176
176
function CounterComponent() {
177
177
// Correct: useReactiveCell called at top level of component
## Important Note About useReactiveCell(keyPath: string[])
496
511
- **useReactiveCell is a React Hook** and must follow all React hook rules
497
512
- It should only be used for persistent state and must draw from the provided schema
498
513
- For any ephemeral state, use \`React.useState\`
499
514
- Only call useReactiveCell at the top level of your function components or custom hooks
500
515
- Do not call useReactiveCell inside loops, conditions, or nested functions
501
-
- useReactiveCell cannot be used outside of \`onReady\` components - it must be called during rendering
502
516
503
517
## Library Usage
504
518
- Request additional libraries in \`onLoad\` by returning an array of module names
@@ -513,7 +527,7 @@ ${security()}
513
527
514
528
## 1. \`useReactiveCell\` Hook
515
529
516
-
The \`useReactiveCell\` hook binds to a reactive cell given key and returns a tuple \`[doc, setDoc]\`:
530
+
The \`useReactiveCell\` hook binds to a reactive cell given a key path and returns a tuple \`[doc, setDoc]\`:
517
531
518
532
Any keys from the schema are valid for useReactiveCell, any other keys will fail. Provide a default as the second argument, **do not set an initial value explicitly**.
0 commit comments