@cartanova/qgrid-ai-sdk 2.6.11 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,10 +90,18 @@ const { output } = await generateText({
|
|
|
90
90
|
console.log(output.title, output.authors);
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
Schemas with a top-level `object` are forwarded to server
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
> **Note for Anthropic models:**
|
|
93
|
+
Schemas with a top-level `object` are forwarded to the server. If the top level is not an
|
|
94
|
+
`object` (e.g. array), the AI SDK falls back to client-side parsing and a warning is logged.
|
|
95
|
+
|
|
96
|
+
> **Note for Anthropic models:** enforcement differs by provider. OpenAI/codex constrains
|
|
97
|
+
> decoding to the schema, so non-conforming output is rare. The Anthropic route has no
|
|
98
|
+
> enforcement mechanism: qgrid delivers your original schema as prompt guidance at the end of
|
|
99
|
+
> the system prompt, Claude Code generates plain text, and the server only strips code fences.
|
|
100
|
+
> The reply is schema-guided JSON text, **not server-validated JSON** — validation happens in
|
|
101
|
+
> this SDK via your zod schema (`Output.object` does this automatically), and a non-conforming
|
|
102
|
+
> reply surfaces as an explicit validation error on your side instead of hidden server retries.
|
|
103
|
+
> Raw HTTP consumers calling the qgrid API without this SDK must validate the response
|
|
104
|
+
> themselves.
|
|
97
105
|
|
|
98
106
|
### Streaming
|
|
99
107
|
|