mirror of
https://github.com/snailyp/gemini-balance.git
synced 2026-06-03 06:39:56 +08:00
18 lines
473 B
Python
18 lines
473 B
Python
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"
|