添加API密钥管理、模型服务和安全服务,并优化FastAPI应用程序配置

This commit is contained in:
yinpeng
2024-12-15 11:08:35 +08:00
parent 03c201c849
commit c56bea0b25
15 changed files with 638 additions and 438 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"
View File