File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -149,9 +149,17 @@ export namespace ToolRegistry {
149149 } )
150150 . map ( async ( t ) => {
151151 using _ = log . time ( t . id )
152+ const tool = await t . init ( { agent } )
153+ const output = {
154+ description : tool . description ,
155+ parameters : tool . parameters ,
156+ }
157+ await Plugin . trigger ( "tool.definition" , { toolID : t . id } , output )
152158 return {
153159 id : t . id ,
154- ...( await t . init ( { agent } ) ) ,
160+ ...tool ,
161+ description : output . description ,
162+ parameters : output . parameters ,
155163 }
156164 } ) ,
157165 )
Original file line number Diff line number Diff line change @@ -224,4 +224,8 @@ export interface Hooks {
224224 input : { sessionID : string ; messageID : string ; partID : string } ,
225225 output : { text : string } ,
226226 ) => Promise < void >
227+ /**
228+ * Modify tool definitions (description and parameters) sent to LLM
229+ */
230+ "tool.definition" ?: ( input : { toolID : string } , output : { description : string ; parameters : any } ) => Promise < void >
227231}
You can’t perform that action at this time.
0 commit comments