From 4f29e6484cc6d50bbe05e4f838560782662188c3 Mon Sep 17 00:00:00 2001 From: Clement Wang Date: Fri, 12 Apr 2024 20:08:00 +0800 Subject: [PATCH] update --- .../flex-flows/eval-checklist/check_list.py | 2 +- examples/prompty/chat-basic/README.md | 25 +------------------ examples/tutorials/tracing/math_to_code.py | 2 +- 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/examples/flex-flows/eval-checklist/check_list.py b/examples/flex-flows/eval-checklist/check_list.py index 6c6e08f2831..f7a755e17b1 100644 --- a/examples/flex-flows/eval-checklist/check_list.py +++ b/examples/flex-flows/eval-checklist/check_list.py @@ -58,7 +58,7 @@ def check(answer: str, statement: str): class EvalFlow: - + def __init__(self) -> None: pass diff --git a/examples/prompty/chat-basic/README.md b/examples/prompty/chat-basic/README.md index 1a0001c9443..069a50b85b7 100644 --- a/examples/prompty/chat-basic/README.md +++ b/examples/prompty/chat-basic/README.md @@ -103,27 +103,4 @@ pf run show --name $name # show output pf run show-details --name $name -``` - -## Run prompty with connection -Storing connection info in .env with plaintext is not safe. We recommend to use `pf connection` to guard secrets like `api_key` from leak. - -- Test using connection secret specified in environment variables -**Note**: we used `'` to wrap value since it supports raw value without escape in powershell & bash. For windows command prompt, you may remove the `'` to avoid it become part of the value. - -```bash -# test with default input value in flow.flex.yaml -pf flow test --flow . --environment-variables AZURE_OPENAI_API_KEY='${open_ai_connection.api_key}' AZURE_OPENAI_ENDPOINT='${open_ai_connection.api_base}' -``` - -- Create run using connection secret binding specified in environment variables, see [run.yml](run.yml) -```bash -# create run -pf run create --flow . --data ./data.jsonl --stream --environment-variables AZURE_OPENAI_API_KEY='${open_ai_connection.api_key}' AZURE_OPENAI_ENDPOINT='${open_ai_connection.api_base}' --column-mapping question='${data.question}' -# create run using yaml file -pf run create --file run.yml --stream - -# show outputs -name=$(pf run list -r 10 | jq '.[] | select(.name | contains("chat_basic_")) | .name'| head -n 1 | tr -d '"') -pf run show-details --name $name -``` +``` \ No newline at end of file diff --git a/examples/tutorials/tracing/math_to_code.py b/examples/tutorials/tracing/math_to_code.py index aa549d31ad7..8c1ed983ec6 100644 --- a/examples/tutorials/tracing/math_to_code.py +++ b/examples/tutorials/tracing/math_to_code.py @@ -59,7 +59,7 @@ def code_gen(client: AzureOpenAI, question: str) -> str: "Make sure only reply the executable code, no other words." ) completion = client.chat.completions.create( - model=os.getenv("CHAT_DEPLOYMENT_NAME"), + model=os.getenv("CHAT_DEPLOYMENT_NAME", "gpt-35-turbo"), messages=[ { "role": "system",