from typing import Union | |
from fastapi import FastAPI | |
from pydantic import BaseModel | |
from nyx2 import * | |
class Item(BaseModel): | |
prompt: str | |
app = FastAPI() | |
def read_root(): | |
return {"Hello": "World"} | |
async def chat(item: Item): | |
res = GetResponse(item.prompt) | |
return { | |
"message": res | |
} |