|
@@ -6,7 +6,6 @@ from fastapi import FastAPI, Request
|
|
|
from fastapi.encoders import jsonable_encoder
|
|
|
from fastapi.responses import JSONResponse
|
|
|
from openai import OpenAI
|
|
|
-from pydantic import BaseModel
|
|
|
from starlette.middleware.cors import CORSMiddleware
|
|
|
|
|
|
from DBTools import DBUserInfo, DBCustomUser
|
|
@@ -33,12 +32,6 @@ logging.basicConfig(
|
|
|
)
|
|
|
|
|
|
|
|
|
-class Question(BaseModel):
|
|
|
- user: str
|
|
|
- content: str
|
|
|
- stream: bool = True
|
|
|
-
|
|
|
-
|
|
|
async def ai_stream(content: str):
|
|
|
client = openai.OpenAI(api_key=API_KEY)
|
|
|
completion = client.chat.completions.create(
|