feat: add support for the n parameter in OpenAI-compatible requests. Now, when you make a request to the /v1/chat/completions endpoint with the n parameter, it will be correctly mapped to candidateCount in the Gemini API request, allowing you to receive multiple completions.

This commit is contained in:
zenyanbo
2025-08-11 17:39:18 +08:00
parent a6558b4668
commit f58ae2b340
3 changed files with 49 additions and 25 deletions
+1
View File
@@ -12,6 +12,7 @@ class ChatRequest(BaseModel):
max_tokens: Optional[int] = None
top_p: Optional[float] = DEFAULT_TOP_P
top_k: Optional[int] = DEFAULT_TOP_K
n: Optional[int] = 1
stop: Optional[Union[List[str],str]] = None
reasoning_effort: Optional[str] = None
tools: Optional[Union[List[Dict[str, Any]], Dict[str, Any]]] = []