Skip to content

Commit

Permalink
Fixed merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
abhahn committed Jul 29, 2024
2 parents 4d06074 + 2cfb4fb commit 80a232d
Show file tree
Hide file tree
Showing 59 changed files with 9,815 additions and 1,737 deletions.
11 changes: 10 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@ AZURE_OPENAI_TEMPERATURE=0
AZURE_OPENAI_TOP_P=1.0
AZURE_OPENAI_MAX_TOKENS=1000
AZURE_OPENAI_STOP_SEQUENCE=
AZURE_OPENAI_SEED=
AZURE_OPENAI_CHOICES_COUNT=1
AZURE_OPENAI_PRESENCE_PENALTY=0.0
AZURE_OPENAI_FREQUENCY_PENALTY=0.0
AZURE_OPENAI_LOGIT_BIAS=
AZURE_OPENAI_USER=
AZURE_OPENAI_TOOLS=
AZURE_OPENAI_TOOL_CHOICE=
AZURE_OPENAI_SYSTEM_MESSAGE=You are an AI assistant that helps people find information.
AZURE_OPENAI_PREVIEW_API_VERSION=2024-02-15-preview
AZURE_OPENAI_PREVIEW_API_VERSION=2024-05-01-preview
AZURE_OPENAI_STREAM=True
AZURE_OPENAI_ENDPOINT=
AZURE_OPENAI_EMBEDDING_NAME=
Expand All @@ -29,6 +37,7 @@ AZURE_COSMOSDB_CONVERSATIONS_CONTAINER=conversations
AZURE_COSMOSDB_ACCOUNT_KEY=
AZURE_COSMOSDB_ENABLE_FEEDBACK=False
# Chat with data: common settings
DATASOURCE_TYPE=
SEARCH_TOP_K=5
SEARCH_STRICTNESS=3
SEARCH_ENABLE_IN_DOMAIN=True
Expand Down
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ If applicable, add screenshots to help explain your problem.
- Azure OpenAI model name and version (e.g. 'gpt-35-turbo-16k, version 0613')
- Is chat history enabled?
- Are you using data? If so, what data source? (e.g. Azure AI Search, Azure CosmosDB Mongo vCore, etc)
- Verify the startup command and runtime configuration by showing the output of the following az CLI command:
```
az webapp show --name <app name> --resource-group <resource group name> --query "{startupCommand: siteConfig.appCommandLine, runtime: siteConfig.linuxFxVersion}"
```

**Logs**

1. If the application deployment is failing, please share the deployment logs using the following az CLI command:
```
az webapp log deployment show --name <app name> --resource-group <rg name>
```

2. If the application is crashing after deployment, please share the application logs using the following az CLI command:
```
az webapp log tail --name <app name> --resource-group <resource group name>
```

**Additional context**
Add any other context about the problem here.
51 changes: 51 additions & 0 deletions .github/workflows/check-static-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Check changes to static files

on:
pull_request:
branches:
- main

jobs:
changed_files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: List changed frontend source files
uses: tj-actions/changed-files@v44
id: changed-frontend-src-files
with:
files: |
frontend/src/**/*.tsx
frontend/src/**/*.css
- name: List changed frontend static files
id: changed-frontend-static-files
if: steps.changed-frontend-src-files.outputs.files_changed == 'true'
uses: tj-actions/changed-files@v44
with:
files: |
static
- name: Check changed static files
if: steps.changed-frontend-src-files.outputs.files_changed == 'true' && steps.changed-frontend-static-files.outputs.files_changed == 'false'
run: echo "There were changes to the frontend code, but no corresponding changes to static files. Please build the project locally, commit the static file changes and push the changes to try again." && exit 1

- name: List logo customizations
uses: tj-actions/changed-files@v44
id: changed-logo-files
with:
files: |
frontend/public/favicon.ico
frontend/src/assets
- name: Comment on logo customizations
if: steps.changed-logo-files.outputs.any_changed == 'true'
uses: mshick/add-pr-comment@v2
with:
message: |
"Hello contributor, it appears that your pull request contains some customizations to branding. We are unable to approve your PR at this time. If you believe this message to be in error, please correct these unsupported changes and try again, or reach out to one of the maintainers of the repo to discuss the changes."
- name: Fail on logo customizations
if: steps.changed-logo-files.outputs.any_changed == 'true'
run: echo "Logos are customized, which is not a supported change." && exit 1
Empty file.
19 changes: 19 additions & 0 deletions .github/workflows/docker-image-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Docker Image Build

