ai 4.0.0-canary.10 → 4.0.0-canary.11
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 +7 -0
- package/README.md +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1069 -999
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1069 -999
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# ai
|
2
2
|
|
3
|
+
## 4.0.0-canary.11
|
4
|
+
|
5
|
+
### Major Changes
|
6
|
+
|
7
|
+
- f68d7b1: chore (ai/core): streamObject returns result immediately (no Promise)
|
8
|
+
- f967199: chore (ai/core): streamText returns result immediately (no Promise)
|
9
|
+
|
3
10
|
## 4.0.0-canary.10
|
4
11
|
|
5
12
|
### Major Changes
|
package/README.md
CHANGED
@@ -91,7 +91,7 @@ import { openai } from '@ai-sdk/openai';
|
|
91
91
|
export async function POST(req: Request) {
|
92
92
|
const { messages }: { messages: CoreMessage[] } = await req.json();
|
93
93
|
|
94
|
-
const result =
|
94
|
+
const result = streamText({
|
95
95
|
model: openai('gpt-4'),
|
96
96
|
system: 'You are a helpful assistant.',
|
97
97
|
messages,
|
package/dist/index.d.mts
CHANGED
@@ -891,7 +891,7 @@ interface StreamObjectResult<PARTIAL, RESULT, ELEMENT_STREAM> {
|
|
891
891
|
/**
|
892
892
|
Warnings from the model provider (e.g. unsupported settings)
|
893
893
|
*/
|
894
|
-
readonly warnings: CallWarning[] | undefined
|
894
|
+
readonly warnings: Promise<CallWarning[] | undefined>;
|
895
895
|
/**
|
896
896
|
The token usage of the generated response. Resolved when the response is finished.
|
897
897
|
*/
|
@@ -1066,7 +1066,7 @@ Callback that is called when the LLM response and the final object validation ar
|
|
1066
1066
|
currentDate?: () => Date;
|
1067
1067
|
now?: () => number;
|
1068
1068
|
};
|
1069
|
-
}):
|
1069
|
+
}): StreamObjectResult<DeepPartial<OBJECT>, OBJECT, never>;
|
1070
1070
|
/**
|
1071
1071
|
Generate an array with structured, typed elements for a given prompt and element schema using a language model.
|
1072
1072
|
|
@@ -1133,7 +1133,7 @@ Callback that is called when the LLM response and the final object validation ar
|
|
1133
1133
|
currentDate?: () => Date;
|
1134
1134
|
now?: () => number;
|
1135
1135
|
};
|
1136
|
-
}):
|
1136
|
+
}): StreamObjectResult<Array<ELEMENT>, Array<ELEMENT>, AsyncIterableStream<ELEMENT>>;
|
1137
1137
|
/**
|
1138
1138
|
Generate JSON with any schema for a given prompt using a language model.
|
1139
1139
|
|
@@ -1174,7 +1174,7 @@ Callback that is called when the LLM response and the final object validation ar
|
|
1174
1174
|
currentDate?: () => Date;
|
1175
1175
|
now?: () => number;
|
1176
1176
|
};
|
1177
|
-
}):
|
1177
|
+
}): StreamObjectResult<JSONValue, JSONValue, never>;
|
1178
1178
|
|
1179
1179
|
type Parameters = z.ZodTypeAny | Schema<any>;
|
1180
1180
|
type inferParameters<PARAMETERS extends Parameters> = PARAMETERS extends Schema<any> ? PARAMETERS['_type'] : PARAMETERS extends z.ZodTypeAny ? z.infer<PARAMETERS> : never;
|
@@ -1889,7 +1889,7 @@ Details for all steps.
|
|
1889
1889
|
generateId?: () => string;
|
1890
1890
|
currentDate?: () => Date;
|
1891
1891
|
};
|
1892
|
-
}):
|
1892
|
+
}): StreamTextResult<TOOLS>;
|
1893
1893
|
|
1894
1894
|
/**
|
1895
1895
|
* Experimental middleware for LanguageModelV1.
|
package/dist/index.d.ts
CHANGED
@@ -891,7 +891,7 @@ interface StreamObjectResult<PARTIAL, RESULT, ELEMENT_STREAM> {
|
|
891
891
|
/**
|
892
892
|
Warnings from the model provider (e.g. unsupported settings)
|
893
893
|
*/
|
894
|
-
readonly warnings: CallWarning[] | undefined
|
894
|
+
readonly warnings: Promise<CallWarning[] | undefined>;
|
895
895
|
/**
|
896
896
|
The token usage of the generated response. Resolved when the response is finished.
|
897
897
|
*/
|
@@ -1066,7 +1066,7 @@ Callback that is called when the LLM response and the final object validation ar
|
|
1066
1066
|
currentDate?: () => Date;
|
1067
1067
|
now?: () => number;
|
1068
1068
|
};
|
1069
|
-
}):
|
1069
|
+
}): StreamObjectResult<DeepPartial<OBJECT>, OBJECT, never>;
|
1070
1070
|
/**
|
1071
1071
|
Generate an array with structured, typed elements for a given prompt and element schema using a language model.
|
1072
1072
|
|
@@ -1133,7 +1133,7 @@ Callback that is called when the LLM response and the final object validation ar
|
|
1133
1133
|
currentDate?: () => Date;
|
1134
1134
|
now?: () => number;
|
1135
1135
|
};
|
1136
|
-
}):
|
1136
|
+
}): StreamObjectResult<Array<ELEMENT>, Array<ELEMENT>, AsyncIterableStream<ELEMENT>>;
|
1137
1137
|
/**
|
1138
1138
|
Generate JSON with any schema for a given prompt using a language model.
|
1139
1139
|
|
@@ -1174,7 +1174,7 @@ Callback that is called when the LLM response and the final object validation ar
|
|
1174
1174
|
currentDate?: () => Date;
|
1175
1175
|
now?: () => number;
|
1176
1176
|
};
|
1177
|
-
}):
|
1177
|
+
}): StreamObjectResult<JSONValue, JSONValue, never>;
|
1178
1178
|
|
1179
1179
|
type Parameters = z.ZodTypeAny | Schema<any>;
|
1180
1180
|
type inferParameters<PARAMETERS extends Parameters> = PARAMETERS extends Schema<any> ? PARAMETERS['_type'] : PARAMETERS extends z.ZodTypeAny ? z.infer<PARAMETERS> : never;
|
@@ -1889,7 +1889,7 @@ Details for all steps.
|
|
1889
1889
|
generateId?: () => string;
|
1890
1890
|
currentDate?: () => Date;
|
1891
1891
|
};
|
1892
|
-
}):
|
1892
|
+
}): StreamTextResult<TOOLS>;
|
1893
1893
|
|
1894
1894
|
/**
|
1895
1895
|
* Experimental middleware for LanguageModelV1.
|