ai 7.0.61 → 7.0.63
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/CHANGELOG.md +15 -0
- package/dist/index.d.ts +9 -5
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +1 -1
- package/docs/02-foundations/02-providers-and-models.mdx +1 -0
- package/docs/03-ai-sdk-core/38-video-generation.mdx +16 -15
- package/docs/04-ai-sdk-ui/05-completion.mdx +21 -0
- package/docs/07-reference/01-ai-sdk-core/31-ui-message.mdx +4 -0
- package/docs/07-reference/02-ai-sdk-ui/02-use-completion.mdx +15 -2
- package/package.json +2 -2
- package/src/types/provider.ts +1 -1
- package/src/ui/process-ui-message-stream.ts +1 -0
- package/src/ui/ui-messages.ts +5 -0
- package/src/ui/use-completion.ts +4 -4
- package/src/ui/validate-ui-messages.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 7.0.63
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d0a5807: Preserve reasoning block IDs from UI message streams on reasoning UI parts.
|
|
8
|
+
- dcf33e8: Allow providers without reranking model support to be assigned to `Provider`.
|
|
9
|
+
- Updated dependencies [a4d386d]
|
|
10
|
+
- @ai-sdk/gateway@4.0.50
|
|
11
|
+
|
|
12
|
+
## 7.0.62
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- e0bcf52: feat(ui): add typed custom bodies to Completion APIs
|
|
17
|
+
|
|
3
18
|
## 7.0.61
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -257,7 +257,7 @@ type Provider = {
|
|
|
257
257
|
*
|
|
258
258
|
* @throws {NoSuchModelError} If no such model exists.
|
|
259
259
|
*/
|
|
260
|
-
rerankingModel(modelId: string): RerankingModel;
|
|
260
|
+
rerankingModel?(modelId: string): RerankingModel;
|
|
261
261
|
};
|
|
262
262
|
|
|
263
263
|
/**
|
|
@@ -1878,6 +1878,10 @@ type CustomContentUIPart = {
|
|
|
1878
1878
|
*/
|
|
1879
1879
|
type ReasoningUIPart = {
|
|
1880
1880
|
type: 'reasoning';
|
|
1881
|
+
/**
|
|
1882
|
+
* The reasoning part ID.
|
|
1883
|
+
*/
|
|
1884
|
+
id?: string;
|
|
1881
1885
|
/**
|
|
1882
1886
|
* The reasoning text.
|
|
1883
1887
|
*/
|
|
@@ -5761,7 +5765,7 @@ declare class TextStreamChatTransport<UI_MESSAGE extends UIMessage> extends Http
|
|
|
5761
5765
|
protected processResponseStream(stream: ReadableStream<Uint8Array<ArrayBufferLike>>): ReadableStream<UIMessageChunk>;
|
|
5762
5766
|
}
|
|
5763
5767
|
|
|
5764
|
-
type CompletionRequestOptions = {
|
|
5768
|
+
type CompletionRequestOptions<BODY extends object = object> = {
|
|
5765
5769
|
/**
|
|
5766
5770
|
* An optional object of headers to be passed to the API endpoint.
|
|
5767
5771
|
*/
|
|
@@ -5769,9 +5773,9 @@ type CompletionRequestOptions = {
|
|
|
5769
5773
|
/**
|
|
5770
5774
|
* An optional object to be passed to the API endpoint.
|
|
5771
5775
|
*/
|
|
5772
|
-
body?:
|
|
5776
|
+
body?: BODY;
|
|
5773
5777
|
};
|
|
5774
|
-
type UseCompletionOptions = {
|
|
5778
|
+
type UseCompletionOptions<BODY extends object = object> = {
|
|
5775
5779
|
/**
|
|
5776
5780
|
* The API endpoint that accepts a `{ prompt: string }` object and returns
|
|
5777
5781
|
* a stream of tokens of the AI completion response. Defaults to `/api/completion`.
|
|
@@ -5821,7 +5825,7 @@ type UseCompletionOptions = {
|
|
|
5821
5825
|
* })
|
|
5822
5826
|
* ```
|
|
5823
5827
|
*/
|
|
5824
|
-
body?:
|
|
5828
|
+
body?: BODY;
|
|
5825
5829
|
/**
|
|
5826
5830
|
* Streaming protocol that is used. Defaults to `data`.
|
|
5827
5831
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1143,7 +1143,7 @@ import {
|
|
|
1143
1143
|
} from "@ai-sdk/provider-utils";
|
|
1144
1144
|
|
|
1145
1145
|
// src/version.ts
|
|
1146
|
-
var VERSION = true ? "7.0.
|
|
1146
|
+
var VERSION = true ? "7.0.63" : "0.0.0-test";
|
|
1147
1147
|
|
|
1148
1148
|
// src/util/download/download.ts
|
|
1149
1149
|
var download = async ({
|
|
@@ -7028,6 +7028,7 @@ function processUIMessageStream({
|
|
|
7028
7028
|
case "reasoning-start": {
|
|
7029
7029
|
const reasoningPart = {
|
|
7030
7030
|
type: "reasoning",
|
|
7031
|
+
id: chunk.id,
|
|
7031
7032
|
text: "",
|
|
7032
7033
|
providerMetadata: chunk.providerMetadata,
|
|
7033
7034
|
state: "streaming"
|
|
@@ -11050,6 +11051,7 @@ var uiMessagesSchema = lazySchema2(
|
|
|
11050
11051
|
}),
|
|
11051
11052
|
z.object({
|
|
11052
11053
|
type: z.literal("reasoning"),
|
|
11054
|
+
id: z.string().optional(),
|
|
11053
11055
|
text: z.string(),
|
|
11054
11056
|
state: z.enum(["streaming", "done"]).optional(),
|
|
11055
11057
|
providerMetadata: providerMetadataSchema.optional()
|