Skip to content

Commit e2cbb25

Browse files
committed
chore: add ToolCategory
Signed-off-by: Donnie Adams <[email protected]>
1 parent 09dec27 commit e2cbb25

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",
@@ -117,7 +126,7 @@ def __init__(self,
117126
agentGroup: list[ToolReference] = None,
118127
displayText: str = "",
119128
inputContext: list[InputContext] = None,
120-
toolCategory: str = "",
129+
toolCategory: ToolCategory = "",
121130
toolName: str = "",
122131
parentID: str = "",
123132
type: RunEventType = RunEventType.event,
@@ -144,6 +153,8 @@ def __init__(self,
144153
if isinstance(self.inputContext[i], dict):
145154
self.inputContext[i] = InputContext(**self.inputContext[i])
146155
self.toolCategory = toolCategory
156+
if isinstance(self.toolCategory, str):
157+
self.toolCategory = ToolCategory[self.toolCategory]
147158
self.toolName = toolName
148159
self.parentID = parentID
149160
self.type = type

0 commit comments

Comments
 (0)