Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wangchao1230 committed Apr 12, 2024
1 parent 274eba0 commit 4f29e64
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 26 deletions.
2 changes: 1 addition & 1 deletion examples/flex-flows/eval-checklist/check_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def check(answer: str, statement: str):


class EvalFlow:

def __init__(self) -> None:
pass

Expand Down
25 changes: 1 addition & 24 deletions examples/prompty/chat-basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
```
2 changes: 1 addition & 1 deletion examples/tutorials/tracing/math_to_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4f29e64

Please sign in to comment.