AI_YLF / app.py
Youssefebrahim1's picture
Create app.py
964ae2f verified
Raw
History Blame Contribute Delete
418 Bytes
from fastapi import FastAPI
import os
import requests
app = FastAPI()
# Access your API key securely from Hugging Face Secrets
API_KEY = os.getenv("MY_EXTERNAL_API_KEY")
@app.get("/")
def home():
return {"message": "System is running. API Model connected."}
@app.post("/ask")
def ask_api(prompt: str):
# Logic to call your external API model goes here
return {"response": f"System processed: {prompt}"}