reordering

This commit is contained in:
Ettore Di Giacinto
2025-02-25 22:18:08 +01:00
parent d73fd545b2
commit 296734ba3b
46 changed files with 84 additions and 85 deletions

53
core/action/plan.go Normal file
View File

@@ -0,0 +1,53 @@
package action
import (
"context"
"github.com/sashabaranov/go-openai/jsonschema"
)
// PlanActionName is the name of the plan action
// used by the LLM to schedule more actions
const PlanActionName = "plan"
func NewPlan() *PlanAction {
return &PlanAction{}
}
type PlanAction struct{}
type PlanResult struct {
Subtasks []PlanSubtask `json:"subtasks"`
}
type PlanSubtask struct {
Action string `json:"action"`
Reasoning string `json:"reasoning"`
}
func (a *PlanAction) Run(context.Context, ActionParams) (string, error) {
return "no-op", nil
}
func (a *PlanAction) Definition() ActionDefinition {
return ActionDefinition{
Name: PlanActionName,
Description: "The assistant for solving complex tasks that involves calling more functions in sequence, replies with the action.",
Properties: map[string]jsonschema.Definition{
"subtasks": {
Type: jsonschema.Array,
Description: "The message to reply with",
Properties: map[string]jsonschema.Definition{
"action": {
Type: jsonschema.String,
Description: "The action to call",
},
"reasoning": {
Type: jsonschema.String,
Description: "The reasoning for calling this action",
},
},
},
},
Required: []string{"subtasks"},
}
}