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

Add how to build copilot tutorial #2688

Merged
merged 148 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
709e56a
outline
Jan 9, 2024
8378cd7
update
Jan 9, 2024
a2d8efd
update
Jan 11, 2024
0ff7f81
update
Jan 12, 2024
9341681
update
16oeahr Jan 15, 2024
d81e898
update
16oeahr Jan 16, 2024
0c39bf2
move flow to outside
16oeahr Jan 16, 2024
2365015
add data gen flow
Jan 17, 2024
740670e
fix bug and update
Jan 18, 2024
9e5068c
rename
Jan 18, 2024
4f5c6ee
fix conflict
Jan 18, 2024
e50e6f8
refine template
Jan 18, 2024
405de77
update
Jan 18, 2024
ba61e40
update requirements txt and fix links
Jan 18, 2024
6398572
refine generate context prompt
Jan 18, 2024
444185c
update
Jan 19, 2024
4c7c80f
Merge branch 'feature/test_data_gen' of https://github.com/microsoft/…
Jan 19, 2024
4ae8a3e
refine prompt
Jan 19, 2024
a4b7fd8
Merge branch 'feature/test_data_gen' of https://github.com/microsoft/…
Jan 19, 2024
9af8d8c
update test data contract to add debug_info
Jan 22, 2024
8185af8
update flow and fix line 0 cleaned error
Jan 23, 2024
3641b42
update ground truth prompt
Jan 23, 2024
eed9f55
update flow
Jan 25, 2024
86dc787
Refactor code (#1860)
chenslucky Jan 26, 2024
9f7ff03
update data construction doc
Jan 26, 2024
418bdfe
Add mode logs (#1865)
chenslucky Jan 26, 2024
945c0f9
add debug info
Jan 29, 2024
f4bdb4a
refactor structure and refine configs
Jan 30, 2024
9bf15a1
add documents nodes file
Jan 30, 2024
a96e808
rename
Jan 30, 2024
8c46b97
add config
Jan 30, 2024
042133f
refine the structure
Jan 30, 2024
cc6e2a4
remove docs
Jan 30, 2024
9594414
remove config.ini
Jan 30, 2024
afd703c
fix flake 8
Jan 30, 2024
7c0ee33
add logger
Jan 30, 2024
cf03e5f
refine logs
Jan 30, 2024
838f535
rename flow some parameters
Jan 30, 2024
b27c99a
fix flake 8
Jan 30, 2024
23d5076
update to use score
Jan 30, 2024
546209c
Merge branch 'feature/test_data_gen' of https://github.com/microsoft/…
Jan 30, 2024
c840ad0
update docs
Jan 30, 2024
3e82857
resolve conflict
Jan 30, 2024
ab0cc14
refine a simple doc version
Jan 30, 2024
90ef65d
update docs
Jan 31, 2024
762f1a6
improve data gen flow (#1897)
chjinche Feb 1, 2024
b34e198
Update flow structure (#1907)
16oeahr Feb 1, 2024
c5c6b0e
Fix some comments (#1912)
chenslucky Feb 1, 2024
1efe84a
Fix clean data component (#1915)
chenslucky Feb 1, 2024
91066a3
improve log, prompt and dag (#1920)
chjinche Feb 2, 2024
f1ea25e
[data gen] lazy import all azure dependencies, remove connection_name…
chjinche Feb 2, 2024
f405a7c
[data gen] fix mldesigner cannot find component issue (#1928)
chjinche Feb 2, 2024
e17e992
Seprate cloud part (#1926)
16oeahr Feb 2, 2024
feb8063
[data gen] streaming log batch run progress, modify debug info, modif…
chjinche Feb 4, 2024
c52f285
Support relative path (#1938)
16oeahr Feb 4, 2024
5c2318e
[data gen] fix doc links, progress bar, hide max_tokens (#1941)
chjinche Feb 4, 2024
5c16943
Override node inputs (#1937)
chenslucky Feb 4, 2024
0889951
Update config.ini.example
chenslucky Feb 4, 2024
cc0d876
Fix version and invalid file path (#1949)
16oeahr Feb 4, 2024
5807c8a
Override flow component name (#1951)
chenslucky Feb 4, 2024
ffc3ef9
fix flow run on portal (#1953)
16oeahr Feb 4, 2024
4326c1d
fix batch run output json empty error (#1957)
16oeahr Feb 4, 2024
8686ef6
Filter unsupport file types (#1956)
chenslucky Feb 4, 2024
6bd4bcd
rename logger name of node inputs override (#1964)
chjinche Feb 5, 2024
0ddcfa5
[data gen] comment document_nodes_file, fix typo/broken links in doc …
chjinche Feb 5, 2024
cce07d2
fix stuck issue when connection name is wrong (#1975)
chjinche Feb 5, 2024
877d85b
Refine generate document nodes logic (#1985)
chenslucky Feb 7, 2024
776b712
add new line (#1999)
chjinche Feb 7, 2024
5726662
Support data asset input (#2040)
chenslucky Feb 19, 2024
356441e
Convert config.ini to config.yml (#2062)
chenslucky Feb 23, 2024
6f08f09
Merge branch 'main' into feature/test_data_gen
16oeahr Feb 27, 2024
c0bb62c
Tune prompt to avoid question with `in this context/in given code/in …
chenslucky Feb 28, 2024
f6dca7c
Add summary info of data gen details (#2161)
16oeahr Mar 1, 2024
88c546d
add eval flows and simulation flow
gegao-MS Mar 15, 2024
f8934dc
Fix cspell flask compliance and schema validation errors
gegao-MS Mar 18, 2024
febacac
Fix flake8 and flow schema validation errors
gegao-MS Mar 18, 2024
29ca97a
Refine metrics name
gegao-MS Mar 20, 2024
4237a2d
fix name miss match
gegao-MS Mar 20, 2024
b5bf3b9
Refine
gegao-MS Mar 20, 2024
0c38a6e
Merge branch 'main' into feature/test_data_gen
16oeahr Mar 26, 2024
8949c08
Remove copy flow folder, fix cspell and doc link ci (#2253)
16oeahr Mar 26, 2024
77b885e
change file name
gegao-MS Mar 27, 2024
1d2a9da
Change flow name
gegao-MS Mar 28, 2024
f566731
improve gen test data doc, config, error message, and pin llamaindex …
chjinche Mar 28, 2024
fac95f4
Add workflow fow examples
gegao-MS Mar 28, 2024
5332809
rrefine
gegao-MS Mar 28, 2024
f6338d2
Change jinja2 file to contains #
gegao-MS Mar 28, 2024
8ec6aa7
Change typo 'assistent' to 'assistant'
gegao-MS Mar 28, 2024
632eb6a
fix typo
gegao-MS Mar 28, 2024
59273c7
Move flow folder, fix tool warning and fix progress bar (#2520)
16oeahr Mar 28, 2024
ffd6c78
Merge branch 'main' into feature/test_data_gen
16oeahr Mar 28, 2024
7ed1f43
Merge branch 'main' into feature/test_data_gen
16oeahr Mar 29, 2024
9d6bfdb
Fix summary error caused by empty lines (#2544)
16oeahr Mar 29, 2024
f0c7cd5
improve doc, update config.yml.example, double quote node input overr…
chjinche Mar 29, 2024
c7dc65b
Merge branch 'main' into feature/test_data_gen
chjinche Mar 29, 2024
bec08d4
remove unnecessary ignorefile
chjinche Mar 29, 2024
02872e2
remove blank lines
chjinche Mar 29, 2024
0c6be9c
Merge branch 'main' into feature/test_data_gen
chjinche Mar 29, 2024
c19127c
Change from promptflow to from promptflow.core
gegao-MS Mar 29, 2024
1f0a7bf
Fix flake error
gegao-MS Mar 29, 2024
7eb077e
Merge remote-tracking branch 'origin/feature/test_data_gen' into meng…
melionel Apr 3, 2024
9afe8ad
Merge remote-tracking branch 'origin/users/gega/addevalsimulationflow…
melionel Apr 3, 2024
85b045e
add develop-promptflow-copilot tutorial
melionel Apr 8, 2024
b17394b
add promptflow copilot sample flow
melionel Apr 8, 2024
b55043a
refine words
melionel Apr 8, 2024
121df0c
modify links for gen test data doc
melionel Apr 8, 2024
95b443a
add readme file for copilot flow
melionel Apr 8, 2024
7b15352
add tutorial to index
melionel Apr 9, 2024
2b7d4fa
fix flake error
melionel Apr 9, 2024
3968ee8
fix flow yaml schema
melionel Apr 9, 2024
c5b0035
update document
melionel Apr 9, 2024
def4be7
add vectordb to requirements
melionel Apr 9, 2024
144fb72
update image
melionel Apr 9, 2024
8fbdae4
add vector db to examples requirement
melionel Apr 9, 2024
ce376aa
update doc link
melionel Apr 9, 2024
e29fbbc
import tool from core
melionel Apr 10, 2024
1523d41
use PR link for now
melionel Apr 10, 2024
22bb5c5
Merge branch 'main' into mengla/copilot_sample
melionel Apr 10, 2024
ba3a3ae
remove unknow field
melionel Apr 10, 2024
14cc9aa
use PR link for now
melionel Apr 10, 2024
e033035
Merge branch 'mengla/copilot_sample' of https://github.com/microsoft/…
melionel Apr 10, 2024
0aa6405
Merge branch 'main' into mengla/copilot_sample
melionel Apr 10, 2024
90709b4
Merge branch 'main' into mengla/copilot_sample
melionel Apr 23, 2024
78433a1
add to index.md
melionel Apr 23, 2024
efc4e75
Merge branch 'main' into mengla/copilot_sample
melionel Apr 23, 2024
ce48741
Merge branch 'main' into mengla/copilot_sample
melionel Apr 23, 2024
341b052
Merge branch 'main' into mengla/copilot_sample
melionel Apr 24, 2024
a4d2511
Merge branch 'main' into mengla/copilot_sample
melionel Apr 25, 2024
31714b9
Merge branch 'main' into mengla/copilot_sample
melionel Apr 25, 2024
e268845
fix doc
melionel Apr 26, 2024
9614264
Merge branch 'main' into mengla/copilot_sample
melionel Apr 26, 2024
ee44e59
Merge branch 'main' into mengla/copilot_sample
melionel Apr 30, 2024
25fdd14
Merge branch 'main' into mengla/copilot_sample
melionel May 6, 2024
8ee19b5
Merge branch 'main' into mengla/copilot_sample
melionel May 6, 2024
152ed5b
Merge branch 'main' into mengla/copilot_sample
melionel May 6, 2024
f4a43c4
Merge branch 'main' into mengla/copilot_sample
melionel May 6, 2024
7321082
fix doc link
melionel May 6, 2024
0dca96a
run readme
melionel May 7, 2024
0b385b2
Merge branch 'main' into mengla/copilot_sample
melionel May 8, 2024
898477e
Merge branch 'main' into mengla/copilot_sample
melionel May 8, 2024
c9a95c5
Merge branch 'main' into mengla/copilot_sample
melionel May 8, 2024
0e7fd71
Merge branch 'main' into mengla/copilot_sample
melionel May 8, 2024
0d3e4a1
remove unnecessary require
melionel May 8, 2024
c81e30d
Merge branch 'main' into mengla/copilot_sample
melionel May 8, 2024
32c7f65
remove vectordb dependency from python node
melionel May 9, 2024
a0f6072
Merge branch 'mengla/copilot_sample' of https://github.com/microsoft/…
melionel May 9, 2024
466cd0a
add black line
melionel May 9, 2024
93c9a14
Merge branch 'main' into mengla/copilot_sample
melionel May 9, 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
3 changes: 3 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
"meid",
"Entra",
"uvicorn",
"attribited",
"MistralAI"
],
"ignoreWords": [
Expand Down Expand Up @@ -208,6 +209,8 @@
"wscript",
"raisvc",
"evals",
"setenv",
"pypdf",
"redoc",
"starlette",
"mlindex",
Expand Down
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_flows_evaluation_eval_multi_turn_metrics
on:
schedule:
- cron: "7 21 * * *" # Every day starting at 5:7 BJT
pull_request:
branches: [ main ]
paths: [ examples/flows/evaluation/eval-multi-turn-metrics/**, examples/*requirements.txt, .github/workflows/samples_flows_evaluation_eval_multi_turn_metrics.yml ]
workflow_dispatch:

env:
IS_IN_CI_PIPELINE: "true"

jobs:
samples_flows_evaluation_eval_multi_turn_metrics:
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/flows/evaluation/eval-multi-turn-metrics
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/flows/evaluation/eval-multi-turn-metrics
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/flows/evaluation/eval-multi-turn-metrics/README.md
working-directory: ${{ github.workspace }}
run: |
python scripts/readme/extract_steps_from_readme.py -f examples/flows/evaluation/eval-multi-turn-metrics/README.md -o examples/flows/evaluation/eval-multi-turn-metrics
- name: Cat script
working-directory: examples/flows/evaluation/eval-multi-turn-metrics
run: |
cat bash_script.sh
- name: Run scripts against canary workspace (scheduled runs only)
if: github.event_name == 'schedule'
working-directory: examples/flows/evaluation/eval-multi-turn-metrics
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/flows/evaluation/eval-multi-turn-metrics
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/flows/evaluation/eval-multi-turn-metrics
run: |
pip list
- name: Upload artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: artifact
path: examples/flows/evaluation/eval-multi-turn-metrics/bash_script.sh
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_flows_evaluation_eval_single_turn_metrics
on:
schedule:
- cron: "32 19 * * *" # Every day starting at 3:32 BJT
pull_request:
branches: [ main ]
paths: [ examples/flows/evaluation/eval-single-turn-metrics/**, examples/*requirements.txt, .github/workflows/samples_flows_evaluation_eval_single_turn_metrics.yml ]
workflow_dispatch:

env:
IS_IN_CI_PIPELINE: "true"

jobs:
samples_flows_evaluation_eval_single_turn_metrics:
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/flows/evaluation/eval-single-turn-metrics
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/flows/evaluation/eval-single-turn-metrics
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/flows/evaluation/eval-single-turn-metrics/README.md
working-directory: ${{ github.workspace }}
run: |
python scripts/readme/extract_steps_from_readme.py -f examples/flows/evaluation/eval-single-turn-metrics/README.md -o examples/flows/evaluation/eval-single-turn-metrics
- name: Cat script
working-directory: examples/flows/evaluation/eval-single-turn-metrics
run: |
cat bash_script.sh
- name: Run scripts against canary workspace (scheduled runs only)
if: github.event_name == 'schedule'
working-directory: examples/flows/evaluation/eval-single-turn-metrics
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/flows/evaluation/eval-single-turn-metrics
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/flows/evaluation/eval-single-turn-metrics
run: |
pip list
- name: Upload artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: artifact
path: examples/flows/evaluation/eval-single-turn-metrics/bash_script.sh
110 changes: 110 additions & 0 deletions .github/workflows/samples_flows_standard_question_simulation.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_flows_standard_question_simulation
on:
schedule:
- cron: "37 19 * * *" # Every day starting at 3:37 BJT
pull_request:
branches: [ main ]
paths: [ examples/flows/standard/question-simulation/**, examples/*requirements.txt, .github/workflows/samples_flows_standard_question_simulation.yml ]
workflow_dispatch:

env:
IS_IN_CI_PIPELINE: "true"

jobs:
samples_flows_standard_question_simulation:
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/flows/standard/question-simulation
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/flows/standard/question-simulation
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/flows/standard/question-simulation/README.md
working-directory: ${{ github.workspace }}
run: |
python scripts/readme/extract_steps_from_readme.py -f examples/flows/standard/question-simulation/README.md -o examples/flows/standard/question-simulation
- name: Cat script
working-directory: examples/flows/standard/question-simulation
run: |
cat bash_script.sh
- name: Run scripts against canary workspace (scheduled runs only)
if: github.event_name == 'schedule'
working-directory: examples/flows/standard/question-simulation
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/flows/standard/question-simulation
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/flows/standard/question-simulation
run: |
pip list
- name: Upload artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: artifact
path: examples/flows/standard/question-simulation/bash_script.sh
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ connection.json
.azureml
# dummy custom tool package example
hello-world-proj/**
# gen test data config
examples/gen_test_data/config.yml
# secrets
**/connections.json

Expand Down
36 changes: 36 additions & 0 deletions docs/cloud/azureai/generate-test-data-cloud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# How to generate test data in cloud based on documents
This guide will help you learn how to generate test data on Azure AI, so that you can integrate the created flow and process a large amount of data.


## Prerequisites

1. Go through [local test data generation guide](https://github.com/microsoft/promptflow/blob/53a685dbff920e891ef61cacb5f2f19e761ee809/docs/how-to-guides/generate-test-data.md) and prepare your [test data generation flow](https://github.com/microsoft/promptflow/blob/53a685dbff920e891ef61cacb5f2f19e761ee809/examples/gen_test_data/example_flow/).
2. Go to the [example_gen_test_data](https://github.com/microsoft/promptflow/blob/53a685dbff920e891ef61cacb5f2f19e761ee809/examples/gen_test_data) folder and run command `pip install -r requirements_cloud.txt` to prepare local environment.
3. Prepare cloud environment.
- Navigate to file [conda.yml](https://github.com/microsoft/promptflow/blob/53a685dbff920e891ef61cacb5f2f19e761ee809/examples/gen_test_data/conda.yml).
- For specific document file types, you may need to install extra packages:
- .docx - `pip install docx2txt`
- .pdf - `pip install pypdf`
- .ipynb - `pip install nbconvert`
> !Note: We use llama index `SimpleDirectoryReader` to load documents. For the latest information on required packages, please check [here](https://docs.llamaindex.ai/en/stable/examples/data_connectors/simple_directory_reader.html).

4. Prepare Azure AI resources in cloud.
- An Azure AI ML workspace - [Create workspace resources you need to get started with Azure AI](https://learn.microsoft.com/en-us/azure/machine-learning/quickstart-create-resources?view=azureml-api-2).
- A compute target - [Learn more about compute cluster](https://learn.microsoft.com/en-us/azure/machine-learning/concept-compute-target?view=azureml-api-2).
5. [Create cloud AzureOpenAI or OpenAI connection](https://microsoft.github.io/promptflow/cloud/azureai/run-promptflow-in-azure-ai.html#create-necessary-connections)

6. Prepare test data generation setting.
- Navigate to [example_gen_test_data](https://github.com/microsoft/promptflow/blob/53a685dbff920e891ef61cacb5f2f19e761ee809/examples/gen_test_data) folder.
- Prepare `config.yml` by copying [`config.yml.example`](https://github.com/microsoft/promptflow/blob/53a685dbff920e891ef61cacb5f2f19e761ee809/examples/gen_test_data/config.yml.example).
- Fill in configurations in the `config.yml` by following inline comment instructions.


## Generate test data at cloud
For handling larger test data, you can leverage the PRS component to run flow in cloud.
- Navigate to [example_gen_test_data](https://github.com/microsoft/promptflow/blob/53a685dbff920e891ef61cacb5f2f19e761ee809/examples/gen_test_data) folder.
- After configuration, run the following command to generate the test data set:
```bash
python -m gen_test_data.run --cloud
```

- The generated test data will be a data asset which can be found in the output of the last node. You can register this data asset for future use.
Loading
Loading