Skip to content

Commit

Permalink
refine samples
Browse files Browse the repository at this point in the history
  • Loading branch information
wangchao1230 committed Apr 8, 2024
1 parent 9d65262 commit c6db71e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
13 changes: 9 additions & 4 deletions examples/flex-flows/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand All @@ -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

Expand Down Expand Up @@ -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
```

Expand All @@ -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
Expand Down
9 changes: 7 additions & 2 deletions examples/flex-flows/chat-basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
```

Expand Down
5 changes: 5 additions & 0 deletions examples/flex-flows/eval-checklist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.\"}'
Expand Down
5 changes: 5 additions & 0 deletions examples/flex-flows/eval-code-quality/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit c6db71e

Please sign in to comment.