|
@@ -0,0 +1,32 @@
|
|
|
|
+from fastapi import FastAPI
|
|
|
|
+from fastapi import Request
|
|
|
|
+from fastapi import Form
|
|
|
|
+import urllib
|
|
|
|
+import sys
|
|
|
|
+import os
|
|
|
|
+import codecs
|
|
|
|
+import html
|
|
|
|
+from typing import Optional
|
|
|
|
+
|
|
|
|
+from fastapi import FastAPI
|
|
|
|
+from pydantic import BaseModel
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+class TTS(BaseModel):
|
|
|
|
+ txt: str
|
|
|
|
+# description: Optional[str] = None
|
|
|
|
+# price: float
|
|
|
|
+# tax: Optional[float] = None
|
|
|
|
+
|
|
|
|
+app = FastAPI()
|
|
|
|
+
|
|
|
|
+@app.post("/tts")
|
|
|
|
+async def run_tts(item: TTS):
|
|
|
|
+ print(item.txt)
|
|
|
|
+ return {"OK": "200"}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+@app.get("/")
|
|
|
|
+async def root():
|
|
|
|
+ return {"message": "Hello World"}
|
|
|
|
+
|