feat: 支持 Gemini 格式请求,并优化日志和配置

This commit is contained in:
yinpeng
2024-12-18 19:54:43 +08:00
parent 1913a3c909
commit d9229cced9
14 changed files with 290 additions and 62 deletions
+17
View File
@@ -0,0 +1,17 @@
from pydantic import BaseModel
from typing import List, Optional, Union
class ChatRequest(BaseModel):
messages: List[dict]
model: str = "gemini-1.5-flash-002"
temperature: Optional[float] = 0.7
stream: Optional[bool] = False
tools: Optional[List[dict]] = []
tool_choice: Optional[str] = "auto"
class EmbeddingRequest(BaseModel):
input: Union[str, List[str]]
model: str = "text-embedding-004"
encoding_format: Optional[str] = "float"