@zhivex-ai/sdk 1.25.2 → 1.26.0-next.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.
Files changed (2) hide show
  1. package/README.md +16 -0
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -81,3 +81,19 @@ runtime symbols with `getApiStability()` and review
81
81
  Repository and full documentation:
82
82
 
83
83
  - <https://github.com/Zhivex/zhivex-ai-sdk>
84
+
85
+ ## Reliable streaming
86
+
87
+ For long responses, opt into bounded tail replay:
88
+
89
+ ```ts
90
+ const stream = streamText({
91
+ model,
92
+ prompt: "Explain the design in detail.",
93
+ streamBuffer: { maxHistory: 4096, replayOverflow: "drop-oldest" }
94
+ });
95
+ for await (const text of stream.textStream) process.stdout.write(text);
96
+ const result = await stream.collect(); // Rejects on provider failure.
97
+ ```
98
+
99
+ Import `streamText` from `@zhivex-ai/sdk`; `model` is your provider-backed model. Active consumers receive ordered events; late subscribers receive only the retained tail. The default `replayOverflow: "error"` preserves full replay and fails beyond 4,096 retained events. `collect()` returns the complete result in either mode. The same `streamBuffer` options apply to object generation and agents. `maxSteps` must be a positive safe integer and defaults to one.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhivex-ai/sdk",
3
- "version": "1.25.2",
3
+ "version": "1.26.0-next.1",
4
4
  "description": "Unified high-level SDK for multi-provider AI workflows.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -72,6 +72,6 @@
72
72
  "access": "public"
73
73
  },
74
74
  "dependencies": {
75
- "@zhivex-ai/core": "~1.22.0"
75
+ "@zhivex-ai/core": "~1.23.0-next.1"
76
76
  }
77
77
  }