-
Notifications
You must be signed in to change notification settings - Fork 3.3k
How to create an inner decorator for tools? #1120
Copy link
Copy link
Closed as duplicate of#1233
Labels
P1Significant bug affecting many users, highly requested featureSignificant bug affecting many users, highly requested featureenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedquestionFurther information is requestedFurther information is requestedready for workEnough information for someone to start working onEnough information for someone to start working on
Milestone
Metadata
Metadata
Assignees
Labels
P1Significant bug affecting many users, highly requested featureSignificant bug affecting many users, highly requested featureenhancementRequest for a new feature that's not currently supportedRequest for a new feature that's not currently supportedquestionFurther information is requestedFurther information is requestedready for workEnough information for someone to start working onEnough information for someone to start working on
Question
What I'm trying to achieve:
I'm creating a decorator that reuses elicitation logics. So I can reuse some code to write less code! 😄
What I have tried:
then simply use it:
My expected bahaviour:
I'm expecting my tool_call not to send a response until I've accepted the elicitation (via some input or event)
Actual behaviour:
Without me responding, the tool_call returns the following object and skips my input
meta=None content=[TextContent(type='text', text='Error executing tool add: Context is not available outside of a request', annotations=None, meta=None)] structuredContent=None isError=TrueAdditional Context
It actually works fine by just remove the decorator layer, but I really wanna make it a decorator so I can write less code!
Sorry if it was a noob question, or perhaps what I'm trying to achieve is not reasonable, or perhaps this sdk just doesn't yet support inner decorator for tools, but I've spent a lot of time on this so any answer is welcome haha!
Love the awesome work y'all are doing, thank you!
sorry made a couple edits to make my post reads a bit clearer