A trivial version of a code generation API, built with FastAPI.
Refer to the documentation.
You can make POST requests to http://127.0.0.1:8000/api/v1/codegen/
to test the API locally.
Set the Content-Type
header to application/json
and pass in a JSON request body containing repoUrl
and prompt
fields, as shown in this example:
{
"repoUrl": "https://github.com/jayhack/llm.sh",
"prompt": "Add a comment in the readme with text 'Here is a self referential link.' linking to https://github.com/jayhack/llm.sh"
}
.env
for the app configurationdocker-compose.yml
and Dockerfile
to run the prodution serverVisual Studio Code is the recommended editor, please install the recommended extensions in .vscode/extensions.json
.
Install poetry.
Install dependencies:
poetry install
Start the development server with automatic reload:
poetry shell
dev
or
uvicorn app.main:app --reload
poetry shell
pytest
In openapi-generator
install the required packages:
npm install
Start the server then generate clients:
npm run generate
In the project root there is the docker-compose.yml
.
Run:
docker compose up -d --build
Stop:
docker compose down
poetry shell
uvicorn app.main:app