ai 3.4.4 → 3.4.5

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,17 @@
1
1
  # ai
2
2
 
3
+ ## 3.4.5
4
+
5
+ ### Patch Changes
6
+
7
+ - cd77c5d: feat (ai/core): add isContinued to steps
8
+ - Updated dependencies [cd77c5d]
9
+ - @ai-sdk/ui-utils@0.0.45
10
+ - @ai-sdk/react@0.0.61
11
+ - @ai-sdk/solid@0.0.48
12
+ - @ai-sdk/svelte@0.0.50
13
+ - @ai-sdk/vue@0.0.52
14
+
3
15
  ## 3.4.4
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1368,6 +1368,10 @@ type StepResult<TOOLS extends Record<string, CoreTool>> = {
1368
1368
  or "tool-result" steps.
1369
1369
  */
1370
1370
  readonly stepType: 'initial' | 'continue' | 'tool-result';
1371
+ /**
1372
+ True when there will be a continuation step with a continuation text.
1373
+ */
1374
+ readonly isContinued: boolean;
1371
1375
  };
1372
1376
 
1373
1377
  /**
@@ -1788,6 +1792,7 @@ type TextStreamPart<TOOLS extends Record<string, CoreTool>> = {
1788
1792
  usage: LanguageModelUsage$1;
1789
1793
  response: LanguageModelResponseMetadata;
1790
1794
  experimental_providerMetadata?: ProviderMetadata;
1795
+ isContinued: boolean;
1791
1796
  } | {
1792
1797
  type: 'finish';
1793
1798
  finishReason: FinishReason;
@@ -1917,7 +1922,7 @@ Callback that is called when the LLM response and all request tool executions
1917
1922
 
1918
1923
  The usage is the combined usage of all steps.
1919
1924
  */
1920
- onFinish?: (event: Omit<StepResult<TOOLS>, 'stepType'> & {
1925
+ onFinish?: (event: Omit<StepResult<TOOLS>, 'stepType' | 'isContinued'> & {
1921
1926
  /**
1922
1927
  Details for all steps.
1923
1928
  */
package/dist/index.d.ts CHANGED
@@ -1368,6 +1368,10 @@ type StepResult<TOOLS extends Record<string, CoreTool>> = {
1368
1368
  or "tool-result" steps.
1369
1369
  */
1370
1370
  readonly stepType: 'initial' | 'continue' | 'tool-result';
1371
+ /**
1372
+ True when there will be a continuation step with a continuation text.
1373
+ */
1374
+ readonly isContinued: boolean;
1371
1375
  };
1372
1376
 
1373
1377
  /**
@@ -1788,6 +1792,7 @@ type TextStreamPart<TOOLS extends Record<string, CoreTool>> = {
1788
1792
  usage: LanguageModelUsage$1;
1789
1793
  response: LanguageModelResponseMetadata;
1790
1794
  experimental_providerMetadata?: ProviderMetadata;
1795
+ isContinued: boolean;
1791
1796
  } | {
1792
1797
  type: 'finish';
1793
1798
  finishReason: FinishReason;
@@ -1917,7 +1922,7 @@ Callback that is called when the LLM response and all request tool executions
1917
1922
 
1918
1923
  The usage is the combined usage of all steps.
1919
1924
  */
1920
- onFinish?: (event: Omit<StepResult<TOOLS>, 'stepType'> & {
1925
+ onFinish?: (event: Omit<StepResult<TOOLS>, 'stepType' | 'isContinued'> & {
1921
1926
  /**
1922
1927
  Details for all steps.
1923
1928
  */
package/dist/index.js CHANGED
@@ -3265,7 +3265,8 @@ async function generateText({
3265
3265
  ...currentModelResponse.response,
3266
3266
  headers: (_d = currentModelResponse.rawResponse) == null ? void 0 : _d.headers
3267
3267
  },
3268
- experimental_providerMetadata: currentModelResponse.providerMetadata
3268
+ experimental_providerMetadata: currentModelResponse.providerMetadata,
3269
+ isContinued: nextStepType === "continue"
3269
3270
  };
3270
3271
  steps.push(currentStep);
3271
3272
  await (onStepFinish == null ? void 0 : onStepFinish(currentStep));
@@ -4205,7 +4206,8 @@ var DefaultStreamTextResult = class {
4205
4206
  usage: stepUsage,
4206
4207
  experimental_providerMetadata: stepProviderMetadata,
4207
4208
  logprobs: stepLogProbs,
4208
- response: stepResponse
4209
+ response: stepResponse,
4210
+ isContinued: nextStepType === "continue"
4209
4211
  });
4210
4212
  const stepResult = {
4211
4213
  stepType,
@@ -4218,7 +4220,8 @@ var DefaultStreamTextResult = class {
4218
4220
  logprobs: stepLogProbs,
4219
4221
  response: stepResponse,
4220
4222
  rawResponse: self.rawResponse,
4221
- experimental_providerMetadata: stepProviderMetadata
4223
+ experimental_providerMetadata: stepProviderMetadata,
4224
+ isContinued: nextStepType === "continue"
4222
4225
  };
4223
4226
  stepResults.push(stepResult);
4224
4227
  await (onStepFinish == null ? void 0 : onStepFinish(stepResult));
@@ -4494,7 +4497,8 @@ var DefaultStreamTextResult = class {
4494
4497
  usage: sendUsage ? {
4495
4498
  promptTokens: chunk.usage.promptTokens,
4496
4499
  completionTokens: chunk.usage.completionTokens
4497
- } : void 0
4500
+ } : void 0,
4501
+ isContinued: chunk.isContinued
4498
4502
  })
4499
4503
  );
4500
4504
  break;