Skip to content

Commit

Permalink
Merge pull request #35 from thedadams/add-tool-cat
Browse files Browse the repository at this point in the history
chore: add ToolCategory
  • Loading branch information
thedadams authored Jun 27, 2024
2 parents 28ec619 + 9332382 commit 4f10a78
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion gptscript/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4f10a78

Please sign in to comment.