@@ -260,89 +260,3 @@ export function tool<
260260 function : fn ,
261261 } ;
262262}
263-
264- /**
265- * @deprecated Use `tool()` instead. This function is kept for backwards compatibility.
266- */
267- export const createTool = tool ;
268-
269- /**
270- * Creates a generator tool with streaming capabilities.
271- *
272- * @deprecated Use `tool()` with `eventSchema` instead. This function is kept for backwards compatibility.
273- *
274- * @example
275- * ```typescript
276- * // Instead of createGeneratorTool, use tool with eventSchema:
277- * const progressTool = tool({
278- * name: "process_data",
279- * inputSchema: z.object({ data: z.string() }),
280- * eventSchema: z.object({ progress: z.number() }),
281- * outputSchema: z.object({ result: z.string() }),
282- * execute: async function* (params) {
283- * yield { progress: 50 }; // typed as event
284- * yield { result: "done" }; // typed as output
285- * },
286- * });
287- * ```
288- */
289- export function createGeneratorTool <
290- TInput extends ZodObject < ZodRawShape > ,
291- TEvent extends ZodType ,
292- TOutput extends ZodType ,
293- > ( config : {
294- name : string ;
295- description ?: string ;
296- inputSchema : TInput ;
297- eventSchema : TEvent ;
298- outputSchema : TOutput ;
299- execute : (
300- params : z . infer < TInput > ,
301- context ?: TurnContext
302- ) => AsyncGenerator < z . infer < TEvent > | z . infer < TOutput > > ;
303- } ) : ToolWithGenerator < TInput , TEvent , TOutput > {
304- return tool ( config ) ;
305- }
306-
307- /**
308- * Creates a manual tool without an execute function.
309- *
310- * @deprecated Use `tool()` with `execute: false` instead. This function is kept for backwards compatibility.
311- *
312- * @example
313- * ```typescript
314- * // Instead of createManualTool, use tool with execute: false:
315- * const manualTool = tool({
316- * name: "external_api",
317- * inputSchema: z.object({ query: z.string() }),
318- * execute: false,
319- * });
320- * ```
321- */
322- export function createManualTool <
323- TInput extends ZodObject < ZodRawShape > ,
324- TOutput extends ZodType = ZodType < unknown > ,
325- > ( config : {
326- name : string ;
327- description ?: string ;
328- inputSchema : TInput ;
329- outputSchema ?: TOutput ;
330- } ) : ManualTool < TInput , TOutput > {
331- const fn : ManualTool < TInput , TOutput > [ "function" ] = {
332- name : config . name ,
333- inputSchema : config . inputSchema ,
334- } ;
335-
336- if ( config . description !== undefined ) {
337- fn . description = config . description ;
338- }
339-
340- if ( config . outputSchema !== undefined ) {
341- fn . outputSchema = config . outputSchema ;
342- }
343-
344- return {
345- type : ToolType . Function ,
346- function : fn ,
347- } ;
348- }
0 commit comments