GenkitG
Genkitโ€ข2y agoโ€ข
5 replies
managerial-maroon

I would love the community's opinion on

I would love the community's opinion on some syntax design. Do you prefer:

(1) Generate() is a method of the model:

resp, err := gemini15Flash.Generate(ctx,
     ai.NewGenerateRequest(
          &ai.GenerationCommonConfig{Temperature: 1}
          ai.NewUserTextMessage("Tell me a joke"))

or

(2) Generate() is a top level method that take a model as an argument:

resp, err := ai.Generate(ctx, gemini15Flash,
     ai.NewGenerateRequest(
          &ai.GenerationCommonConfig{Temperature: 1}
          ai.NewUserTextMessage("Tell me a joke"))
Was this page helpful?