Skip to content

Commit d7e47d3

Browse files
committed
chore: add ToolCategory
Signed-off-by: Donnie Adams <donnie@acorn.io>
1 parent 28ec619 commit d7e47d3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

gptscript/frame.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ class RunEventType(Enum):
1818
prompt = "prompt"
1919

2020

21+
class ToolCategory(Enum):
22+
ProviderToolCategory = "provider",
23+
CredentialToolCategory = "credential",
24+
ContextToolCategory = "context",
25+
InputToolCategory = "input",
26+
OutputToolCategory = "output",
27+
NoCategory = ""
28+
29+
2130
class RunState(Enum):
2231
Creating = "creating",
2332
Running = "running",
@@ -118,7 +127,7 @@ def __init__(self,
118127
currentAgent: ToolReference = None,
119128
displayText: str = "",
120129
inputContext: list[InputContext] = None,
121-
toolCategory: str = "",
130+
toolCategory: ToolCategory = ToolCategory.NoCategory,
122131
toolName: str = "",
123132
parentID: str = "",
124133
type: RunEventType = RunEventType.event,
@@ -148,6 +157,8 @@ def __init__(self,
148157
if isinstance(self.inputContext[i], dict):
149158
self.inputContext[i] = InputContext(**self.inputContext[i])
150159
self.toolCategory = toolCategory
160+
if isinstance(self.toolCategory, str):
161+
self.toolCategory = ToolCategory[self.toolCategory]
151162
self.toolName = toolName
152163
self.parentID = parentID
153164
self.type = type

0 commit comments

Comments
 (0)