Skip to content

Conversation

@dipfocus
Copy link
Contributor

When the GEMINI_MODEL environment variable is not set in the generate example, it now defaults to gemini-2.5-flash. This prevents errors when running the example without this environment variable configured.

…tory (#1)

Use `test -d` instead of `test -e` to ensure IsDirectory returns true only for directories. This prevents regular files from being treated as directories.
apiKey := os.Getenv("GEMINI_API_KEY")
modelName := os.Getenv("GEMINI_MODEL")
modelName, ok := os.LookupEnv("GEMINI_MODEL")
if !ok {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exmples 暂时不需要这个判断,只是一个示例,都保持风格统一,如果modelname 为空模型侧报错兜底吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants