util.go

 1package ai
 2
 3import (
 4	"github.com/go-viper/mapstructure/v2"
 5)
 6
 7func ParseOptions[T any](options map[string]any, m *T) error {
 8	return mapstructure.Decode(options, m)
 9}
10
11func FloatOption(f float64) *float64 {
12	return &f
13}