* chore: cleanup, identify goal from conversation when evaluting achievement Signed-off-by: mudler <mudler@localai.io> * change base cpu model Signed-off-by: mudler <mudler@localai.io> * this is not necessary anymore Signed-off-by: mudler <mudler@localai.io> * use 12b Signed-off-by: mudler <mudler@localai.io> * use openthinker, it's smaller * chore(tests): set timeout Signed-off-by: mudler <mudler@localai.io> * Enable reasoning in some of the tests Signed-off-by: mudler <mudler@localai.io> * docker compose unification, small changes Signed-off-by: mudler <mudler@localai.io> * Simplify Signed-off-by: mudler <mudler@localai.io> * Back at arcee-agent as default Signed-off-by: mudler <mudler@localai.io> * Better error handling during planning Signed-off-by: mudler <mudler@localai.io> * Ci: do not run jobs for every branch Signed-off-by: mudler <mudler@localai.io> --------- Signed-off-by: mudler <mudler@localai.io>
49 lines
1.1 KiB
Go
49 lines
1.1 KiB
Go
package action
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/mudler/LocalAGI/core/types"
|
|
"github.com/sashabaranov/go-openai/jsonschema"
|
|
)
|
|
|
|
// NewGoal creates a new intention action
|
|
// The inention action is special as it tries to identify
|
|
// a tool to use and a reasoning over to use it
|
|
func NewGoal() *GoalAction {
|
|
return &GoalAction{}
|
|
}
|
|
|
|
type GoalAction struct {
|
|
}
|
|
type GoalResponse struct {
|
|
Goal string `json:"goal"`
|
|
Achieved bool `json:"achieved"`
|
|
}
|
|
|
|
func (a *GoalAction) Run(context.Context, types.ActionParams) (types.ActionResult, error) {
|
|
return types.ActionResult{}, nil
|
|
}
|
|
|
|
func (a *GoalAction) Plannable() bool {
|
|
return false
|
|
}
|
|
|
|
func (a *GoalAction) Definition() types.ActionDefinition {
|
|
return types.ActionDefinition{
|
|
Name: "goal",
|
|
Description: "Check if the goal is achieved",
|
|
Properties: map[string]jsonschema.Definition{
|
|
"goal": {
|
|
Type: jsonschema.String,
|
|
Description: "The goal to check if it is achieved.",
|
|
},
|
|
"achieved": {
|
|
Type: jsonschema.Boolean,
|
|
Description: "Whether the goal is achieved",
|
|
},
|
|
},
|
|
Required: []string{"goal", "achieved"},
|
|
}
|
|
}
|