mirror of
https://github.com/snailyp/gemini-balance.git
synced 2026-09-07 00:36:36 +08:00
Merge pull request #300 from zenyanbo/main
This commit is contained in:
@@ -196,6 +196,10 @@ def _build_payload(
|
||||
|
||||
# 处理 max_tokens 参数
|
||||
_validate_and_set_max_tokens(payload, request.max_tokens, logger)
|
||||
|
||||
# 处理 n 参数
|
||||
if request.n is not None and request.n > 0:
|
||||
payload["generationConfig"]["candidateCount"] = request.n
|
||||
|
||||
if request.model.endswith("-image") or request.model.endswith("-image-generation"):
|
||||
payload["generationConfig"]["responseModalities"] = ["Text", "Image"]
|
||||
|
||||
Reference in New Issue
Block a user