-
Notifications
You must be signed in to change notification settings - Fork 895
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into jiazeng/template
- Loading branch information
Showing
34 changed files
with
506 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
...workflows/samples_tools_use_cases_custom_strong_type_connection_package_tool_showcase.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# 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_tools_use_cases_custom_strong_type_connection_package_tool_showcase | ||
on: | ||
schedule: | ||
- cron: "0 20 * * *" # Every day starting at 4:0 BJT | ||
pull_request: | ||
branches: [ main ] | ||
paths: [ examples/tools/use-cases/custom-strong-type-connection-package-tool-showcase/**, examples/*requirements.txt, .github/workflows/samples_tools_use_cases_custom_strong_type_connection_package_tool_showcase.yml ] | ||
workflow_dispatch: | ||
|
||
env: | ||
IS_IN_CI_PIPELINE: "true" | ||
|
||
jobs: | ||
samples_readme_ci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Python 3.9 environment | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
- name: Generate config.json | ||
run: echo '${{ secrets.TEST_WORKSPACE_CONFIG_JSON_CANARY }}' > ${{ github.workspace }}/examples/config.json | ||
- 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/tools/use-cases/custom-strong-type-connection-package-tool-showcase | ||
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 | ||
- name: Create run.yml | ||
working-directory: examples/tools/use-cases/custom-strong-type-connection-package-tool-showcase | ||
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/tools/use-cases/custom-strong-type-connection-package-tool-showcase/README.md | ||
working-directory: ${{ github.workspace }} | ||
run: | | ||
python scripts/readme/extract_steps_from_readme.py -f examples/tools/use-cases/custom-strong-type-connection-package-tool-showcase/README.md -o examples/tools/use-cases/custom-strong-type-connection-package-tool-showcase | ||
- name: Cat script | ||
working-directory: examples/tools/use-cases/custom-strong-type-connection-package-tool-showcase | ||
run: | | ||
cat bash_script.sh | ||
- name: Run scripts | ||
working-directory: examples/tools/use-cases/custom-strong-type-connection-package-tool-showcase | ||
run: | | ||
export aoai_api_key=${{secrets.AOAI_API_KEY_TEST }} | ||
export aoai_api_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: Pip List for Debug | ||
if : ${{ always() }} | ||
working-directory: examples/tools/use-cases/custom-strong-type-connection-package-tool-showcase | ||
run: | | ||
pip list | ||
- name: Upload artifact | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: artifact | ||
path: examples/tools/use-cases/custom-strong-type-connection-package-tool-showcase/bash_script.sh |
92 changes: 92 additions & 0 deletions
92
.../workflows/samples_tools_use_cases_custom_strong_type_connection_script_tool_showcase.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# 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_tools_use_cases_custom_strong_type_connection_script_tool_showcase | ||
on: | ||
schedule: | ||
- cron: "58 20 * * *" # Every day starting at 4:58 BJT | ||
pull_request: | ||
branches: [ main ] | ||
paths: [ examples/tools/use-cases/custom-strong-type-connection-script-tool-showcase/**, examples/*requirements.txt, .github/workflows/samples_tools_use_cases_custom_strong_type_connection_script_tool_showcase.yml ] | ||
workflow_dispatch: | ||
|
||
env: | ||
IS_IN_CI_PIPELINE: "true" | ||
|
||
jobs: | ||
samples_readme_ci: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Setup Python 3.9 environment | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
- name: Generate config.json | ||
run: echo '${{ secrets.TEST_WORKSPACE_CONFIG_JSON_CANARY }}' > ${{ github.workspace }}/examples/config.json | ||
- 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/tools/use-cases/custom-strong-type-connection-script-tool-showcase | ||
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 | ||
- name: Create run.yml | ||
working-directory: examples/tools/use-cases/custom-strong-type-connection-script-tool-showcase | ||
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/tools/use-cases/custom-strong-type-connection-script-tool-showcase/README.md | ||
working-directory: ${{ github.workspace }} | ||
run: | | ||
python scripts/readme/extract_steps_from_readme.py -f examples/tools/use-cases/custom-strong-type-connection-script-tool-showcase/README.md -o examples/tools/use-cases/custom-strong-type-connection-script-tool-showcase | ||
- name: Cat script | ||
working-directory: examples/tools/use-cases/custom-strong-type-connection-script-tool-showcase | ||
run: | | ||
cat bash_script.sh | ||
- name: Run scripts | ||
working-directory: examples/tools/use-cases/custom-strong-type-connection-script-tool-showcase | ||
run: | | ||
export aoai_api_key=${{secrets.AOAI_API_KEY_TEST }} | ||
export aoai_api_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: Pip List for Debug | ||
if : ${{ always() }} | ||
working-directory: examples/tools/use-cases/custom-strong-type-connection-script-tool-showcase | ||
run: | | ||
pip list | ||
- name: Upload artifact | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: artifact | ||
path: examples/tools/use-cases/custom-strong-type-connection-script-tool-showcase/bash_script.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
examples/tools/tool-package-quickstart/tests/test_tool_with_cascading_inputs.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from my_tool_package.tools.tool_with_cascading_inputs import my_tool | ||
|
||
|
||
def test_my_tool(): | ||
result = my_tool(user_type="student", student_id="student_id") | ||
assert result == '123' |
6 changes: 0 additions & 6 deletions
6
examples/tools/tool-package-quickstart/tests/test_tool_with_enabled_by_value.py
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.