Skip to content

Commit c3bac47

Browse files
authored
Merge pull request #102 from Azure-Samples/test-eval-workflow
Test evaluate
2 parents 70bab5d + 0359ae2 commit c3bac47

File tree

3 files changed

+27
-16
lines changed

3 files changed

+27
-16
lines changed

.github/workflows/app-tests.yaml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
os: ["ubuntu-latest", "macos-latest-xlarge", "macos-13"]
30+
os: ["ubuntu-latest", "macos-latest-xlarge", "macos-13", "windows-latest"]
3131
python_version: ["3.10", "3.11", "3.12"]
3232
exclude:
3333
- os: macos-latest-xlarge
@@ -53,18 +53,27 @@ jobs:
5353
psql -d postgres -c "ALTER USER ${{ env.POSTGRES_USERNAME }} WITH PASSWORD '${{ env.POSTGRES_PASSWORD }}'"
5454
psql -d postgres -c 'CREATE EXTENSION vector'
5555
56-
- name: (Windows) Install pgvector using install-pgvector.bat
57-
if: matrix.os == 'windows-latest'
58-
shell: cmd
59-
run: .github\workflows\install-pgvector.bat
56+
# - name: (Windows) Start postgreSQL
57+
# if: matrix.os == 'windows-latest'
58+
# uses: ikalnytskyi/action-setup-postgres@v6
59+
# with:
60+
# username: ${{ env.POSTGRES_USERNAME }}
61+
# password: ${{ env.POSTGRES_PASSWORD }}
62+
# database: ${{ env.POSTGRES_DATABASE }}
6063

61-
- name: (Windows) Start postgreSQL
64+
- name: Install pgvector
6265
if: matrix.os == 'windows-latest'
63-
uses: ikalnytskyi/action-setup-postgres@v6
64-
with:
65-
username: ${{ env.POSTGRES_USERNAME }}
66-
password: ${{ env.POSTGRES_PASSWORD }}
67-
database: ${{ env.POSTGRES_DATABASE }}
66+
shell: cmd
67+
run: |
68+
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
69+
cd %TEMP%
70+
git clone --branch v0.7.4 https://github.com/pgvector/pgvector.git
71+
cd pgvector
72+
nmake /NOLOGO /F Makefile.win
73+
nmake /NOLOGO /F Makefile.win install
74+
sc config postgresql-x64-14 start=auto
75+
net start postgresql-x64-14
76+
"%PGBIN%/psql" -d postgres -c "CREATE EXTENSION vector"
6877
6978
- name: (Linux) Install pgvector and set password
7079
if: matrix.os == 'ubuntu-latest'

.github/workflows/evaluate.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Evaluate
1+
name: Evaluate RAG answer flow
22

33
on:
44
issue_comment:
@@ -133,7 +133,7 @@ jobs:
133133
134134
- name: Evaluate local RAG flow
135135
run: |
136-
python evals/evaluate.py --targeturl=http://127.0.0.1:8000/chat --numquestions=2 --resultsdir=results/pr${{ github.event.issue.number }}
136+
python evals/evaluate.py --targeturl=http://127.0.0.1:8000/chat --numquestions=2 --resultsdir=evals/results/pr${{ github.event.issue.number }}
137137
138138
- name: Upload server logs as build artifact
139139
uses: actions/upload-artifact@v4
@@ -163,10 +163,12 @@ jobs:
163163
uses: actions/github-script@v7
164164
with:
165165
script: |
166-
const { GITHUB_STEP_SUMMARY } = process.env;
166+
const fs = require('fs');
167+
const summaryPath = process.env.GITHUB_STEP_SUMMARY;
168+
const summary = fs.readFileSync(summaryPath, 'utf8');
167169
github.rest.issues.createComment({
168170
issue_number: context.issue.number,
169171
owner: context.repo.owner,
170172
repo: context.repo.repo,
171-
body: GITHUB_STEP_SUMMARY
173+
body: summary
172174
})

src/backend/fastapi_app/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def create_app(testing: bool = False):
6060
if os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING"):
6161
logger.info("Configuring Azure Monitor")
6262
configure_azure_monitor(logger_name="ragapp")
63-
# OpenAI SDK requests use httpx and are thus not auto-instrumented:
63+
# OpenAI SDK requests use httpx, so are thus not auto-instrumented:
6464
OpenAIInstrumentor().instrument()
6565

6666
app = fastapi.FastAPI(docs_url="/docs", lifespan=lifespan)

0 commit comments

Comments
 (0)