From 56ceedb4fb25703c02cbb6fb5ab3d8c124484091 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Mon, 1 Apr 2024 11:33:12 +0200 Subject: [PATCH] add reasoning action --- action/reasoning.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 action/reasoning.go diff --git a/action/reasoning.go b/action/reasoning.go new file mode 100644 index 0000000..1ee48dd --- /dev/null +++ b/action/reasoning.go @@ -0,0 +1,33 @@ +package action + +import ( + "github.com/sashabaranov/go-openai/jsonschema" +) + +func NewReasoning() *ReasoningAction { + return &ReasoningAction{} +} + +type ReasoningAction struct{} + +type ReasoningResponse struct { + Reasoning string `json:"reasoning"` +} + +func (a *ReasoningAction) Run(ActionParams) (string, error) { + return "no-op", nil +} + +func (a *ReasoningAction) Definition() ActionDefinition { + return ActionDefinition{ + Name: "think", + Description: "try to understand what's the best thing to do", + Properties: map[string]jsonschema.Definition{ + "reasoning": { + Type: jsonschema.String, + Description: "A detailed reasoning on what would you do in this situation.", + }, + }, + Required: []string{"reasoning"}, + } +}