// Command skillexample demonstrates skills: reusable instruction+tool // bundles attached to an agent on demand — here the ready-made clock and // calc skills, which require tool use for time and arithmetic. package main import ( "context" "flag" "fmt" "log" "gitea.stevedudenhoeffer.com/steve/majordomo" "gitea.stevedudenhoeffer.com/steve/majordomo/agent" "gitea.stevedudenhoeffer.com/steve/majordomo/skill/calc" "gitea.stevedudenhoeffer.com/steve/majordomo/skill/clock" ) func main() { model := flag.String("model", "ollama-cloud/minimax-m3:cloud", "model spec") flag.Parse() m, err := majordomo.Parse(*model) if err != nil { log.Fatalf("parse: %v", err) } a := agent.New(m, "You are a precise assistant.") a.AddSkill(clock.New()) // time_now / time_convert + instructions a.AddSkill(calc.New()) // calculate + instructions res, err := a.Run(context.Background(), "How many minutes are left until midnight UTC? Use your tools, then show the calculation.") if err != nil { log.Fatalf("run: %v", err) } fmt.Println(res.Output) for _, step := range res.Steps { for _, r := range step.Results { fmt.Printf(" tool %s → %s\n", r.Name, r.Content) } } }