You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
The official AI microservice of [Bootstrap Academy](https://bootstrap.academy/).
7
4
8
-
</p>
5
+
This microservice provides a foundational API endpoint for AI integrations, with an emphasis on extendibility. Currently, it uses OpenAI's GPT-4, but it can easily accommodate other models and providers.
9
6
10
-
# fastapi-template
7
+
If you would like to submit a bug report or feature request, or are looking for general information about the project or the publicly available instances, please refer to the [Bootstrap-Academy repository](https://github.com/Bootstrap-Academy/Bootstrap-Academy).
11
8
12
-
A template for projects that use the [FastAPI framework](https://fastapi.tiangolo.com/).
9
+
## Endpoints
13
10
14
-
##How to use this template
11
+
### POST `/api/ai`
15
12
16
-
### Choose a template branch
13
+
Accessible only to administrators with a valid API key. This endpoint takes in prompts and returns an AI-generated response.
17
14
18
-
Currently these two branches are available:
15
+
#### Request Example
19
16
20
-
-`develop`: Contains a basic FastAPI template using SQLAlchemy and aioredis, including basic logging, optional token authentication, utilities to simplify documentation creation and some demo endpoints, as well as a `Dockerfile` to create a Docker image and a GitHub Actions workflow to automatically build and push the Docker image to GitHub Container Registry.
21
-
-`users`: Contains everything included in the `develop` branch and implements basic user management functionality. This includes endpoints for user creation, session management and administration as well as features such as 2FA via TOTP, generic OAuth2 and reCAPTCHA on account creation and/or too many failed login attempts.
22
-
23
-
Replace `TEMPLATE_BRANCH` in the next section with the branch you would like to use.
24
-
25
-
### Setup repository
26
-
27
-
1. Click the [Use this template](https://github.com/Defelo/fastapi-template/generate) button to generate a new repository
28
-
2.`git clone` your new repository
29
-
3. Add this repository as a `template` remote: `git remote add template https://github.com/Defelo/fastapi-template.git && git fetch template`
30
-
4. Reset your branch to the template branch you would like to use: `git reset --hard template/TEMPLATE_BRANCH`
31
-
5. Force push your branch to GitHub: `git push -f`
32
-
33
-
To later update your repository you can just merge the template into your own branch: `git fetch template && git merge template/TEMPLATE_BRANCH`
34
-
35
-
### Customize template files
36
-
37
-
1. Adjust `name`, `description`, `authors`, `homepage` and `repository` in [pyproject.toml](https://github.com/Defelo/fastapi-template/blob/develop/pyproject.toml#L2-L9)
38
-
2. Adjust repository url in [Dockerfile](https://github.com/Defelo/fastapi-template/blob/develop/Dockerfile#L24)
39
-
3. Adjust docker image tag in [docker-compose.yml](https://github.com/Defelo/fastapi-template/blob/develop/docker-compose.yml#L5) and [.github/workflows/ci.yml](https://github.com/Defelo/fastapi-template/blob/develop/.github/workflows/ci.yml#L9)
40
-
4. (optional) Enable additional platforms for docker buildx in [.github/workflows/ci.yml](https://github.com/Defelo/fastapi-template/blob/develop/.github/workflows/ci.yml#L165-L168)
41
-
5. Enable docker push in [.github/workflows/ci.yml](https://github.com/Defelo/fastapi-template/blob/develop/.github/workflows/ci.yml#L232) by removing the `"false" #`
42
-
6. (optional) Adjust [.github/workflows/ci.yml](https://github.com/Defelo/fastapi-template/blob/develop/.github/workflows/ci.yml#L292-L304) to enable automatic deployment by sending an HTTP request to a specific url
43
-
7. (optional) If you *don't* want your dependabot pull requests to be merged automatically, remove the [.github/workflows/merge-me.yml](https://github.com/Defelo/fastapi-template/blob/develop/.github/workflows/merge-me.yml) workflow
44
-
8. (optional) If you want to automatically delete unused docker tags from GHCR:
45
-
1. Adjust repository owner and name in [.github/workflows/docker_clean.yml](https://github.com/Defelo/fastapi-template/blob/develop/.github/workflows/docker_clean.yml#L10-L11)
46
-
2. Uncomment the workflow triggers in [.github/workflows/docker_clean.yml](https://github.com/Defelo/fastapi-template/blob/develop/.github/workflows/docker_clean.yml#L4-L6)
47
-
3. Create a [personal access token](https://github.com/settings/tokens/new) with `delete:packages` permissions
48
-
4. Create a new `docker-clean` environment, allow only `develop` as deployment branch and create a `CR_PAT` secret that contains the personal access token
0 commit comments