add reasoning action
This commit is contained in:
33
action/reasoning.go
Normal file
33
action/reasoning.go
Normal file
@@ -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"},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user