Files
wehub-resource-sync e768098d0e
Flake8 Lint / flake8 (push) Waiting to run
Publish Promptflow Doc / Build (push) Waiting to run
Publish Promptflow Doc / Deploy (push) Blocked by required conditions
Spell check CI / Spell_Check (push) Waiting to run
tools_continuous_delivery / Private PyPI main branch release (push) Waiting to run
tools_continuous_delivery / Private PyPI non-main branch release (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 13:39:52 +08:00

2.1 KiB
Raw Permalink Blame History

Test your prompt variants for chat with math

This is a prompt tuning case with 3 prompt variants for math question answering.

By utilizing this flow, in conjunction with the evaluation/eval-chat-math flow, you can quickly grasp the advantages of prompt tuning and experimentation with prompt flow. Here we provide a video and a tutorial for you to get started.

Tools used in this flow

  • llm tool
  • custom python Tool

Prerequisites

Install promptflow sdk and other dependencies in this folder:

pip install -r requirements.txt

Getting started

1 Create connection for LLM tool to use

Go to "Prompt flow" "Connections" tab. Click on "Create" button, select one of LLM tool supported connection types and fill in the configurations.

Currently, there are two connection types supported by LLM tool: "AzureOpenAI" and "OpenAI". If you want to use "AzureOpenAI" connection type, you need to create an Azure OpenAI service first. Please refer to Azure OpenAI Service for more details. If you want to use "OpenAI" connection type, you need to create an OpenAI account first. Please refer to OpenAI for more details.

# Override keys with --set to avoid yaml file changes
pf connection create --file ../../../connections/azure_openai.yml --set api_key=<your_api_key> api_base=<your_api_base> --name open_ai_connection

Note in flow.dag.yaml we are using connection named open_ai_connection.

# show registered connection 
pf connection show --name open_ai_connection

2 Start chatting

# run chat flow with default question in flow.dag.yaml
pf flow test --flow . 

# run chat flow with new question
pf flow test --flow . --inputs question="2+5=?"

# start a interactive chat session in CLI
pf flow test --flow . --interactive

# start a interactive chat session in CLI with verbose info
pf flow test --flow . --interactive --verbose