@cloudflare/ai-chat 0.9.4 → 0.10.0

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/README.md CHANGED
@@ -102,7 +102,7 @@ Tools with an `execute` function run on the server automatically:
102
102
 
103
103
  ```typescript
104
104
  import { createWorkersAI } from "workers-ai-provider";
105
- import { streamText, convertToModelMessages, stepCountIs, tool } from "ai";
105
+ import { streamText, convertToModelMessages, isStepCount, tool } from "ai";
106
106
  import { z } from "zod";
107
107
 
108
108
  export class ChatAgent extends AIChatAgent {
@@ -122,7 +122,7 @@ export class ChatAgent extends AIChatAgent {
122
122
  }
123
123
  })
124
124
  },
125
- stopWhen: stepCountIs(5)
125
+ stopWhen: isStepCount(5)
126
126
  });
127
127
 
128
128
  return result.toUIMessageStreamResponse();
package/dist/index.d.ts CHANGED
@@ -33,7 +33,7 @@ import {
33
33
  SaveMessagesResult as SaveMessagesResult$1,
34
34
  createToolsFromClientSchemas
35
35
  } from "agents/chat";
36
- import { StreamTextOnFinishCallback, ToolSet, UIMessage } from "ai";
36
+ import { GenerateTextOnFinishCallback, ToolSet, UIMessage } from "ai";
37
37
 
38
38
  //#region src/index.d.ts
39
39
  type ChatRecoveryRetryData = {
@@ -826,7 +826,7 @@ declare class AIChatAgent<
826
826
  * @returns Response to send to the client or undefined
827
827
  */
828
828
  onChatMessage(
829
- _onFinish: StreamTextOnFinishCallback<ToolSet>,
829
+ _onFinish: GenerateTextOnFinishCallback<ToolSet>,
830
830
  _options?: OnChatMessageOptions
831
831
  ): Promise<Response | undefined>;
832
832
  /**