Skip to content

Commit 4f10a78

Browse files
authored
Merge pull request #35 from thedadams/add-tool-cat
chore: add ToolCategory
2 parents 28ec619 + 9332382 commit 4f10a78

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+
provider = "provider",
23+
credential = "credential",
24+
context = "context",
25+
input = "input",
26+
output = "output",
27+
none = ""
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.none,
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.none if self.toolCategory == "" else ToolCategory[self.toolCategory]
151162
self.toolName = toolName
152163
self.parentID = parentID
153164
self.type = type

0 commit comments

Comments
 (0)