@@ -11,8 +11,6 @@ import type {
1111 AISDKToolResult ,
1212 ExecuteConfig ,
1313 ExecuteOptions ,
14- Experimental_PreExecuteFunction ,
15- Experimental_ToolCreationOptions ,
1614 HttpExecuteConfig ,
1715 JsonDict ,
1816 JSONSchema ,
@@ -42,7 +40,6 @@ export class BaseTool {
4240 parameters : ToolParameters ;
4341 executeConfig : ExecuteConfig ;
4442 protected requestBuilder ?: RequestBuilder ;
45- protected experimental_preExecute ?: Experimental_PreExecuteFunction ;
4643 #exposeExecutionMetadata = true ;
4744 #headers: Record < string , string > ;
4845
@@ -88,7 +85,6 @@ export class BaseTool {
8885 parameters : ToolParameters ,
8986 executeConfig : ExecuteConfig ,
9087 headers ?: Record < string , string > ,
91- experimental_preExecute ?: Experimental_PreExecuteFunction ,
9288 ) {
9389 this . name = name ;
9490 this . description = description ;
@@ -98,7 +94,6 @@ export class BaseTool {
9894 if ( executeConfig . kind === 'http' ) {
9995 this . requestBuilder = new RequestBuilder ( executeConfig , this . #headers) ;
10096 }
101- this . experimental_preExecute = experimental_preExecute ;
10297 }
10398
10499 /**
@@ -157,15 +152,8 @@ export class BaseTool {
157152 // Convert string params to object
158153 const params = typeof inputParams === 'string' ? JSON . parse ( inputParams ) : inputParams || { } ;
159154
160- // Apply experimental preExecute function (either from tool creation or execution options)
161- let processedParams = params ;
162-
163- if ( this . experimental_preExecute ) {
164- processedParams = await this . experimental_preExecute ( params ) ;
165- }
166-
167- // Execute the request directly with processed parameters
168- return await this . requestBuilder . execute ( processedParams , options ) ;
155+ // Execute the request directly with parameters
156+ return await this . requestBuilder . execute ( params , options ) ;
169157 } catch ( error ) {
170158 if ( error instanceof StackOneError ) {
171159 throw error ;
@@ -321,46 +309,8 @@ export class Tools implements Iterable<BaseTool> {
321309 /**
322310 * Get a tool by name
323311 */
324- getTool ( name : string , options ?: Experimental_ToolCreationOptions ) : BaseTool | undefined {
325- const originalTool = this . tools . find ( ( tool ) => tool . name === name ) ;
326- if ( ! originalTool ) {
327- return undefined ;
328- }
329-
330- // If no experimental options provided, return original tool
331- if ( ! options ?. experimental_schemaOverride && ! options ?. experimental_preExecute ) {
332- return originalTool ;
333- }
334-
335- // Create a new tool with experimental schema override and preExecute
336- let parameters = originalTool . parameters ;
337-
338- // Apply schema override if provided
339- if ( options . experimental_schemaOverride ) {
340- parameters = options . experimental_schemaOverride ( originalTool . parameters ) ;
341- }
342-
343- // Create new tool instance with modified schema and preExecute function
344- if ( originalTool instanceof StackOneTool ) {
345- const newTool = new StackOneTool (
346- originalTool . name ,
347- originalTool . description ,
348- parameters ,
349- originalTool . executeConfig ,
350- originalTool . getHeaders ( ) ,
351- options . experimental_preExecute ,
352- ) ;
353- return newTool ;
354- }
355- const newTool = new BaseTool (
356- originalTool . name ,
357- originalTool . description ,
358- parameters ,
359- originalTool . executeConfig ,
360- originalTool . getHeaders ( ) ,
361- options . experimental_preExecute ,
362- ) ;
363- return newTool ;
312+ getTool ( name : string ) : BaseTool | undefined {
313+ return this . tools . find ( ( tool ) => tool . name === name ) ;
364314 }
365315
366316 /**
0 commit comments