├── .env.template ├── .github ├── actions │ └── config-env │ │ └── action.yml └── workflows │ ├── continuous_delivery_dev.yml │ ├── continuous_delivery_prod.yml │ ├── continuous_delivery_qa.yml │ ├── continuous_integration.yml │ └── pr_pipeline.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── SECURITY.md ├── SUPPORT.md ├── azure.yaml ├── azure.yaml.json ├── data ├── sample-documents-indexing.py └── sample-documents.csv ├── docs ├── check_your_quota.md └── parametrizing.md ├── evaluations ├── prompty-answer-score-eval.prompty ├── prompty_eval.py ├── qa_quality_eval.py ├── safety_eval.py └── test-dataset.jsonl ├── infra ├── abbreviations.json ├── ai.yaml ├── ai.yaml.json ├── core │ ├── ai │ │ ├── cognitiveservices.bicep │ │ ├── hub-dependencies.bicep │ │ ├── hub.bicep │ │ └── project.bicep │ ├── config │ │ └── configstore.bicep │ ├── database │ │ ├── cosmos │ │ │ ├── cosmos-account.bicep │ │ │ ├── mongo │ │ │ │ ├── cosmos-mongo-account.bicep │ │ │ │ └── cosmos-mongo-db.bicep │ │ │ └── sql │ │ │ │ ├── cosmos-sql-account.bicep │ │ │ │ ├── cosmos-sql-db.bicep │ │ │ │ ├── cosmos-sql-role-assign.bicep │ │ │ │ └── cosmos-sql-role-def.bicep │ │ ├── mysql │ │ │ └── flexibleserver.bicep │ │ ├── postgresql │ │ │ └── flexibleserver.bicep │ │ └── sqlserver │ │ │ └── sqlserver.bicep │ ├── gateway │ │ └── apim.bicep │ ├── host │ │ ├── ai-environment.bicep │ │ ├── aks-agent-pool.bicep │ │ ├── aks-managed-cluster.bicep │ │ ├── aks.bicep │ │ ├── appservice-appsettings.bicep │ │ ├── appservice.bicep │ │ ├── appserviceplan.bicep │ │ ├── container-app-upsert.bicep │ │ ├── container-app.bicep │ │ ├── container-apps-environment.bicep │ │ ├── container-apps.bicep │ │ ├── container-registry.bicep │ │ ├── functions.bicep │ │ ├── ml-online-endpoint.bicep │ │ └── staticwebapp.bicep │ ├── monitor │ │ ├── applicationinsights-dashboard.bicep │ │ ├── applicationinsights.bicep │ │ ├── loganalytics.bicep │ │ └── monitoring.bicep │ ├── networking │ │ ├── cdn-endpoint.bicep │ │ ├── cdn-profile.bicep │ │ └── cdn.bicep │ ├── search │ │ └── search-services.bicep │ ├── security │ │ ├── aks-managed-cluster-access.bicep │ │ ├── configstore-access.bicep │ │ ├── keyvault-access.bicep │ │ ├── keyvault-secret.bicep │ │ ├── keyvault.bicep │ │ ├── registry-access.bicep │ │ └── role.bicep │ ├── storage │ │ └── storage-account.bicep │ └── testing │ │ └── loadtesting.bicep ├── hooks │ └── postprovision.sh ├── main.bicep └── main.parameters.json ├── media ├── architecture.png └── powershell.png ├── requirements.txt ├── src ├── __init__.py ├── ai_search.py ├── azure_config.py ├── chat.json ├── chat.prompty ├── chat_request.py ├── flow.flex.yaml └── requirements.txt ├── tests └── test_chat_request.py └── util ├── deploy_moe.py └── run_flow.py /.env.template: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/.env.template -------------------------------------------------------------------------------- /.github/actions/config-env/action.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/.github/actions/config-env/action.yml -------------------------------------------------------------------------------- /.github/workflows/continuous_delivery_dev.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/.github/workflows/continuous_delivery_dev.yml -------------------------------------------------------------------------------- /.github/workflows/continuous_delivery_prod.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/.github/workflows/continuous_delivery_prod.yml -------------------------------------------------------------------------------- /.github/workflows/continuous_delivery_qa.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/.github/workflows/continuous_delivery_qa.yml -------------------------------------------------------------------------------- /.github/workflows/continuous_integration.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/.github/workflows/continuous_integration.yml -------------------------------------------------------------------------------- /.github/workflows/pr_pipeline.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/.github/workflows/pr_pipeline.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/.gitignore -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/CODE_OF_CONDUCT.md -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/README.md -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/SECURITY.md -------------------------------------------------------------------------------- /SUPPORT.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/SUPPORT.md -------------------------------------------------------------------------------- /azure.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/azure.yaml -------------------------------------------------------------------------------- /azure.yaml.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/azure.yaml.json -------------------------------------------------------------------------------- /data/sample-documents-indexing.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/data/sample-documents-indexing.py -------------------------------------------------------------------------------- /data/sample-documents.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/data/sample-documents.csv -------------------------------------------------------------------------------- /docs/check_your_quota.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/docs/check_your_quota.md -------------------------------------------------------------------------------- /docs/parametrizing.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/docs/parametrizing.md -------------------------------------------------------------------------------- /evaluations/prompty-answer-score-eval.prompty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/evaluations/prompty-answer-score-eval.prompty -------------------------------------------------------------------------------- /evaluations/prompty_eval.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/evaluations/prompty_eval.py -------------------------------------------------------------------------------- /evaluations/qa_quality_eval.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/evaluations/qa_quality_eval.py -------------------------------------------------------------------------------- /evaluations/safety_eval.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/evaluations/safety_eval.py -------------------------------------------------------------------------------- /evaluations/test-dataset.jsonl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/evaluations/test-dataset.jsonl -------------------------------------------------------------------------------- /infra/abbreviations.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/abbreviations.json -------------------------------------------------------------------------------- /infra/ai.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/ai.yaml -------------------------------------------------------------------------------- /infra/ai.yaml.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/ai.yaml.json -------------------------------------------------------------------------------- /infra/core/ai/cognitiveservices.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/ai/cognitiveservices.bicep -------------------------------------------------------------------------------- /infra/core/ai/hub-dependencies.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/ai/hub-dependencies.bicep -------------------------------------------------------------------------------- /infra/core/ai/hub.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/ai/hub.bicep -------------------------------------------------------------------------------- /infra/core/ai/project.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/ai/project.bicep -------------------------------------------------------------------------------- /infra/core/config/configstore.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/config/configstore.bicep -------------------------------------------------------------------------------- /infra/core/database/cosmos/cosmos-account.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/database/cosmos/cosmos-account.bicep -------------------------------------------------------------------------------- /infra/core/database/cosmos/mongo/cosmos-mongo-account.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/database/cosmos/mongo/cosmos-mongo-account.bicep -------------------------------------------------------------------------------- /infra/core/database/cosmos/mongo/cosmos-mongo-db.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/database/cosmos/mongo/cosmos-mongo-db.bicep -------------------------------------------------------------------------------- /infra/core/database/cosmos/sql/cosmos-sql-account.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/database/cosmos/sql/cosmos-sql-account.bicep -------------------------------------------------------------------------------- /infra/core/database/cosmos/sql/cosmos-sql-db.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/database/cosmos/sql/cosmos-sql-db.bicep -------------------------------------------------------------------------------- /infra/core/database/cosmos/sql/cosmos-sql-role-assign.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/database/cosmos/sql/cosmos-sql-role-assign.bicep -------------------------------------------------------------------------------- /infra/core/database/cosmos/sql/cosmos-sql-role-def.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/database/cosmos/sql/cosmos-sql-role-def.bicep -------------------------------------------------------------------------------- /infra/core/database/mysql/flexibleserver.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/database/mysql/flexibleserver.bicep -------------------------------------------------------------------------------- /infra/core/database/postgresql/flexibleserver.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/database/postgresql/flexibleserver.bicep -------------------------------------------------------------------------------- /infra/core/database/sqlserver/sqlserver.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/database/sqlserver/sqlserver.bicep -------------------------------------------------------------------------------- /infra/core/gateway/apim.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/gateway/apim.bicep -------------------------------------------------------------------------------- /infra/core/host/ai-environment.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/host/ai-environment.bicep -------------------------------------------------------------------------------- /infra/core/host/aks-agent-pool.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/host/aks-agent-pool.bicep -------------------------------------------------------------------------------- /infra/core/host/aks-managed-cluster.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/host/aks-managed-cluster.bicep -------------------------------------------------------------------------------- /infra/core/host/aks.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/host/aks.bicep -------------------------------------------------------------------------------- /infra/core/host/appservice-appsettings.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/host/appservice-appsettings.bicep -------------------------------------------------------------------------------- /infra/core/host/appservice.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/host/appservice.bicep -------------------------------------------------------------------------------- /infra/core/host/appserviceplan.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/host/appserviceplan.bicep -------------------------------------------------------------------------------- /infra/core/host/container-app-upsert.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/host/container-app-upsert.bicep -------------------------------------------------------------------------------- /infra/core/host/container-app.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/host/container-app.bicep -------------------------------------------------------------------------------- /infra/core/host/container-apps-environment.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/host/container-apps-environment.bicep -------------------------------------------------------------------------------- /infra/core/host/container-apps.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/host/container-apps.bicep -------------------------------------------------------------------------------- /infra/core/host/container-registry.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/host/container-registry.bicep -------------------------------------------------------------------------------- /infra/core/host/functions.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/host/functions.bicep -------------------------------------------------------------------------------- /infra/core/host/ml-online-endpoint.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/host/ml-online-endpoint.bicep -------------------------------------------------------------------------------- /infra/core/host/staticwebapp.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/host/staticwebapp.bicep -------------------------------------------------------------------------------- /infra/core/monitor/applicationinsights-dashboard.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/monitor/applicationinsights-dashboard.bicep -------------------------------------------------------------------------------- /infra/core/monitor/applicationinsights.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/monitor/applicationinsights.bicep -------------------------------------------------------------------------------- /infra/core/monitor/loganalytics.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/monitor/loganalytics.bicep -------------------------------------------------------------------------------- /infra/core/monitor/monitoring.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/monitor/monitoring.bicep -------------------------------------------------------------------------------- /infra/core/networking/cdn-endpoint.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/networking/cdn-endpoint.bicep -------------------------------------------------------------------------------- /infra/core/networking/cdn-profile.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/networking/cdn-profile.bicep -------------------------------------------------------------------------------- /infra/core/networking/cdn.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/networking/cdn.bicep -------------------------------------------------------------------------------- /infra/core/search/search-services.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/search/search-services.bicep -------------------------------------------------------------------------------- /infra/core/security/aks-managed-cluster-access.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/security/aks-managed-cluster-access.bicep -------------------------------------------------------------------------------- /infra/core/security/configstore-access.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/security/configstore-access.bicep -------------------------------------------------------------------------------- /infra/core/security/keyvault-access.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/security/keyvault-access.bicep -------------------------------------------------------------------------------- /infra/core/security/keyvault-secret.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/security/keyvault-secret.bicep -------------------------------------------------------------------------------- /infra/core/security/keyvault.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/security/keyvault.bicep -------------------------------------------------------------------------------- /infra/core/security/registry-access.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/security/registry-access.bicep -------------------------------------------------------------------------------- /infra/core/security/role.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/security/role.bicep -------------------------------------------------------------------------------- /infra/core/storage/storage-account.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/storage/storage-account.bicep -------------------------------------------------------------------------------- /infra/core/testing/loadtesting.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/core/testing/loadtesting.bicep -------------------------------------------------------------------------------- /infra/hooks/postprovision.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/hooks/postprovision.sh -------------------------------------------------------------------------------- /infra/main.bicep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/main.bicep -------------------------------------------------------------------------------- /infra/main.parameters.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/infra/main.parameters.json -------------------------------------------------------------------------------- /media/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/media/architecture.png -------------------------------------------------------------------------------- /media/powershell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/media/powershell.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/requirements.txt -------------------------------------------------------------------------------- /src/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/ai_search.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/src/ai_search.py -------------------------------------------------------------------------------- /src/azure_config.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/src/azure_config.py -------------------------------------------------------------------------------- /src/chat.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/src/chat.json -------------------------------------------------------------------------------- /src/chat.prompty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/src/chat.prompty -------------------------------------------------------------------------------- /src/chat_request.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/src/chat_request.py -------------------------------------------------------------------------------- /src/flow.flex.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/src/flow.flex.yaml -------------------------------------------------------------------------------- /src/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/src/requirements.txt -------------------------------------------------------------------------------- /tests/test_chat_request.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/tests/test_chat_request.py -------------------------------------------------------------------------------- /util/deploy_moe.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/util/deploy_moe.py -------------------------------------------------------------------------------- /util/run_flow.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure/GenAIOps-project-template/HEAD/util/run_flow.py --------------------------------------------------------------------------------