diff --git a/gptscript/frame.py b/gptscript/frame.py index 9ba15da..f42ee08 100644 --- a/gptscript/frame.py +++ b/gptscript/frame.py @@ -18,6 +18,15 @@ class RunEventType(Enum): prompt = "prompt" +class ToolCategory(Enum): + provider = "provider", + credential = "credential", + context = "context", + input = "input", + output = "output", + none = "" + + class RunState(Enum): Creating = "creating", Running = "running", @@ -118,7 +127,7 @@ def __init__(self, currentAgent: ToolReference = None, displayText: str = "", inputContext: list[InputContext] = None, - toolCategory: str = "", + toolCategory: ToolCategory = ToolCategory.none, toolName: str = "", parentID: str = "", type: RunEventType = RunEventType.event, @@ -148,6 +157,8 @@ def __init__(self, if isinstance(self.inputContext[i], dict): self.inputContext[i] = InputContext(**self.inputContext[i]) self.toolCategory = toolCategory + if isinstance(self.toolCategory, str): + self.toolCategory = ToolCategory.none if self.toolCategory == "" else ToolCategory[self.toolCategory] self.toolName = toolName self.parentID = parentID self.type = type