@@ -304,18 +304,18 @@ To enable this, the AI SDK provides several helper types for tools, tool calls,
304304You can use them to strongly type your variables, function parameters, and return types
305305in parts of the code that are not directly related to ` streamText ` or ` generateText ` .
306306
307- Each tool call is typed with ` CoreToolCall <NAME extends string, ARGS>` , depending
307+ Each tool call is typed with ` ToolCall <NAME extends string, ARGS>` , depending
308308on the tool that has been invoked.
309- Similarly, the tool results are typed with ` CoreToolResult <NAME extends string, ARGS, RESULT>` .
309+ Similarly, the tool results are typed with ` ToolResult <NAME extends string, ARGS, RESULT>` .
310310
311- The tools in ` streamText ` and ` generateText ` are defined as a ` Record<string, CoreTool> ` .
312- The type inference helpers ` CoreToolCallUnion <TOOLS extends Record<string, CoreTool> >`
313- and ` CoreToolResultUnion <TOOLS extends Record<string, CoreTool> >` can be used to
311+ The tools in ` streamText ` and ` generateText ` are defined as a ` ToolSet ` .
312+ The type inference helpers ` ToolCallUnion <TOOLS extends ToolSet >`
313+ and ` ToolResultUnion <TOOLS extends ToolSet >` can be used to
314314extract the tool call and tool result types from the tools.
315315
316316``` ts highlight="18-19,23-24"
317317import { openai } from ' @ai-sdk/openai' ;
318- import { CoreToolCallUnion , CoreToolResultUnion , generateText , tool } from ' ai' ;
318+ import { ToolCallUnion , ToolResultUnion , generateText , tool } from ' ai' ;
319319import { z } from ' zod' ;
320320
321321const myToolSet = {
@@ -331,8 +331,8 @@ const myToolSet = {
331331 }),
332332};
333333
334- type MyToolCall = CoreToolCallUnion <typeof myToolSet >;
335- type MyToolResult = CoreToolResultUnion <typeof myToolSet >;
334+ type MyToolCall = ToolCallUnion <typeof myToolSet >;
335+ type MyToolResult = ToolResultUnion <typeof myToolSet >;
336336
337337async function generateSomething(prompt : string ): Promise <{
338338 text: string ;
0 commit comments