Set model

Session.SetModel on the one SDK, pkg/abox.

Switch profile after boot (config.yaml name). Default openai-default; pass another name as os.Args[1]. Needs that provider’s key.

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/AdminTurnedDevOps/ABox/pkg/abox"
)

func main() {
	profile := "openai-default"
	if len(os.Args) > 1 {
		profile = os.Args[1]
	}
	ctx := context.Background()
	sess, err := abox.Open(ctx, abox.Options{})
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
	defer sess.Close()
	if err := sess.SetModel(ctx, profile); err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
	fmt.Println("using", profile)
	_, err = sess.Turn(ctx, "Name the model you are.", func(ev abox.Event) {
		if ev.Kind == "text" {
			fmt.Print(ev.Text)
		}
	})
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
	fmt.Println()
}