File size: 901 Bytes
8157183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b3c76c7
8157183
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

__all__ = ['AskUser']


class AskUser():
    dependencies = []

    inputSchema = {
        "name": "AskUser",
        "description": "Asks a question to the user and gets a response. Only use this when you need more clarification from the user on the question.",
        "parameters": {
            "type": "object",
            "properties": {
                "question": {
                    "type": "string",
                    "description": "The question to ask the user",
                },
            },
            "required": ["question"],
        }
    }

    def run(self, **kwargs):
        print("Running Ask User tool")
        question = kwargs.get("question")
        output = input(f"{question}: ")
        return {
            "status": "success",
            "message": "Ask User tool executed successfully",
            "output": output,
            "role": "user",
        }