ai 4.1.51 → 4.1.53
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 +17 -0
- package/dist/index.d.mts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# ai
|
2
2
|
|
3
|
+
## 4.1.53
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- e1d3d42: feat (ai): expose raw response body in generateText and generateObject
|
8
|
+
- Updated dependencies [e1d3d42]
|
9
|
+
- @ai-sdk/provider@1.0.10
|
10
|
+
- @ai-sdk/provider-utils@2.1.11
|
11
|
+
- @ai-sdk/ui-utils@1.1.17
|
12
|
+
- @ai-sdk/react@1.1.21
|
13
|
+
|
14
|
+
## 4.1.52
|
15
|
+
|
16
|
+
### Patch Changes
|
17
|
+
|
18
|
+
- 5329a69: fix (ai/core): fix duplicated reasoning in streamText onFinish and messages
|
19
|
+
|
3
20
|
## 4.1.51
|
4
21
|
|
5
22
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
@@ -192,7 +192,7 @@ type LanguageModelResponseMetadata = {
|
|
192
192
|
*/
|
193
193
|
modelId: string;
|
194
194
|
/**
|
195
|
-
Response headers.
|
195
|
+
Response headers (available only for providers that use HTTP requests).
|
196
196
|
*/
|
197
197
|
headers?: Record<string, string>;
|
198
198
|
};
|
@@ -936,7 +936,12 @@ interface GenerateObjectResult<OBJECT> {
|
|
936
936
|
/**
|
937
937
|
Additional response information.
|
938
938
|
*/
|
939
|
-
readonly response: LanguageModelResponseMetadata
|
939
|
+
readonly response: LanguageModelResponseMetadata & {
|
940
|
+
/**
|
941
|
+
Response body (available only for providers that use HTTP requests).
|
942
|
+
*/
|
943
|
+
body?: unknown;
|
944
|
+
};
|
940
945
|
/**
|
941
946
|
Logprobs for the completion.
|
942
947
|
`undefined` if the mode does not support logprobs or if was not enabled.
|
@@ -1934,6 +1939,10 @@ interface GenerateTextResult<TOOLS extends ToolSet, OUTPUT> {
|
|
1934
1939
|
need to be added separately.
|
1935
1940
|
*/
|
1936
1941
|
messages: Array<CoreAssistantMessage | CoreToolMessage>;
|
1942
|
+
/**
|
1943
|
+
Response body (available only for providers that use HTTP requests).
|
1944
|
+
*/
|
1945
|
+
body?: unknown;
|
1937
1946
|
};
|
1938
1947
|
/**
|
1939
1948
|
Logprobs for the completion.
|
package/dist/index.d.ts
CHANGED
@@ -192,7 +192,7 @@ type LanguageModelResponseMetadata = {
|
|
192
192
|
*/
|
193
193
|
modelId: string;
|
194
194
|
/**
|
195
|
-
Response headers.
|
195
|
+
Response headers (available only for providers that use HTTP requests).
|
196
196
|
*/
|
197
197
|
headers?: Record<string, string>;
|
198
198
|
};
|
@@ -936,7 +936,12 @@ interface GenerateObjectResult<OBJECT> {
|
|
936
936
|
/**
|
937
937
|
Additional response information.
|
938
938
|
*/
|
939
|
-
readonly response: LanguageModelResponseMetadata
|
939
|
+
readonly response: LanguageModelResponseMetadata & {
|
940
|
+
/**
|
941
|
+
Response body (available only for providers that use HTTP requests).
|
942
|
+
*/
|
943
|
+
body?: unknown;
|
944
|
+
};
|
940
945
|
/**
|
941
946
|
Logprobs for the completion.
|
942
947
|
`undefined` if the mode does not support logprobs or if was not enabled.
|
@@ -1934,6 +1939,10 @@ interface GenerateTextResult<TOOLS extends ToolSet, OUTPUT> {
|
|
1934
1939
|
need to be added separately.
|
1935
1940
|
*/
|
1936
1941
|
messages: Array<CoreAssistantMessage | CoreToolMessage>;
|
1942
|
+
/**
|
1943
|
+
Response body (available only for providers that use HTTP requests).
|
1944
|
+
*/
|
1945
|
+
body?: unknown;
|
1937
1946
|
};
|
1938
1947
|
/**
|
1939
1948
|
Logprobs for the completion.
|
package/dist/index.js
CHANGED
@@ -2859,7 +2859,8 @@ async function generateObject({
|
|
2859
2859
|
request,
|
2860
2860
|
response: {
|
2861
2861
|
...response,
|
2862
|
-
headers: rawResponse == null ? void 0 : rawResponse.headers
|
2862
|
+
headers: rawResponse == null ? void 0 : rawResponse.headers,
|
2863
|
+
body: rawResponse == null ? void 0 : rawResponse.body
|
2863
2864
|
},
|
2864
2865
|
logprobs,
|
2865
2866
|
providerMetadata: resultProviderMetadata
|
@@ -3993,7 +3994,7 @@ async function generateText({
|
|
3993
3994
|
}),
|
3994
3995
|
tracer,
|
3995
3996
|
fn: async (span) => {
|
3996
|
-
var _a17, _b, _c, _d, _e, _f, _g, _h, _i;
|
3997
|
+
var _a17, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
3997
3998
|
const mode = {
|
3998
3999
|
type: "regular",
|
3999
4000
|
...prepareToolsAndToolChoice({ tools, toolChoice, activeTools })
|
@@ -4249,6 +4250,7 @@ async function generateText({
|
|
4249
4250
|
response: {
|
4250
4251
|
...currentModelResponse.response,
|
4251
4252
|
headers: (_i = currentModelResponse.rawResponse) == null ? void 0 : _i.headers,
|
4253
|
+
body: (_j = currentModelResponse.rawResponse) == null ? void 0 : _j.body,
|
4252
4254
|
messages: responseMessages
|
4253
4255
|
},
|
4254
4256
|
logprobs: currentModelResponse.logprobs,
|
@@ -4991,7 +4993,7 @@ var DefaultStreamTextResult = class {
|
|
4991
4993
|
let recordedStepText = "";
|
4992
4994
|
let recordedContinuationText = "";
|
4993
4995
|
let recordedFullText = "";
|
4994
|
-
|
4996
|
+
let stepReasoning = [];
|
4995
4997
|
let activeReasoningText = void 0;
|
4996
4998
|
let recordedStepSources = [];
|
4997
4999
|
const recordedSources = [];
|
@@ -5105,6 +5107,8 @@ var DefaultStreamTextResult = class {
|
|
5105
5107
|
recordedToolResults = [];
|
5106
5108
|
recordedStepText = "";
|
5107
5109
|
recordedStepSources = [];
|
5110
|
+
stepReasoning = [];
|
5111
|
+
activeReasoningText = void 0;
|
5108
5112
|
if (nextStepType !== "done") {
|
5109
5113
|
stepType = nextStepType;
|
5110
5114
|
}
|