Spaces:
Paused
Paused
Update main.py
Browse files
main.py
CHANGED
|
@@ -67,6 +67,15 @@ async def crawl(input: CrawlerInput, api_key: str = Depends(verify_api_key)):
|
|
| 67 |
extracted_data = json.loads(result.extracted_content)
|
| 68 |
return CrawlerOutput(data=extracted_data)
|
| 69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
@app.get("/test")
|
| 71 |
async def test(api_key: str = Depends(verify_api_key)):
|
| 72 |
result = await simple_crawl()
|
|
|
|
| 67 |
extracted_data = json.loads(result.extracted_content)
|
| 68 |
return CrawlerOutput(data=extracted_data)
|
| 69 |
|
| 70 |
+
|
| 71 |
+
@app.get("/basic-crawl")
|
| 72 |
+
async def test_url(api_key: str = Depends(verify_api_key), url: str = Query(..., description="URL to crawl")):
|
| 73 |
+
"""
|
| 74 |
+
A test endpoint that takes a URL as input and returns the result of crawling it.
|
| 75 |
+
"""
|
| 76 |
+
result = await simple_crawl(url=url)
|
| 77 |
+
return {"markdown": result.markdown}
|
| 78 |
+
|
| 79 |
@app.get("/test")
|
| 80 |
async def test(api_key: str = Depends(verify_api_key)):
|
| 81 |
result = await simple_crawl()
|