From the course: Build with AI: Building Prompt Flows with Azure AI Foundry

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Use Python tools in prompt flow

Use Python tools in prompt flow

- [Instructor] Python is a powerful, easy to learn programming language with many useful libraries and a broad industry adoption. Let's look at how to use the Python tool in Prompt Flow. Here's our demo chat flow in the actual AI foundry portal. This flow answers user questions about California tools. At this moment, the flow contains inputs, outputs, one prompt based node called prepare prompt, and one L and M based node called chat. Now we have a new requirement. The business offers several tour packages for cities like Los Angeles, San Francisco, and Santa Monica. They want to add a promotional message at the end of the chat when the conversation relates to the cities. For example, if a user asks something about Santa Monica Pier, the output message will include a sentence like, find amazing tour deals on our website for Santa Monica. I will add a Python tool after the inputs to find the city mentioned in the user question. Click add Python in the menu. Enter a note name, for…

Contents