INNER CODE UNIT · Python
token_count
CassiopeiaCode/q2api · app.py:52
token_count = int(token_count * TOKEN_COUNT_MULTIPLIER)
return token_count
# ------------------------------------------------------------------------------
# Bootstrap
# ------------------------------------------------------------------------------
BASE_DIR = Path(__file__).resolve().parent
load_dotenv(BASE_DIR / ".env")
app = FastAPI(title="v2 OpenAI-compatible Server (Amazon Q Backend)")
# CORS for simple testing in browser
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_methods=["*"],