AI-application / server.py
Sneha Dixit
[UPDATE] api
5b90a2e
from fastapi import FastAPI, Depends
import os
import auth
import client
import model
app = FastAPI()
@app.get("/")
async def welcome():
return "Hello, Welcome to AI space!"
@app.get("/test")
async def generate(api_key = Depends(auth.api_key_auth)):
return "All good. You only get this message if you're authenticated"
@app.post("/generate")
async def generate(ticket: model.Ticket, api_key = Depends(auth.api_key_auth)):
response = client.get_completion(ticket)
return response