on:
pull_request:
branches:
- main

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run:
docker build . --file WebApp.Dockerfile --tag sampleappaoaichatgpt.azurecr.io/sample-app-aoai-chatgpt:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Image CI
name: Docker Image Publish

on:
push:
Expand All @@ -13,7 +13,7 @@ jobs:

steps:
- name: Azure Container Registry Login
uses: Azure/docker-login@v1
uses: Azure/docker-login@v2
with:
# Container registry username
username: ${{ secrets.SAMPLEAPP_ACR_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ jobs:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: npm ci
- run: npm run build --if-present
- run: NODE_OPTIONS=--max_old_space_size=8192 npm run build --if-present
- run: npm run test --if-present
61 changes: 55 additions & 6 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,60 @@ permissions:
contents: read

jobs:
build:
test_linux:
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Test with pytest
env:
AZURE_OPENAI_ENDPOINT: ${{ secrets.AZUREOPENAIENDPOINT }}
AZURE_OPENAI_MODEL: ${{ secrets.AZUREOPENAIMODEL }}
AZURE_OPENAI_KEY: ${{ secrets.AZUREOPENAIKEY }}
AZURE_OPENAI_EMBEDDING_NAME: ${{ secrets.AZUREOPENAIEMBEDDINGNAME }}
AZURE_COSMOSDB_ACCOUNT: ${{ secrets.AZURECOSMOSDBACCOUNT }}
AZURE_COSMOSDB_DATABASE: ${{ secrets.AZURECOSMOSDBDATABASE }}
AZURE_COSMOSDB_CONVERSATIONS_CONTAINER: ${{ secrets.AZURECOSMOSDBCONVERSATIONSCONTAINER }}
AZURE_COSMOSDB_ACCOUNT_KEY: ${{ secrets.AZURECOSMOSDBACCOUNTKEY }}
AZURE_SEARCH_SERVICE: ${{ secrets.AZURESEARCHSERVICE }}
AZURE_SEARCH_INDEX: ${{ secrets.AZURESEARCHINDEX }}
AZURE_SEARCH_KEY: ${{ secrets.AZURESEARCHKEY }}
AZURE_SEARCH_QUERY: ${{ secrets.AZURESEARCHQUERY }}
ELASTICSEARCH_EMBEDDING_MODEL_ID: ${{ secrets.ELASTICSEARCHEMBEDDINGMODELID }}
ELASTICSEARCH_ENCODED_API_KEY: ${{ secrets.ELASTICSEARCHENCODEDAPIKEY }}
ELASTICSEARCH_ENDPOINT: ${{ secrets.ELASTICSEARCHENDPOINT }}
ELASTICSEARCH_INDEX: ${{ secrets.ELASTICSEARCHINDEX }}
ELASTICSEARCH_QUERY: ${{ secrets.ELASTICSEARCHQUERY }}
run: |
export PYTHONPATH=$(pwd)
coverage run -m pytest -v --show-capture=stdout
coverage report -m --include=app.py,backend/*,tests/*
coverage xml
runs-on: ubuntu-latest
- name: Code Coverage Report
uses: irongut/[email protected]
with:
filename: coverage.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '50 80'

test_windows:
runs-on:
- windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
Expand All @@ -26,9 +76,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -r requirements-dev.txt
- name: Test with pytest
run: |
export PYTHONPATH=$(pwd)
pytest -v --show-capture=stdout
$env:PYTHONPATH=$pwd
pytest -v --show-capture=stdout -k "not integration"
22 changes: 22 additions & 0 deletions .github/workflows/stale-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Close inactive issues
on:
schedule:
- cron: "30 1 * * *"

jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
days-before-issue-stale: 60
days-before-issue-close: 14
stale-issue-label: "stale"
stale-issue-message: "This issue is stale because it has been open for 30 days with no activity."
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
days-before-pr-stale: 60
days-before-pr-close: 14
repo-token: ${{ secrets.GITHUB_TOKEN }}
13 changes: 10 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,15 @@
"-p 50505"
],
"console": "integratedTerminal",
"justMyCode": false,
"envFile": "${workspaceFolder}/.env",
}
"justMyCode": false
},
{
"type": "chrome",
"request": "launch",
"name": "Frontend: Launch Chrome debugger",
"url": "http://127.0.0.1:50505",
"webRoot": "${workspaceFolder}/frontend",
"smartStep": true
}
]
}
Loading

0 comments on commit 80a232d

Please sign in to comment.