feat: allow selecting chat models in ASR and weather examples
Parse --model in main with mini-chat as the default, and pass the selected model to the OpenAI chat model configuration. Keep argument parsing out of init so entrypoint tests can initialize their own flags. Co-authored-by: TRAE CLI <traecli@bytedance.com>
This commit is contained in:
1 parent
1512f0516f
commit
587f61bc03
4 files changed
+24
-6
No files matched your search
@@ -8,11 +8,11 @@ import (
|
||||
"github.com/cloudwego/eino-ext/components/model/openai"
|
||||
)
|
||||
|
||||
func MustNewChatModel(ctx context.Context) *openai.ChatModel {
|
||||
func MustNewChatModel(ctx context.Context, model string) *openai.ChatModel {
|
||||
chat, err := openai.NewChatModel(ctx, &openai.ChatModelConfig{
|
||||
APIKey: os.Getenv("AI_KEY"),
|
||||
BaseURL: "https://ai.loveuer.com/v1",
|
||||
Model: "mini-chat",
|
||||
Model: model,
|
||||
ReasoningEffort: openai.ReasoningEffortLevelLow,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user