A simple python server that exposes useful API for LLM
- Python 86.9%
- Dockerfile 11.9%
- Makefile 1.2%
| .woodpecker | Fix youtube transcript, add unit test | |
| app | Fix youtube transcript, add unit test | |
| tests | Fix youtube transcript, add unit test | |
| .cirrus.yml | [skip ci] change fingerprint key | |
| .dockerignore | Disable pull base image so that cache can be used | |
| .gitignore | Init | |
| Dockerfile | Remove workdir from dockerfile to avoid cache miss | |
| Makefile | add test command to makefile [skip ci] | |
| README.md | Add readme.md [skip ci] | |
| requirements.txt | Fix youtube transcript, add unit test | |
url-loader
A simple Python FastAPI server that exposes useful endpoint for LLM.
Endpoints
Currently, here are the supported endpoints:
- POST
/loader
Given a list of urls, fetch the contents. Sample request body:
{
"urls": ["https://example.com"]
}
Sample response body:
[
{
"metadata": {
"title": "Example Domain",
"source": "https://example.com"
},
"page_content": "# Example Domain\nThis domain is for use in documentation examples without needing permission. Avoid use in operations.\n[Learn more](https://iana.org/domains/example)\n"
}
]
- POST
/yt-transcript
Given a list of YouTube URLs, fetch their transcript. Sample request body:
{
"urls": [
"https://youtube.com/watch?v=fakeid123"
]
}
Sample response body:
[
{
"metadata": {
"title": "Transcript for fakeid123",
"source": "https://www.youtube.com/watch?v=fakeid123"
},
"page_content": "This is a dummy content."
}
]
- POST
/sandboxLaunch a Python sandbox and run command. This feature requires Docker socket to be exposed. Sample request body:
{
"code": "print('hello!')"
}
Sample response body:
{
"stdout": "hello!\n",
"stderr": "",
"exit_code": 0
}