diff options
Diffstat (limited to '')
-rw-r--r-- | g4f/api/__init__.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/g4f/api/__init__.py b/g4f/api/__init__.py index 9033aafe..d1e8539f 100644 --- a/g4f/api/__init__.py +++ b/g4f/api/__init__.py @@ -6,7 +6,7 @@ import nest_asyncio from fastapi import FastAPI, Response, Request from fastapi.responses import StreamingResponse, RedirectResponse, HTMLResponse, JSONResponse from pydantic import BaseModel -from typing import List +from typing import List, Union import g4f import g4f.debug @@ -16,12 +16,12 @@ from g4f.typing import Messages class ChatCompletionsConfig(BaseModel): messages: Messages model: str - provider: str | None + provider: Union[str, None] stream: bool = False - temperature: float | None + temperature: Union[float, None] max_tokens: int = None - stop: list[str] | str | None - access_token: str | None + stop: Union[list[str], str, None] + access_token: Union[str, None] class Api: def __init__(self, engine: g4f, debug: bool = True, sentry: bool = False, |