Files
example-eino/steps/asr/internal/llm.go
T
zhaoyupeng.elqbandTRAE CLI 587f61bc03 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>
2026-11-19 10:54:07 +08:00

24 lines
512 B
Go

package internal
import (
"context"
"log"
"os"
"github.com/cloudwego/eino-ext/components/model/openai"
)
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: model,
ReasoningEffort: openai.ReasoningEffortLevelLow,
})
if err != nil {
log.Panicf("new openai chat model failed: %v", err)
}
return chat
}