Skip to content

Commit 344800c

Browse files
venjiangwoorui
andauthored
feat: add init type for cli (#979)
# Description The `yomo init` command adds a `type` flag to create different types of stream function. ``` yomo init -h Initialize a YoMo Stream function Usage: yomo init <app_name> [flags] Flags: -h, --help help for init -l, --lang string The language of Stream Function, support go and node (default "go") -t, --type string The type of Stream Function, support normal and llm (default "llm") ``` --------- Co-authored-by: woorui <[email protected]>
1 parent 9ed4c2e commit 344800c

File tree

31 files changed

+107
-97
lines changed

31 files changed

+107
-97
lines changed

cli/build.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var buildCmd = &cobra.Command{
3131
Long: "Build the YoMo Stream Function",
3232
Run: func(cmd *cobra.Command, args []string) {
3333
if err := parseFileArg(args, &opts, defaultSFNSourceFile); err != nil {
34-
log.FailureStatusEvent(os.Stdout, err.Error())
34+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
3535
os.Exit(127)
3636
// return
3737
}
@@ -41,15 +41,15 @@ var buildCmd = &cobra.Command{
4141
log.InfoStatusEvent(os.Stdout, "YoMo Stream Function parsing...")
4242
s, err := serverless.Create(&opts)
4343
if err != nil {
44-
log.FailureStatusEvent(os.Stdout, err.Error())
44+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
4545
os.Exit(127)
4646
// return
4747
}
4848
log.InfoStatusEvent(os.Stdout, "YoMo Stream Function parse done.")
4949
// build
5050
log.PendingStatusEvent(os.Stdout, "Building YoMo Stream Function instance...")
5151
if err := s.Build(true); err != nil {
52-
log.FailureStatusEvent(os.Stdout, err.Error())
52+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
5353
os.Exit(127)
5454
// return
5555
}

cli/dev.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var devCmd = &cobra.Command{
3333
FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true},
3434
Run: func(cmd *cobra.Command, args []string) {
3535
if err := parseFileArg(args, &opts, defaultSFNCompliedFile, defaultSFNWASIFile, defaultSFNSourceFile); err != nil {
36-
log.FailureStatusEvent(os.Stdout, err.Error())
36+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
3737
return
3838
}
3939
loadOptionsFromViper(viper.RunViper, &opts)
@@ -52,7 +52,7 @@ var devCmd = &cobra.Command{
5252

5353
s, err := serverless.Create(&opts)
5454
if err != nil {
55-
log.FailureStatusEvent(os.Stdout, err.Error())
55+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
5656
return
5757
}
5858
if !s.Executable() {
@@ -68,7 +68,7 @@ var devCmd = &cobra.Command{
6868
if ext := filepath.Ext(opts.Filename); ext == ".go" {
6969
log.PendingStatusEvent(os.Stdout, "Building YoMo Stream Function instance...")
7070
if err := s.Build(true); err != nil {
71-
log.FailureStatusEvent(os.Stdout, err.Error())
71+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
7272
os.Exit(127)
7373
}
7474
log.SuccessStatusEvent(os.Stdout, "YoMo Stream Function build successful!")
@@ -81,7 +81,7 @@ var devCmd = &cobra.Command{
8181
)
8282
log.InfoStatusEvent(os.Stdout, "Stream Function is running...")
8383
if err := s.Run(verbose); err != nil {
84-
log.FailureStatusEvent(os.Stdout, err.Error())
84+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
8585
return
8686
}
8787
},

cli/init.go

+20-16
Original file line numberDiff line numberDiff line change
@@ -29,39 +29,43 @@ import (
2929
"github.com/yomorun/yomo/pkg/log"
3030
)
3131

32-
var lang string
32+
var (
33+
sfnType string
34+
lang string
35+
)
3336

3437
// initCmd represents the init command
3538
var initCmd = &cobra.Command{
36-
Use: "init",
39+
Use: "init <app_name>",
3740
Short: "Initialize a YoMo Stream function",
3841
Long: "Initialize a YoMo Stream function",
3942
Run: func(cmd *cobra.Command, args []string) {
40-
name := opts.Name
43+
name := ""
4144
if len(args) >= 1 && args[0] != "" {
4245
name = args[0]
46+
opts.Name = name
4347
}
44-
4548
if name == "" {
46-
log.FailureStatusEvent(os.Stdout, "Please input your app name")
49+
log.FailureStatusEvent(os.Stdout, "Please input your app name, e.g. `yomo init my-app [-l go -t llm]`")
4750
return
4851
}
49-
5052
log.PendingStatusEvent(os.Stdout, "Initializing the Stream Function...")
5153
name = strings.ReplaceAll(name, " ", "_")
54+
5255
filename := filepath.Join(name, DefaultSFNSourceFile(lang))
5356
opts.Filename = filename
54-
// serverless setup
55-
err := serverless.Setup(&opts)
57+
58+
// create app source file
59+
fname := filepath.Join(name, DefaultSFNSourceFile(lang))
60+
contentTmpl, err := template.GetContent("init", sfnType, lang, false)
5661
if err != nil {
57-
log.FailureStatusEvent(os.Stdout, err.Error())
62+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
5863
return
5964
}
60-
// create app source file
61-
fname := filepath.Join(name, DefaultSFNSourceFile(lang))
62-
contentTmpl, err := template.GetContent("init", "", lang, false)
65+
// serverless setup
66+
err = serverless.Setup(&opts)
6367
if err != nil {
64-
log.FailureStatusEvent(os.Stdout, err.Error())
68+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
6569
return
6670
}
6771
if err := file.PutContents(fname, contentTmpl); err != nil {
@@ -70,10 +74,10 @@ var initCmd = &cobra.Command{
7074
}
7175
// create app test file
7276
testName := filepath.Join(name, DefaultSFNTestSourceFile(lang))
73-
testTmpl, err := template.GetContent("init", "", lang, true)
77+
testTmpl, err := template.GetContent("init", sfnType, lang, true)
7478
if err != nil {
7579
if !errors.Is(err, template.ErrUnsupportedTest) {
76-
log.FailureStatusEvent(os.Stdout, err.Error())
80+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
7781
return
7882
}
7983
} else {
@@ -98,6 +102,6 @@ var initCmd = &cobra.Command{
98102
func init() {
99103
rootCmd.AddCommand(initCmd)
100104

101-
initCmd.Flags().StringVarP(&opts.Name, "name", "n", "", "The name of Stream Function")
105+
initCmd.Flags().StringVarP(&sfnType, "type", "t", "llm", "The type of Stream Function, support normal and llm")
102106
initCmd.Flags().StringVarP(&lang, "lang", "l", "go", "The language of Stream Function, support go and node")
103107
}

cli/root.go

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ var rootCmd = &cobra.Command{
3636
Use: "yomo",
3737
Version: GetVersion(),
3838
PersistentPreRun: func(cmd *cobra.Command, args []string) {},
39-
// Run: func(cmd *cobra.Command, args []string) { },
4039
}
4140

4241
// Execute adds all child commands to the root command and sets flags appropriately.

cli/run.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var runCmd = &cobra.Command{
3737
Long: "Run a YoMo Stream Function",
3838
Run: func(cmd *cobra.Command, args []string) {
3939
if err := parseFileArg(args, &opts, defaultSFNCompliedFile, defaultSFNWASIFile, defaultSFNSourceFile, defaultSFNSourceTSFile); err != nil {
40-
log.FailureStatusEvent(os.Stdout, err.Error())
40+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
4141
return
4242
}
4343
loadOptionsFromViper(viper.RunViper, &opts)
@@ -50,12 +50,12 @@ var runCmd = &cobra.Command{
5050
// resolve serverless
5151
log.PendingStatusEvent(os.Stdout, "Creating YoMo Stream Function instance...")
5252
if err := parseZipperAddr(&opts); err != nil {
53-
log.FailureStatusEvent(os.Stdout, err.Error())
53+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
5454
return
5555
}
5656
s, err := serverless.Create(&opts)
5757
if err != nil {
58-
log.FailureStatusEvent(os.Stdout, err.Error())
58+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
5959
return
6060
}
6161
if !s.Executable() {
@@ -69,7 +69,7 @@ var runCmd = &cobra.Command{
6969
}
7070

7171
if err := s.Build(true); err != nil {
72-
log.FailureStatusEvent(os.Stdout, err.Error())
72+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
7373
os.Exit(127)
7474
}
7575

@@ -80,7 +80,7 @@ var runCmd = &cobra.Command{
8080
)
8181
log.InfoStatusEvent(os.Stdout, "Stream Function is running...")
8282
if err := s.Run(verbose); err != nil {
83-
log.FailureStatusEvent(os.Stdout, err.Error())
83+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
8484
return
8585
}
8686
},

cli/serve.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ var serveCmd = &cobra.Command{
6161
// config
6262
conf, err := pkgconfig.ParseConfigFile(config)
6363
if err != nil {
64-
log.FailureStatusEvent(os.Stdout, err.Error())
64+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
6565
return
6666
}
6767

@@ -87,9 +87,9 @@ var serveCmd = &cobra.Command{
8787
aiConfig, err := ai.ParseConfig(bridgeConf)
8888
if err != nil {
8989
if err == ai.ErrConfigNotFound {
90-
log.InfoStatusEvent(os.Stdout, err.Error())
90+
log.InfoStatusEvent(os.Stdout, "%s", err.Error())
9191
} else {
92-
log.FailureStatusEvent(os.Stdout, err.Error())
92+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
9393
return
9494
}
9595
}
@@ -105,7 +105,7 @@ var serveCmd = &cobra.Command{
105105
conf.Mesh,
106106
options...)
107107
if err != nil {
108-
log.FailureStatusEvent(os.Stdout, err.Error())
108+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
109109
return
110110
}
111111
zipper.Logger().Info("using config file", "file_path", config)
@@ -124,7 +124,7 @@ var serveCmd = &cobra.Command{
124124

125125
err := ai.Serve(aiConfig, ylog.Default(), source, reducer)
126126
if err != nil {
127-
log.FailureStatusEvent(os.Stdout, err.Error())
127+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
128128
return
129129
}
130130
}()
@@ -133,7 +133,7 @@ var serveCmd = &cobra.Command{
133133
// start the zipper
134134
err = zipper.ListenAndServe(ctx, listenAddr)
135135
if err != nil {
136-
log.FailureStatusEvent(os.Stdout, err.Error())
136+
log.FailureStatusEvent(os.Stdout, "%s", err.Error())
137137
return
138138
}
139139
},

cli/serverless/nodejs/runtime.go

+3
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ func (w *NodejsWrapper) InstallDeps() error {
228228
}
229229
// devDependencies
230230
cmd = exec.Command(w.npmPath, "install", "-D", "@types/node", "ts-node")
231+
cmd.Dir = w.workDir
232+
cmd.Stderr = os.Stderr
233+
cmd.Env = os.Environ()
231234
err = cmd.Run()
232235
if err != nil {
233236
return fmt.Errorf("run %s failed: %v", cmd.String(), err)

cli/template/template.go

+4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ func getTemplateFileName(command string, sfnType string, lang string, isTest boo
6060
if err != nil {
6161
return "", err
6262
}
63+
if lang == "node" && sfnType == "normal" {
64+
return "", errors.New("language node (-l node) only support type llm (-t llm)")
65+
}
66+
6367
sb := new(strings.Builder)
6468
sb.WriteString(lang)
6569
sb.WriteString("/")

cli/template/template_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ func TestGetTemplateFileName(t *testing.T) {
3636
lang: "node",
3737
isTest: true,
3838
},
39-
want: "node/init_normal_test.tmpl",
40-
wantErr: false,
39+
want: "",
40+
wantErr: true,
4141
},
4242
{
4343
name: "default_command_llm_go",

example/1-pipeline/go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ require (
2727
github.com/mattn/go-colorable v0.1.14 // indirect
2828
github.com/mattn/go-isatty v0.0.20 // indirect
2929
github.com/onsi/ginkgo/v2 v2.22.2 // indirect
30-
github.com/quic-go/quic-go v0.48.2 // indirect
30+
github.com/quic-go/quic-go v0.49.0 // indirect
3131
github.com/robfig/cron/v3 v3.0.1 // indirect
32-
github.com/sashabaranov/go-openai v1.36.1 // indirect
32+
github.com/sashabaranov/go-openai v1.37.0 // indirect
3333
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
3434
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
3535
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
@@ -45,7 +45,7 @@ require (
4545
go.uber.org/mock v0.5.0 // indirect
4646
golang.org/x/crypto v0.32.0 // indirect
4747
golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c // indirect
48-
golang.org/x/mod v0.22.0 // indirect
48+
golang.org/x/mod v0.23.0 // indirect
4949
golang.org/x/net v0.34.0 // indirect
5050
golang.org/x/sync v0.10.0 // indirect
5151
golang.org/x/sys v0.29.0 // indirect

example/1-pipeline/go.sum

+6-6
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@ github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP
118118
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
119119
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
120120
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
121-
github.com/quic-go/quic-go v0.48.2 h1:wsKXZPeGWpMpCGSWqOcqpW2wZYic/8T3aqiOID0/KWE=
122-
github.com/quic-go/quic-go v0.48.2/go.mod h1:yBgs3rWBOADpga7F+jJsb6Ybg1LSYiQvwWlLX+/6HMs=
121+
github.com/quic-go/quic-go v0.49.0 h1:w5iJHXwHxs1QxyBv1EHKuC50GX5to8mJAxvtnttJp94=
122+
github.com/quic-go/quic-go v0.49.0/go.mod h1:s2wDnmCdooUQBmQfpUSTCYBl1/D4FcqbULMMkASvR6s=
123123
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
124124
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
125125
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
126126
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
127127
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
128-
github.com/sashabaranov/go-openai v1.36.1 h1:EVfRXwIlW2rUzpx6vR+aeIKCK/xylSrVYAx1TMTSX3g=
129-
github.com/sashabaranov/go-openai v1.36.1/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
128+
github.com/sashabaranov/go-openai v1.37.0 h1:hQQowgYm4OXJ1Z/wTrE+XZaO20BYsL0R3uRPSpfNZkY=
129+
github.com/sashabaranov/go-openai v1.37.0/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
130130
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
131131
github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY=
132132
github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM=
@@ -202,8 +202,8 @@ golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c/go.mod h1:tujkw807nyEEAamNbD
202202
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
203203
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
204204
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
205-
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
206-
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
205+
golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
206+
golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
207207
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
208208
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
209209
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=

example/10-ai/llm-sfn-currency-converter/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
1515
github.com/lmittmann/tint v1.0.7 // indirect
1616
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
17-
github.com/sashabaranov/go-openai v1.36.1 // indirect
17+
github.com/sashabaranov/go-openai v1.37.0 // indirect
1818
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
1919
gopkg.in/yaml.v3 v3.0.1 // indirect
2020
)

example/10-ai/llm-sfn-currency-converter/go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ github.com/lmittmann/tint v1.0.7 h1:D/0OqWZ0YOGZ6AyC+5Y2kD8PBEzBk6rFHVSfOqCkF9Y=
66
github.com/lmittmann/tint v1.0.7/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE=
77
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
88
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
9-
github.com/sashabaranov/go-openai v1.36.1 h1:EVfRXwIlW2rUzpx6vR+aeIKCK/xylSrVYAx1TMTSX3g=
10-
github.com/sashabaranov/go-openai v1.36.1/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
9+
github.com/sashabaranov/go-openai v1.37.0 h1:hQQowgYm4OXJ1Z/wTrE+XZaO20BYsL0R3uRPSpfNZkY=
10+
github.com/sashabaranov/go-openai v1.37.0/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
1111
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
1212
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
1313
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=

example/10-ai/llm-sfn-get-ip-and-latency/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/caarlos0/env/v6 v6.10.1 // indirect
1414
github.com/google/uuid v1.6.0 // indirect
1515
github.com/lmittmann/tint v1.0.7 // indirect
16-
github.com/sashabaranov/go-openai v1.36.1 // indirect
16+
github.com/sashabaranov/go-openai v1.37.0 // indirect
1717
golang.org/x/net v0.34.0 // indirect
1818
golang.org/x/sync v0.10.0 // indirect
1919
golang.org/x/sys v0.29.0 // indirect

example/10-ai/llm-sfn-get-ip-and-latency/go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ github.com/lmittmann/tint v1.0.7 h1:D/0OqWZ0YOGZ6AyC+5Y2kD8PBEzBk6rFHVSfOqCkF9Y=
1111
github.com/lmittmann/tint v1.0.7/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE=
1212
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
1313
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
14-
github.com/sashabaranov/go-openai v1.36.1 h1:EVfRXwIlW2rUzpx6vR+aeIKCK/xylSrVYAx1TMTSX3g=
15-
github.com/sashabaranov/go-openai v1.36.1/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
14+
github.com/sashabaranov/go-openai v1.37.0 h1:hQQowgYm4OXJ1Z/wTrE+XZaO20BYsL0R3uRPSpfNZkY=
15+
github.com/sashabaranov/go-openai v1.37.0/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
1616
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
1717
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
1818
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=

example/10-ai/llm-sfn-get-weather/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require github.com/yomorun/yomo v1.18.7
77
require (
88
github.com/caarlos0/env/v6 v6.10.1 // indirect
99
github.com/lmittmann/tint v1.0.7 // indirect
10-
github.com/sashabaranov/go-openai v1.36.1 // indirect
10+
github.com/sashabaranov/go-openai v1.37.0 // indirect
1111
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
1212
)
1313

example/10-ai/llm-sfn-get-weather/go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ github.com/lmittmann/tint v1.0.7 h1:D/0OqWZ0YOGZ6AyC+5Y2kD8PBEzBk6rFHVSfOqCkF9Y=
66
github.com/lmittmann/tint v1.0.7/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE=
77
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
88
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
9-
github.com/sashabaranov/go-openai v1.36.1 h1:EVfRXwIlW2rUzpx6vR+aeIKCK/xylSrVYAx1TMTSX3g=
10-
github.com/sashabaranov/go-openai v1.36.1/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
9+
github.com/sashabaranov/go-openai v1.37.0 h1:hQQowgYm4OXJ1Z/wTrE+XZaO20BYsL0R3uRPSpfNZkY=
10+
github.com/sashabaranov/go-openai v1.37.0/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
1111
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
1212
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
1313
gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=

example/10-ai/llm-sfn-timezone-calculator/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require github.com/yomorun/yomo v1.18.8
77
require (
88
github.com/caarlos0/env/v6 v6.10.1 // indirect
99
github.com/lmittmann/tint v1.0.7 // indirect
10-
github.com/sashabaranov/go-openai v1.36.1 // indirect
10+
github.com/sashabaranov/go-openai v1.37.0 // indirect
1111
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
1212
)
1313

0 commit comments

Comments
 (0)