Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gemini-1.5-flash模型在流式输出的情况下报错 #48

Open
qiaoyuok opened this issue Jan 10, 2025 · 0 comments
Open

gemini-1.5-flash模型在流式输出的情况下报错 #48

qiaoyuok opened this issue Jan 10, 2025 · 0 comments
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@qiaoyuok
Copy link

qiaoyuok commented Jan 10, 2025

流式输出相关代码:

stream := client.Models.GenerateContentStream(
		ctx,
		"gemini-1.5-flash",
		[]*new_genai.Content{{Parts: parts}},
		nil,
	)
	stream(func(response *new_genai.GenerateContentResponse, err error) bool {
		if err != nil {
			fmt.Println("Error while processing stream:", err)
			return false // 停止处理流
		}

		// 处理成功结果
		g.Dump(response.Candidates)

		return true // 继续处理下一个
	})

错误信息:

Error while processing stream: client error. Code: 400, Message: Image input modality is not enabled for models/gemini-1.5-flash, Status: INVALID_ARGUMENT, Details: []

非流式的情况下一切正常,Why~
gemini-1.5-pro模型和2.0模型也都一切正常

@qiaoyuok qiaoyuok added priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue. labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

1 participant