Skip to content

17. PromptFlow: Run

[!hint] In the previous section, you should have opened Visual Studio Code, navigated to the contoso-chat folder, and opened the flow.dag.yaml file in the Visual Editor view.

  • [] 01 | View contoso-chat/flow.dag.yaml in the Visual Studio Code editor

    • Make sure your cursor is at the top of the file in editor panel.
    • Make sure you are in the Visual editor with a view like this. Note: this is an example screenshot, and not the exact one for this lab.
  • [] 02 | Run the prompt flow locally

    • Tip: Keep VS Code terminal open to view console output.
    • Look at the 2nd line (starting with "+LLM") in Visual Editor.
    • Look for a 'tool' icon at right: It should show a valid Python env.
    • Look for a 'play' icon next to it: The tooltip should read "Run All".
    • Click Run All (or use "Shift + F5" on keyboard)
    • Select "Run it with standard mode" in dropdown
  • [] 03 | Explore inputs and outputs of flow

    • The Inputs section will have these values:
      • chat_history: prior turns in chat (default=blank)
      • question: customer's most recent question
      • customerid: to help look up relevant customer context (e.g., order history) to refine response with more relevant context. This is the basis for RAG (retrieval-augmented generation).
    • The Contoso Outdoors web app provides these inputs (in demo)
    • Note the contents of the Flow run outputs tab under "Outputs" section
      • Use the navigation tools to show the complete answer: Is it a good answer to the input question?
      • Use the nvaigation tools to explore the returned context (products relevant to the customer's question). _Are these good selections for context?
  • [] 04 | Explore Individual Flow Nodes

    • Observe node status colors in VS Code (green=success, red=error)
    • Click any node. The left pane will scroll to show execution details.
    • Click the Code: link in component to see function executed here.
  • [] 05 | Explore Run Stats & Traces

    • Click the "Terminal" tab. It should show final response returned.
    • Click the "Prompt Flow" tab. Select a node in visual editor.
      • Tab shows "node name, Tokens, duration" stats for node.
      • Click the line in table. You should see more details in pane.
  • [] 06 | Try a new input

    • In Inputs, change question to "What is a good tent for a beginner?"
    • Click Run All, explore outputs as before.
    • In Inputs, change customerId (to value between 1 and 12)
    • Click Run All, compare this output to before.
    • Experiment with other input values and analyze outputs.

🥳 Congratulations!
You ran your contoso-chat prompt flow successfully in the local runtime on GitHub Codespaces. Next, we want to evaluate the performance of the flow.