From c6db71e629538b0dfbed5e9e8c6c19cb5e87f76c Mon Sep 17 00:00:00 2001 From: Clement Wang Date: Mon, 8 Apr 2024 17:24:12 +0800 Subject: [PATCH] refine samples --- examples/flex-flows/basic/README.md | 13 +++++++++---- examples/flex-flows/chat-basic/README.md | 9 +++++++-- examples/flex-flows/eval-checklist/README.md | 5 +++++ examples/flex-flows/eval-code-quality/README.md | 5 +++++ .../otlp-trace-collector.ipynb | 2 +- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/examples/flex-flows/basic/README.md b/examples/flex-flows/basic/README.md index 1c14cc133f7..e9f313e36cc 100644 --- a/examples/flex-flows/basic/README.md +++ b/examples/flex-flows/basic/README.md @@ -20,7 +20,12 @@ Ensure you have put your azure open ai endpoint key in [.env](../.env) file. You cat ../.env ``` -- Test flow/node +- Run/Debug as normal Python file +```bash +python flow.py +``` + +- Test flow ```bash # test with default input value in flow.dag.yaml pf flow test --flow . @@ -46,7 +51,7 @@ pf run list # get a sample run name -name=$(pf run list -r 10 | jq '.[] | select(.name | contains("basic_code_first")) | .name'| head -n 1 | tr -d '"') +name=$(pf run list -r 10 | jq '.[] | select(.name | contains("basic_")) | .name'| head -n 1 | tr -d '"') # show specific run detail pf run show --name $name @@ -86,7 +91,7 @@ pf run create --flow . --data ./data.jsonl --stream --environment-variables AZUR pf run create --file run.yml --stream # show outputs -name=$(pf run list -r 10 | jq '.[] | select(.name | contains("basic_variant_0")) | .name'| head -n 1 | tr -d '"') +name=$(pf run list -r 10 | jq '.[] | select(.name | contains("basic_")) | .name'| head -n 1 | tr -d '"') pf run show-details --name $name ``` @@ -112,7 +117,7 @@ pfazure run create --file run.yml --stream pfazure run list -r 3 # get a sample run name -name=$(pfazure run list -r 100 | jq '.[] | select(.name | contains("basic_code_first")) | .name'| head -n 1 | tr -d '"') +name=$(pfazure run list -r 100 | jq '.[] | select(.name | contains("basic_")) | .name'| head -n 1 | tr -d '"') # show specific run detail pfazure run show --name $name diff --git a/examples/flex-flows/chat-basic/README.md b/examples/flex-flows/chat-basic/README.md index 1fd3dd1fc3f..7631fb02cd9 100644 --- a/examples/flex-flows/chat-basic/README.md +++ b/examples/flex-flows/chat-basic/README.md @@ -44,7 +44,12 @@ Ensure you have put your azure open ai endpoint key in [.env](../.env) file. You cat ../.env ``` -- Test flow/node +- Run as normal Python file +```bash +python flow.py +``` + +- Test flow ```bash # run chat flow with default question in flow.dag.yaml @@ -112,7 +117,7 @@ pf run create --flow . --data ./data.jsonl --stream --environment-variables AZUR pf run create --file run.yml --stream # show outputs -name=$(pf run list -r 10 | jq '.[] | select(.name | contains("basic_variant_0")) | .name'| head -n 1 | tr -d '"') +name=$(pf run list -r 10 | jq '.[] | select(.name | contains("chat_basic_")) | .name'| head -n 1 | tr -d '"') pf run show-details --name $name ``` diff --git a/examples/flex-flows/eval-checklist/README.md b/examples/flex-flows/eval-checklist/README.md index f5ba144119c..e3f6b7ea6e4 100644 --- a/examples/flex-flows/eval-checklist/README.md +++ b/examples/flex-flows/eval-checklist/README.md @@ -20,6 +20,11 @@ Ensure you have put your azure open ai endpoint key in [.env](../.env) file. You cat ../.env ``` +- Run as normal Python file +```bash +python check_list.py +``` + - Test flow ```bash pf flow test --flow . --inputs answer='ChatGPT is a conversational AI model developed by OpenAI. It is based on the GPT-3 architecture and is designed to generate human-like responses to text inputs. ChatGPT is capable of understanding and responding to a wide range of topics and can be used for tasks such as answering questions, generating creative content, and providing assistance with various tasks. The model has been trained on a diverse range of internet text and is constantly being updated to improve its performance and capabilities. ChatGPT is available through the OpenAI API and can be accessed by developers and researchers to build applications and tools that leverage its capabilities.' statements='{\"correctness\":\"It contains a detailed explanation of ChatGPT.\"}' diff --git a/examples/flex-flows/eval-code-quality/README.md b/examples/flex-flows/eval-code-quality/README.md index 880319596dc..ce2486e86ee 100644 --- a/examples/flex-flows/eval-code-quality/README.md +++ b/examples/flex-flows/eval-code-quality/README.md @@ -20,6 +20,11 @@ Ensure you have put your azure open ai endpoint key in [.env](../.env) file. You cat ../.env ``` +- Run as normal Python file +```bash +python code_quality.py +``` + - Test flow ```bash # correct diff --git a/examples/tutorials/trace/custom-otlp-collector/otlp-trace-collector.ipynb b/examples/tutorials/trace/custom-otlp-collector/otlp-trace-collector.ipynb index 17e25bde38a..291d254191d 100644 --- a/examples/tutorials/trace/custom-otlp-collector/otlp-trace-collector.ipynb +++ b/examples/tutorials/trace/custom-otlp-collector/otlp-trace-collector.ipynb @@ -166,7 +166,7 @@ } ], "metadata": { - "description": "A tutorial on how to levarage custom OLTP collector.", + "description": "A tutorial on how to levarage custom OTLP collector.", "kernelspec": { "display_name": "tracing-rel", "language": "python",