pull/349/merge
Priyanshi Kothari 2024-04-20 14:39:45 +01:00 committed by GitHub
commit f09c1a5093
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 0 deletions

15
main.py Normal file
View File

@ -0,0 +1,15 @@
from fastapi import FastAPI, HTTPException
import requests
app = FastAPI()
@ app.post("/process-prompt")
async def process_prompt(prompt: str):
bark_url = "https://api.github.com/repos/username/Bark"
headers = {"Accept": "application/vnd.github.v3+json"}
response = requests.post(bark_url, headers=headers, json={"prompt": prompt})
if response.status_code == 200:
return response.json()
else:
raise HTTPException(status_code=500, detail="Failed to process prompt")