Skip to content

Latest commit

 

History

History
 
 

examples

Promptflow examples

code style: black license: MIT

Get started

Install dependencies

  • Bootstrap your python environment.
    • e.g: create a new conda environment. conda create -n pf-examples python=3.9.
    • install required packages in python environment : pip install -r requirements.txt
      • show installed sdk: pip show promptflow

Quick start

path status description
quickstart.ipynb samples_getstarted_quickstart A quickstart tutorial to run a flow and evaluate it.
quickstart-azure.ipynb samples_getstarted_quickstartazure A quickstart tutorial to run a flow in Azure AI and evaluate it.

CLI examples

Tutorials (tutorials)

path status description
chat-with-pdf samples_tutorials_e2e_development_chat_with_pdf Retrieval Augmented Generation (or RAG) has become a prevalent pattern to build intelligent application with Large Language Models (or LLMs) since it can infuse external knowledge into the model, which is not trained with those up-to-date or proprietary information
azure-app-service samples_tutorials_flow_deploy_azure_app_service This example demos how to deploy a flow using Azure App Service
docker samples_tutorials_flow_deploy_docker This example demos how to deploy flow as a docker app
kubernetes samples_tutorials_flow_deploy_kubernetes This example demos how to deploy flow as a Kubernetes app

Flows (flows)

path status description
autonomous-agent samples_flows_standard_autonomous_agent This is a flow showcasing how to construct a AutoGPT agent with promptflow to autonomously figures out how to apply the given functions to solve the goal, which is film trivia that provides accurate and up-to-date information about movies, directors, actors, and more in this sample
basic samples_flows_standard_basic A basic standard flow using custom python tool that calls Azure OpenAI with connection info stored in environment variables
basic-with-builtin-llm samples_flows_standard_basic_with_builtin_llm A basic standard flow that calls Azure OpenAI with builtin llm tool
basic-with-connection samples_flows_standard_basic_with_connection A basic standard flow that using custom python tool calls Azure OpenAI with connection info stored in custom connection
conditional-flow-for-if-else samples_flows_standard_conditional_flow_for_if_else This example is a conditional flow for if-else scenario
conditional-flow-for-switch samples_flows_standard_conditional_flow_for_switch This example is a conditional flow for switch scenario
customer-intent-extraction samples_flows_standard_customer_intent_extraction This sample is using OpenAI chat model(ChatGPT/GPT4) to identify customer intent from customer's question
flow-with-additional-includes samples_flows_standard_flow_with_additional_includes User sometimes need to reference some common files or folders, this sample demos how to solve the problem using additional_includes
flow-with-symlinks samples_flows_standard_flow_with_symlinks User sometimes need to reference some common files or folders, this sample demos how to solve the problem using symlinks
gen-docstring samples_flows_standard_gen_docstring This example can help you automatically generate Python code's docstring and return the modified code
maths-to-code samples_flows_standard_maths_to_code Math to Code is a project that utilizes the power of the chatGPT model to generate code that models math questions and then executes the generated code to obtain the final numerical answer
named-entity-recognition samples_flows_standard_named_entity_recognition A flow that perform named entity recognition task
web-classification samples_flows_standard_web_classification This is a flow demonstrating multi-class classification with LLM
path status description
eval-basic samples_flows_evaluation_eval_basic This example shows how to create a basic evaluation flow
eval-classification-accuracy samples_flows_evaluation_eval_classification_accuracy This is a flow illustrating how to evaluate the performance of a classification system
eval-entity-match-rate samples_flows_evaluation_eval_entity_match_rate This is a flow evaluates: entity match rate
eval-groundedness samples_flows_evaluation_eval_groundedness This is a flow leverage llm to eval groundedness: whether answer is stating facts that are all present in the given context
eval-perceived-intelligence samples_flows_evaluation_eval_perceived_intelligence This is a flow leverage llm to eval perceived intelligence
path status description
basic-chat samples_flows_chat_basic_chat This example shows how to create a basic chat flow
chat-with-pdf samples_flows_chat_chat_with_pdf This is a simple flow that allow you to ask questions about the content of a PDF file and get answers
chat-with-wikipedia samples_flows_chat_chat_with_wikipedia This flow demonstrates how to create a chatbot that can remember previous interactions and use the conversation history to generate next message

Connections (connections)

path status description
connections samples_connections This folder contains example YAML files for creating connection using pf cli

SDK examples

path status description
quickstart.ipynb samples_getstarted_quickstart A quickstart tutorial to run a flow and evaluate it.
quickstart-azure.ipynb samples_getstarted_quickstartazure A quickstart tutorial to run a flow in Azure AI and evaluate it.
cloud-run-management.ipynb samples_runmanagement_cloudrunmanagement Flow run management in Azure AI
connection.ipynb samples_connections_connection Manage various types of connections using sdk
chat-with-pdf-azure.ipynb samples_flows_chat_chatwithpdf_chatwithpdfazure A tutorial of chat-with-pdf flow that executes in Azure AI
chat-with-pdf.ipynb samples_flows_chat_chatwithpdf_chatwithpdf A tutorial of chat-with-pdf flow that allows user ask questions about the content of a PDF file and get answers

Contributing

We welcome contributions and suggestions! Please see the contributing guidelines for details.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. Please see the code of conduct for details.

Reference