Spaces:
Sleeping
Sleeping
| from fastapi import FastAPI, Depends | |
| import os | |
| import auth | |
| import client | |
| import model | |
| app = FastAPI() | |
| async def welcome(): | |
| return "Hello, Welcome to AI space!" | |
| async def generate(api_key = Depends(auth.api_key_auth)): | |
| return "All good. You only get this message if you're authenticated" | |
| async def generate(ticket: model.Ticket, api_key = Depends(auth.api_key_auth)): | |
| response = client.get_completion(ticket) | |
| return response |