├── .devcontainer └── devcontainer.json ├── .env.sample ├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yaml └── workflows │ ├── azure-bicep-validate.yaml │ ├── azure-dev.yaml │ └── python-check.yaml ├── .gitignore ├── .pre-commit-config.yaml ├── .vscode ├── launch.json └── settings.json ├── LICENSE.md ├── README.md ├── azure.yaml ├── docker-compose.yaml ├── docs └── README.md ├── infra ├── aca.bicep ├── core │ ├── ai │ │ └── cognitiveservices.bicep │ ├── host │ │ ├── container-app-upsert.bicep │ │ ├── container-app.bicep │ │ ├── container-apps-environment.bicep │ │ ├── container-apps.bicep │ │ └── container-registry.bicep │ ├── monitor │ │ └── loganalytics.bicep │ └── security │ │ ├── registry-access.bicep │ │ └── role.bicep ├── main.bicep └── main.parameters.json ├── pyproject.toml ├── readme_diagram.png ├── requirements-dev.txt ├── src ├── .dockerignore ├── Dockerfile ├── api │ ├── __init__.py │ ├── chat.py │ └── globals.py ├── gunicorn.conf.py └── requirements.txt └── tests ├── __init__.py ├── conftest.py ├── snapshots └── test_app │ ├── test_chat_nostream │ └── result.json │ └── test_chat_stream │ └── result.jsonlines └── test_app.py /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/.devcontainer/devcontainer.json -------------------------------------------------------------------------------- /.env.sample: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/.env.sample -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/.github/CODE_OF_CONDUCT.md -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/.github/CONTRIBUTING.md -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/.github/ISSUE_TEMPLATE.md -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/.github/PULL_REQUEST_TEMPLATE.md -------------------------------------------------------------------------------- /.github/dependabot.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/.github/dependabot.yaml -------------------------------------------------------------------------------- /.github/workflows/azure-bicep-validate.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/.github/workflows/azure-bicep-validate.yaml -------------------------------------------------------------------------------- /.github/workflows/azure-dev.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/.github/workflows/azure-dev.yaml -------------------------------------------------------------------------------- /.github/workflows/python-check.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/.github/workflows/python-check.yaml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/.gitignore -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/.pre-commit-config.yaml -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/.vscode/launch.json -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/.vscode/settings.json -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/LICENSE.md -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/README.md -------------------------------------------------------------------------------- /azure.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/azure.yaml -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/docker-compose.yaml -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/docs/README.md -------------------------------------------------------------------------------- /infra/aca.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/infra/aca.bicep -------------------------------------------------------------------------------- /infra/core/ai/cognitiveservices.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/infra/core/ai/cognitiveservices.bicep -------------------------------------------------------------------------------- /infra/core/host/container-app-upsert.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/infra/core/host/container-app-upsert.bicep -------------------------------------------------------------------------------- /infra/core/host/container-app.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/infra/core/host/container-app.bicep -------------------------------------------------------------------------------- /infra/core/host/container-apps-environment.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/infra/core/host/container-apps-environment.bicep -------------------------------------------------------------------------------- /infra/core/host/container-apps.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/infra/core/host/container-apps.bicep -------------------------------------------------------------------------------- /infra/core/host/container-registry.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/infra/core/host/container-registry.bicep -------------------------------------------------------------------------------- /infra/core/monitor/loganalytics.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/infra/core/monitor/loganalytics.bicep -------------------------------------------------------------------------------- /infra/core/security/registry-access.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/infra/core/security/registry-access.bicep -------------------------------------------------------------------------------- /infra/core/security/role.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/infra/core/security/role.bicep -------------------------------------------------------------------------------- /infra/main.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/infra/main.bicep -------------------------------------------------------------------------------- /infra/main.parameters.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/infra/main.parameters.json -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/pyproject.toml -------------------------------------------------------------------------------- /readme_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/readme_diagram.png -------------------------------------------------------------------------------- /requirements-dev.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/requirements-dev.txt -------------------------------------------------------------------------------- /src/.dockerignore: -------------------------------------------------------------------------------- 1 | .git* 2 | .venv/ 3 | **/*.pyc 4 | -------------------------------------------------------------------------------- /src/Dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/src/Dockerfile -------------------------------------------------------------------------------- /src/api/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/src/api/__init__.py -------------------------------------------------------------------------------- /src/api/chat.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/src/api/chat.py -------------------------------------------------------------------------------- /src/api/globals.py: -------------------------------------------------------------------------------- 1 | clients = {} 2 | -------------------------------------------------------------------------------- /src/gunicorn.conf.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/src/gunicorn.conf.py -------------------------------------------------------------------------------- /src/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/src/requirements.txt -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/tests/conftest.py -------------------------------------------------------------------------------- /tests/snapshots/test_app/test_chat_nostream/result.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/tests/snapshots/test_app/test_chat_nostream/result.json -------------------------------------------------------------------------------- /tests/snapshots/test_app/test_chat_stream/result.jsonlines: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/tests/snapshots/test_app/test_chat_stream/result.jsonlines -------------------------------------------------------------------------------- /tests/test_app.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/openai-chat-backend-fastapi/HEAD/tests/test_app.py --------------------------------------------------------------------------------