Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flex flow, Prompty & Tracing examples #1741

Merged
merged 174 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from 170 commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
35f2297
code-first example first version
wangchao1230 Jan 15, 2024
16dedad
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Jan 15, 2024
3c52a44
update
wangchao1230 Jan 15, 2024
312d19c
update
wangchao1230 Jan 15, 2024
5518ab2
update output
D-W- Jan 16, 2024
082a356
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Jan 16, 2024
7a285b5
update requirements
D-W- Jan 26, 2024
fdbc354
update remote
D-W- Jan 26, 2024
9a8694a
update sample
D-W- Jan 26, 2024
42033e0
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Jan 31, 2024
dbb4fe7
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Jan 31, 2024
114e50c
snapshot
wangchao1230 Jan 31, 2024
bdc37bb
snapshot
wangchao1230 Jan 31, 2024
fc503a2
update dag entry
D-W- Jan 31, 2024
7437165
add trace tutorial
wangchao1230 Feb 1, 2024
f725eba
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Feb 1, 2024
6530929
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Feb 1, 2024
1563431
snap
wangchao1230 Feb 1, 2024
97bf47a
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Feb 1, 2024
931f6c0
snapshot
wangchao1230 Feb 1, 2024
515b926
Merge branch 'clwan/eager-mode-sample' of https://github.com/microsof…
D-W- Feb 1, 2024
bb8969f
update
wangchao1230 Feb 1, 2024
5cf176a
update
D-W- Feb 1, 2024
5fd7420
Merge branch 'clwan/eager-mode-sample' of https://github.com/microsof…
D-W- Feb 1, 2024
f605e8e
change sample to use env var
D-W- Feb 1, 2024
3cc8ef7
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Feb 1, 2024
c183b9c
update precommit
D-W- Feb 1, 2024
fa0cd9f
update private version
D-W- Feb 1, 2024
785288b
Merge branch 'clwan/eager-mode-sample' of https://github.com/microsof…
D-W- Feb 1, 2024
2a18f63
resolve comments
wangchao1230 Feb 2, 2024
46b09c6
Merge branch 'clwan/eager-mode-sample' of https://github.com/microsof…
wangchao1230 Feb 2, 2024
5852896
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Feb 4, 2024
a19a961
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Feb 4, 2024
8721fbf
fix cspell
wangchao1230 Feb 4, 2024
a29a276
fix cspell
wangchao1230 Feb 4, 2024
b4406b4
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Feb 4, 2024
c8d225d
add langchain example
wangchao1230 Feb 4, 2024
39e5844
update langchain example
wangchao1230 Feb 4, 2024
eb177fe
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Feb 5, 2024
c9d84e4
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Feb 6, 2024
541ebc4
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Feb 7, 2024
d8d5979
add new eval flow example
wangchao1230 Feb 7, 2024
5e9ba1d
update quickstart.ipynb
wangchao1230 Feb 7, 2024
14da12a
update
wangchao1230 Feb 7, 2024
d50c055
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Feb 7, 2024
556e59d
fix comment
wangchao1230 Feb 7, 2024
d9b51b1
Merge branch 'clwan/eager-mode-sample' of https://github.com/microsof…
wangchao1230 Feb 7, 2024
b52f392
User class init for eval
brynn-code Feb 7, 2024
8ea01f2
add eval flow for basic chat
wangchao1230 Feb 7, 2024
e0fca91
Merge branch 'clwan/eager-mode-sample' of https://github.com/microsof…
wangchao1230 Feb 7, 2024
f33ed80
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Feb 18, 2024
50bee16
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Feb 18, 2024
cd51a3a
update to dataclass
D-W- Feb 19, 2024
25dc341
update env var
D-W- Feb 20, 2024
38da090
update `start_trace` import as it is exposed
zhengfeiwang Feb 20, 2024
cd65eac
rename imports
wangchao1230 Feb 20, 2024
f85b0d9
Merge branch 'clwan/eager-mode-sample' of https://github.com/microsof…
wangchao1230 Feb 20, 2024
1d336fd
update
wangchao1230 Feb 20, 2024
6c594ac
re-org all eager flow to singler folder
wangchao1230 Feb 21, 2024
f5965d7
update paths
wangchao1230 Feb 21, 2024
d6dea4b
update
wangchao1230 Feb 22, 2024
fdd4082
add readme for trace
lisagreenview Feb 22, 2024
61022fc
update
wangchao1230 Feb 23, 2024
4d5e437
update trace readme
lisagreenview Feb 26, 2024
5f48fb8
Merge branch 'clwan/eager-mode-sample' of https://github.com/microsof…
lisagreenview Feb 26, 2024
fc5a681
update trace README
lisagreenview Feb 26, 2024
c1a9287
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Feb 28, 2024
f9b4ee8
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Feb 29, 2024
ab8e66c
fix ci
wangchao1230 Feb 29, 2024
b5b47c7
fix flake8
wangchao1230 Mar 1, 2024
ed3c8e3
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Mar 6, 2024
30ee5ed
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Mar 7, 2024
ee10fdb
change to promptflow.tracing
wangchao1230 Mar 8, 2024
17d0f10
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Mar 8, 2024
a17489c
refine the env vars
wangchao1230 Mar 8, 2024
7ef7a93
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Mar 14, 2024
cabdb9d
update
wangchao1230 Mar 14, 2024
2cbb6dc
Merge branch 'main' into clwan/eager-mode-sample
zhengfeiwang Mar 15, 2024
466280b
add tracing example
zhengfeiwang Mar 15, 2024
2b530b4
rename as flex flows
wangchao1230 Mar 15, 2024
f81d85f
move and update gpt3.5
zhengfeiwang Mar 18, 2024
4d57c66
refine
wangchao1230 Mar 18, 2024
5ef35bc
refine
wangchao1230 Mar 18, 2024
b73e193
update autogen sample
wangchao1230 Mar 20, 2024
b58a0be
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Mar 20, 2024
a804f6e
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Mar 20, 2024
fe1ea6d
update
wangchao1230 Mar 20, 2024
98479aa
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Mar 29, 2024
2cd2193
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Mar 30, 2024
06353b9
update
wangchao1230 Apr 1, 2024
85f6f16
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Apr 1, 2024
bd52262
update requirements.txt
wangchao1230 Apr 1, 2024
358dcff
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Apr 1, 2024
e8884e0
update
wangchao1230 Apr 2, 2024
de62421
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Apr 3, 2024
150a409
fix typo
wangchao1230 Apr 3, 2024
6b7bbc9
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Apr 8, 2024
49ecec5
update
wangchao1230 Apr 8, 2024
b119649
gen workflow and readme
wangchao1230 Apr 8, 2024
146494d
update .env logic in workflow
wangchao1230 Apr 8, 2024
9d65262
update .env logic in workflow
wangchao1230 Apr 8, 2024
c6db71e
refine samples
wangchao1230 Apr 8, 2024
e98f075
refine samples
wangchao1230 Apr 8, 2024
43ec860
refine samples
wangchao1230 Apr 8, 2024
83d4e01
refine samples
wangchao1230 Apr 8, 2024
54d998a
update workflow
wangchao1230 Apr 8, 2024
c5021f0
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Apr 10, 2024
998ac5a
flow.dag.yaml to flow.flex.yaml
wangchao1230 Apr 10, 2024
21e6e85
refine
wangchao1230 Apr 10, 2024
2c4d396
update sample.json
wangchao1230 Apr 10, 2024
422c4ac
update sample
wangchao1230 Apr 10, 2024
d5d6039
refine trace doc
wangchao1230 Apr 11, 2024
e2bece6
update class based flex flow example
wangchao1230 Apr 11, 2024
a1cd2e4
make IO in events
zhengfeiwang Apr 11, 2024
8358d60
snapshot
wangchao1230 Apr 11, 2024
c1c26e0
Merge branch 'clwan/eager-mode-sample' of https://github.com/microsof…
wangchao1230 Apr 11, 2024
133707b
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Apr 11, 2024
39c6f34
snapshot
wangchao1230 Apr 12, 2024
c8ba56c
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Apr 12, 2024
432219c
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Apr 12, 2024
3ce8bdc
snapshot
wangchao1230 Apr 12, 2024
27ea88c
addd workflows for prompty examples
wangchao1230 Apr 12, 2024
635346b
snapshot
wangchao1230 Apr 12, 2024
41cb38c
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Apr 12, 2024
9e3f66d
snapshot
wangchao1230 Apr 12, 2024
6133664
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Apr 12, 2024
1737051
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Apr 12, 2024
e39e74a
update
wangchao1230 Apr 12, 2024
da2d3b4
update
wangchao1230 Apr 12, 2024
e4dee41
snapshot
wangchao1230 Apr 12, 2024
933e53a
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Apr 12, 2024
5107ee2
update deployment version
wangchao1230 Apr 12, 2024
12503c1
snapshot
wangchao1230 Apr 12, 2024
baa1f8c
snapshot
wangchao1230 Apr 12, 2024
7ba0264
snapshot
wangchao1230 Apr 12, 2024
acf91b6
snapshot
wangchao1230 Apr 12, 2024
4c6f1d6
refine env in workflow
wangchao1230 Apr 12, 2024
0552ff0
fix error
lalala123123 Apr 12, 2024
792a0ea
Merge branch 'clwan/eager-mode-sample' of https://github.com/microsof…
lalala123123 Apr 12, 2024
63eca71
fix error
lalala123123 Apr 12, 2024
8acf989
refine env in workflow
wangchao1230 Apr 12, 2024
a254a9c
fix sample
wangchao1230 Apr 12, 2024
274eba0
refine workflow
wangchao1230 Apr 12, 2024
4f29e64
update
wangchao1230 Apr 12, 2024
b6bda7b
update
wangchao1230 Apr 12, 2024
3256f60
multi container
wangchao1230 Apr 12, 2024
5a71759
fix
wangchao1230 Apr 12, 2024
fb45083
fix
wangchao1230 Apr 12, 2024
b8166f1
update
wangchao1230 Apr 15, 2024
653a77a
update trace ui screenshots
zhengfeiwang Apr 15, 2024
f73c95a
Merge branch 'clwan/eager-mode-sample' of https://github.com/microsof…
zhengfeiwang Apr 15, 2024
387f884
update
wangchao1230 Apr 15, 2024
e35d2b7
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Apr 15, 2024
652be1c
fix sample ci
wangchao1230 Apr 15, 2024
3e2e7f9
Merge branch 'clwan/eager-mode-sample' of https://github.com/microsof…
wangchao1230 Apr 15, 2024
1dfad62
resolve comments
wangchao1230 Apr 15, 2024
5fede0c
refine docs
wangchao1230 Apr 15, 2024
9f3a3bc
refine doc
wangchao1230 Apr 15, 2024
e652653
refine prompty sample
wangchao1230 Apr 16, 2024
96e19b1
refine trace doc
wangchao1230 Apr 16, 2024
3542fe6
Flex flow with connection examples (#2799)
D-W- Apr 16, 2024
05f20d9
refine sample
wangchao1230 Apr 16, 2024
420dcef
refine sample
wangchao1230 Apr 16, 2024
726016b
fix ci
wangchao1230 Apr 16, 2024
377597e
fix CI
D-W- Apr 16, 2024
082a524
firstName -> first_name
wangchao1230 Apr 16, 2024
e0a595f
Merge branch 'clwan/eager-mode-sample' of https://github.com/microsof…
wangchao1230 Apr 16, 2024
8361a73
fix
wangchao1230 Apr 16, 2024
04e43b0
Merge branch 'main' into clwan/eager-mode-sample
wangchao1230 Apr 16, 2024
261675c
update
wangchao1230 Apr 16, 2024
7fe18ed
resolve PM comments
wangchao1230 Apr 17, 2024
18de662
update requirements
0mza987 Apr 17, 2024
048136f
trigger the examples
0mza987 Apr 17, 2024
4722cc0
update
wangchao1230 Apr 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"**/*.xml",
"**/*.txt",
".gitignore",
"examples/README.md",
"examples/flex-flows/README.md",
"examples/prompty/README.md",
"scripts/docs/_build/**",
"src/promptflow-azure/promptflow/azure/_restclient/flow/**",
"src/promptflow-azure/promptflow/azure/_restclient/swagger.json",
Expand Down Expand Up @@ -188,6 +191,8 @@
"otel",
"OTLP",
"spawnv",
"arxiv",
"autogen",
"spawnve",
"addrs",
"pywin",
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/samples_connections.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ jobs:
sed -i -e "s/<your_AOAI_key>/$AOAI_API_KEY/g" -e "s/<your_AOAI_endpoint>/$AOAI_API_ENDPOINT/g" .env.example
mv .env.example .env
fi
if [[ -e ../.env.example ]]; then
echo "env replacement"
sed -i -e "s/<your_AOAI_key>/$AOAI_API_KEY/g" -e "s/<your_AOAI_endpoint>/$AOAI_API_ENDPOINT/g" ../.env.example
mv ../.env.example ../.env
fi
- name: Create run.yml
working-directory: examples/connections
run: |
Expand All @@ -74,6 +79,8 @@ jobs:
run: |
export aoai_api_key=${{secrets.AOAI_API_KEY_TEST }}
export aoai_api_endpoint=${{ secrets.AOAI_API_ENDPOINT_TEST }}
export AZURE_OPENAI_API_KEY=${{secrets.AOAI_API_KEY_TEST }}
export AZURE_OPENAI_ENDPOINT=${{ secrets.AOAI_API_ENDPOINT_TEST }}
export test_workspace_sub_id=${{ secrets.TEST_WORKSPACE_SUB_ID }}
export test_workspace_rg=${{ secrets.TEST_WORKSPACE_RG }}
export test_workspace_name=${{ secrets.TEST_WORKSPACE_NAME_CANARY }}
Expand All @@ -84,6 +91,8 @@ jobs:
run: |
export aoai_api_key=${{secrets.AOAI_API_KEY_TEST }}
export aoai_api_endpoint=${{ secrets.AOAI_API_ENDPOINT_TEST }}
export AZURE_OPENAI_API_KEY=${{secrets.AOAI_API_KEY_TEST }}
export AZURE_OPENAI_ENDPOINT=${{ secrets.AOAI_API_ENDPOINT_TEST }}
export test_workspace_sub_id=${{ secrets.TEST_WORKSPACE_SUB_ID }}
export test_workspace_rg=${{ secrets.TEST_WORKSPACE_RG }}
export test_workspace_name=${{ secrets.TEST_WORKSPACE_NAME_PROD }}
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/samples_connections_connection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ jobs:
python -m pip install --upgrade pip
pip install -r ${{ github.workspace }}/examples/requirements.txt
pip install -r ${{ github.workspace }}/examples/dev_requirements.txt
- name: setup .env file
working-directory: examples/connections
run: |
AOAI_API_KEY=${{ secrets.AOAI_API_KEY_TEST }}
AOAI_API_ENDPOINT=${{ secrets.AOAI_API_ENDPOINT_TEST }}
AOAI_API_ENDPOINT=$(echo ${AOAI_API_ENDPOINT//\//\\/})
if [[ -e .env.example ]]; then
echo "env replacement"
sed -i -e "s/<your_AOAI_key>/$AOAI_API_KEY/g" -e "s/<your_AOAI_endpoint>/$AOAI_API_ENDPOINT/g" .env.example
mv .env.example .env
fi
if [[ -e ../.env.example ]]; then
echo "env replacement"
sed -i -e "s/<your_AOAI_key>/$AOAI_API_KEY/g" -e "s/<your_AOAI_endpoint>/$AOAI_API_ENDPOINT/g" ../.env.example
mv ../.env.example ../.env
fi
- name: Create Aoai Connection
run: pf connection create -f ${{ github.workspace }}/examples/connections/azure_openai.yml --set api_key="${{ secrets.AOAI_API_KEY_TEST }}" api_base="${{ secrets.AOAI_API_ENDPOINT_TEST }}"
- name: Test Notebook
Expand Down
110 changes: 110 additions & 0 deletions .github/workflows/samples_flex_flows_basic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# This code is autogenerated.
# Code is generated by running custom script: python3 readme.py
# Any manual changes to this file may cause incorrect behavior.
# Any manual changes will be overwritten if the code is regenerated.

name: samples_flex_flows_basic
on:
schedule:
- cron: "30 20 * * *" # Every day starting at 4:30 BJT
pull_request:
branches: [ main ]
paths: [ examples/flex-flows/basic/**, examples/*requirements.txt, .github/workflows/samples_flex_flows_basic.yml ]
workflow_dispatch:

env:
IS_IN_CI_PIPELINE: "true"

jobs:
samples_flex_flows_basic:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python 3.9 environment
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Prepare requirements
working-directory: examples
run: |
if [[ -e requirements.txt ]]; then
python -m pip install --upgrade pip
pip install -r requirements.txt
fi
- name: Prepare dev requirements
working-directory: examples
run: |
python -m pip install --upgrade pip
pip install -r dev_requirements.txt
- name: Refine .env file
working-directory: examples/flex-flows/basic
run: |
AOAI_API_KEY=${{ secrets.AOAI_API_KEY_TEST }}
AOAI_API_ENDPOINT=${{ secrets.AOAI_API_ENDPOINT_TEST }}
AOAI_API_ENDPOINT=$(echo ${AOAI_API_ENDPOINT//\//\\/})
if [[ -e .env.example ]]; then
echo "env replacement"
sed -i -e "s/<your_AOAI_key>/$AOAI_API_KEY/g" -e "s/<your_AOAI_endpoint>/$AOAI_API_ENDPOINT/g" .env.example
mv .env.example .env
fi
if [[ -e ../.env.example ]]; then
echo "env replacement"
sed -i -e "s/<your_AOAI_key>/$AOAI_API_KEY/g" -e "s/<your_AOAI_endpoint>/$AOAI_API_ENDPOINT/g" ../.env.example
mv ../.env.example ../.env
fi
- name: Create run.yml
working-directory: examples/flex-flows/basic
run: |
gpt_base=${{ secrets.AOAI_API_ENDPOINT_TEST }}
gpt_base=$(echo ${gpt_base//\//\\/})
if [[ -e run.yml ]]; then
sed -i -e "s/\${azure_open_ai_connection.api_key}/${{ secrets.AOAI_API_KEY_TEST }}/g" -e "s/\${azure_open_ai_connection.api_base}/$gpt_base/g" run.yml
fi
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Extract Steps examples/flex-flows/basic/README.md
working-directory: ${{ github.workspace }}
run: |
python scripts/readme/extract_steps_from_readme.py -f examples/flex-flows/basic/README.md -o examples/flex-flows/basic
- name: Cat script
working-directory: examples/flex-flows/basic
run: |
cat bash_script.sh
- name: Run scripts against canary workspace (scheduled runs only)
if: github.event_name == 'schedule'
working-directory: examples/flex-flows/basic
run: |
export aoai_api_key=${{secrets.AOAI_API_KEY_TEST }}
export aoai_api_endpoint=${{ secrets.AOAI_API_ENDPOINT_TEST }}
export AZURE_OPENAI_API_KEY=${{secrets.AOAI_API_KEY_TEST }}
export AZURE_OPENAI_ENDPOINT=${{ secrets.AOAI_API_ENDPOINT_TEST }}
export test_workspace_sub_id=${{ secrets.TEST_WORKSPACE_SUB_ID }}
export test_workspace_rg=${{ secrets.TEST_WORKSPACE_RG }}
export test_workspace_name=${{ secrets.TEST_WORKSPACE_NAME_CANARY }}
bash bash_script.sh
- name: Run scripts against production workspace
if: github.event_name != 'schedule'
working-directory: examples/flex-flows/basic
run: |
export aoai_api_key=${{secrets.AOAI_API_KEY_TEST }}
export aoai_api_endpoint=${{ secrets.AOAI_API_ENDPOINT_TEST }}
export AZURE_OPENAI_API_KEY=${{secrets.AOAI_API_KEY_TEST }}
export AZURE_OPENAI_ENDPOINT=${{ secrets.AOAI_API_ENDPOINT_TEST }}
export test_workspace_sub_id=${{ secrets.TEST_WORKSPACE_SUB_ID }}
export test_workspace_rg=${{ secrets.TEST_WORKSPACE_RG }}
export test_workspace_name=${{ secrets.TEST_WORKSPACE_NAME_PROD }}
bash bash_script.sh
- name: Pip List for Debug
if : ${{ always() }}
working-directory: examples/flex-flows/basic
run: |
pip list
- name: Upload artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: artifact
path: examples/flex-flows/basic/bash_script.sh
110 changes: 110 additions & 0 deletions .github/workflows/samples_flex_flows_chat_basic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# This code is autogenerated.
# Code is generated by running custom script: python3 readme.py
# Any manual changes to this file may cause incorrect behavior.
# Any manual changes will be overwritten if the code is regenerated.

name: samples_flex_flows_chat_basic
on:
schedule:
- cron: "9 20 * * *" # Every day starting at 4:9 BJT
pull_request:
branches: [ main ]
paths: [ examples/flex-flows/chat-basic/**, examples/*requirements.txt, .github/workflows/samples_flex_flows_chat_basic.yml ]
workflow_dispatch:

env:
IS_IN_CI_PIPELINE: "true"

jobs:
samples_flex_flows_chat_basic:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python 3.9 environment
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Prepare requirements
working-directory: examples
run: |
if [[ -e requirements.txt ]]; then
python -m pip install --upgrade pip
pip install -r requirements.txt
fi
- name: Prepare dev requirements
working-directory: examples
run: |
python -m pip install --upgrade pip
pip install -r dev_requirements.txt
- name: Refine .env file
working-directory: examples/flex-flows/chat-basic
run: |
AOAI_API_KEY=${{ secrets.AOAI_API_KEY_TEST }}
AOAI_API_ENDPOINT=${{ secrets.AOAI_API_ENDPOINT_TEST }}
AOAI_API_ENDPOINT=$(echo ${AOAI_API_ENDPOINT//\//\\/})
if [[ -e .env.example ]]; then
echo "env replacement"
sed -i -e "s/<your_AOAI_key>/$AOAI_API_KEY/g" -e "s/<your_AOAI_endpoint>/$AOAI_API_ENDPOINT/g" .env.example
mv .env.example .env
fi
if [[ -e ../.env.example ]]; then
echo "env replacement"
sed -i -e "s/<your_AOAI_key>/$AOAI_API_KEY/g" -e "s/<your_AOAI_endpoint>/$AOAI_API_ENDPOINT/g" ../.env.example
mv ../.env.example ../.env
fi
- name: Create run.yml
working-directory: examples/flex-flows/chat-basic
run: |
gpt_base=${{ secrets.AOAI_API_ENDPOINT_TEST }}
gpt_base=$(echo ${gpt_base//\//\\/})
if [[ -e run.yml ]]; then
sed -i -e "s/\${azure_open_ai_connection.api_key}/${{ secrets.AOAI_API_KEY_TEST }}/g" -e "s/\${azure_open_ai_connection.api_base}/$gpt_base/g" run.yml
fi
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Extract Steps examples/flex-flows/chat-basic/README.md
working-directory: ${{ github.workspace }}
run: |
python scripts/readme/extract_steps_from_readme.py -f examples/flex-flows/chat-basic/README.md -o examples/flex-flows/chat-basic
- name: Cat script
working-directory: examples/flex-flows/chat-basic
run: |
cat bash_script.sh
- name: Run scripts against canary workspace (scheduled runs only)
if: github.event_name == 'schedule'
working-directory: examples/flex-flows/chat-basic
run: |
export aoai_api_key=${{secrets.AOAI_API_KEY_TEST }}
export aoai_api_endpoint=${{ secrets.AOAI_API_ENDPOINT_TEST }}
export AZURE_OPENAI_API_KEY=${{secrets.AOAI_API_KEY_TEST }}
export AZURE_OPENAI_ENDPOINT=${{ secrets.AOAI_API_ENDPOINT_TEST }}
export test_workspace_sub_id=${{ secrets.TEST_WORKSPACE_SUB_ID }}
export test_workspace_rg=${{ secrets.TEST_WORKSPACE_RG }}
export test_workspace_name=${{ secrets.TEST_WORKSPACE_NAME_CANARY }}
bash bash_script.sh
- name: Run scripts against production workspace
if: github.event_name != 'schedule'
working-directory: examples/flex-flows/chat-basic
run: |
export aoai_api_key=${{secrets.AOAI_API_KEY_TEST }}
export aoai_api_endpoint=${{ secrets.AOAI_API_ENDPOINT_TEST }}
export AZURE_OPENAI_API_KEY=${{secrets.AOAI_API_KEY_TEST }}
export AZURE_OPENAI_ENDPOINT=${{ secrets.AOAI_API_ENDPOINT_TEST }}
export test_workspace_sub_id=${{ secrets.TEST_WORKSPACE_SUB_ID }}
export test_workspace_rg=${{ secrets.TEST_WORKSPACE_RG }}
export test_workspace_name=${{ secrets.TEST_WORKSPACE_NAME_PROD }}
bash bash_script.sh
- name: Pip List for Debug
if : ${{ always() }}
working-directory: examples/flex-flows/chat-basic
run: |
pip list
- name: Upload artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: artifact
path: examples/flex-flows/chat-basic/bash_script.sh
Loading
Loading