ai 3.4.31 → 3.4.32

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # ai
2
2
 
3
+ ## 3.4.32
4
+
5
+ ### Patch Changes
6
+
7
+ - 6bb9e51: fix (ai/core): expose response.messages in streamText
8
+
3
9
  ## 3.4.31
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1775,7 +1775,17 @@ interface StreamTextResult<TOOLS extends Record<string, CoreTool>> {
1775
1775
  /**
1776
1776
  Additional response information from the last step.
1777
1777
  */
1778
- readonly response: Promise<LanguageModelResponseMetadataWithHeaders>;
1778
+ readonly response: Promise<LanguageModelResponseMetadata & {
1779
+ /**
1780
+ The response messages that were generated during the call. It consists of an assistant message,
1781
+ potentially containing tool calls.
1782
+
1783
+ When there are tool results, there is an additional tool message with the tool results that are available.
1784
+ If there are tools that do not have execute functions, they are not included in the tool results and
1785
+ need to be added separately.
1786
+ */
1787
+ messages: Array<CoreAssistantMessage | CoreToolMessage>;
1788
+ }>;
1779
1789
  /**
1780
1790
  A text stream that returns only the generated text deltas. You can use it
1781
1791
  as either an AsyncIterable or a ReadableStream. When an error occurs, the
package/dist/index.d.ts CHANGED
@@ -1775,7 +1775,17 @@ interface StreamTextResult<TOOLS extends Record<string, CoreTool>> {
1775
1775
  /**
1776
1776
  Additional response information from the last step.
1777
1777
  */
1778
- readonly response: Promise<LanguageModelResponseMetadataWithHeaders>;
1778
+ readonly response: Promise<LanguageModelResponseMetadata & {
1779
+ /**
1780
+ The response messages that were generated during the call. It consists of an assistant message,
1781
+ potentially containing tool calls.
1782
+
1783
+ When there are tool results, there is an additional tool message with the tool results that are available.
1784
+ If there are tools that do not have execute functions, they are not included in the tool results and
1785
+ need to be added separately.
1786
+ */
1787
+ messages: Array<CoreAssistantMessage | CoreToolMessage>;
1788
+ }>;
1779
1789
  /**
1780
1790
  A text stream that returns only the generated text deltas. You can use it
1781
1791
  as either an AsyncIterable or a ReadableStream. When an error occurs, the
package/dist/index.js CHANGED
@@ -4635,7 +4635,8 @@ var DefaultStreamTextResult = class {
4635
4635
  resolveRequest(stepRequest);
4636
4636
  resolveResponse({
4637
4637
  ...stepResponse,
4638
- headers: rawResponse == null ? void 0 : rawResponse.headers
4638
+ headers: rawResponse == null ? void 0 : rawResponse.headers,
4639
+ messages: responseMessages
4639
4640
  });
4640
4641
  resolveSteps(stepResults);
4641
4642
  resolveResponseMessages(responseMessages);