├── .cspell.json ├── .devcontainer ├── Dockerfile ├── README.md ├── codespaces.png ├── default_requirements.txt ├── devcontainer.json └── devcontainers.png ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── vsc_bug_report.md ├── PULL_REQUEST_TEMPLATE.md ├── actions │ ├── step_create_conda_environment │ │ └── action.yml │ ├── step_create_python_environment │ │ └── action.yml │ ├── step_generate_configs │ │ └── action.yml │ ├── step_publish_test_results │ │ └── action.yml │ ├── step_sdk_setup │ │ └── action.yml │ └── step_sdk_setup_win │ │ └── action.yml ├── labeler.yml ├── pipelines │ └── compliance_check.yml └── workflows │ ├── build_doc_ci.yml │ ├── check_enforcer.yml │ ├── create_promptflow_release_branch.yml │ ├── create_promptflow_release_tag.yml │ ├── flake8.yml │ ├── labeler.yml │ ├── promptflow-executor-e2e-test.yml │ ├── promptflow-executor-unit-test.yml │ ├── promptflow-global-config-test.yml │ ├── promptflow-release-testing-matrix.yml │ ├── promptflow-sdk-cli-test.yml │ ├── promptflow-sdk-pfs-e2e-test.yml │ ├── publish_doc.yml │ ├── samples_configuration.yml │ ├── samples_connections.yml │ ├── samples_connections_connection.yml │ ├── samples_flows_chat_basic_chat.yml │ ├── samples_flows_chat_chat_with_pdf.yml │ ├── samples_flows_chat_chat_with_wikipedia.yml │ ├── samples_flows_chat_chatwithpdf_chatwithpdf.yml │ ├── samples_flows_chat_chatwithpdf_chatwithpdfazure.yml │ ├── samples_flows_evaluation_eval_basic.yml │ ├── samples_flows_evaluation_eval_classification_accuracy.yml │ ├── samples_flows_evaluation_eval_entity_match_rate.yml │ ├── samples_flows_evaluation_eval_groundedness.yml │ ├── samples_flows_evaluation_eval_perceived_intelligence.yml │ ├── samples_flows_standard_autonomous_agent.yml │ ├── samples_flows_standard_basic.yml │ ├── samples_flows_standard_basic_with_builtin_llm.yml │ ├── samples_flows_standard_basic_with_connection.yml │ ├── samples_flows_standard_conditional_flow_for_if_else.yml │ ├── samples_flows_standard_conditional_flow_for_switch.yml │ ├── samples_flows_standard_customer_intent_extraction.yml │ ├── samples_flows_standard_flow_with_additional_includes.yml │ ├── samples_flows_standard_flow_with_symlinks.yml │ ├── samples_flows_standard_gen_docstring.yml │ ├── samples_flows_standard_maths_to_code.yml │ ├── samples_flows_standard_named_entity_recognition.yml │ ├── samples_flows_standard_web_classification.yml │ ├── samples_getstarted_quickstart.yml │ ├── samples_getstarted_quickstartazure.yml │ ├── samples_runmanagement_cloudrunmanagement.yml │ ├── samples_tutorials_e2e_development_chat_with_pdf.yml │ ├── samples_tutorials_flow_deploy_azure_app_service.yml │ ├── samples_tutorials_flow_deploy_distribute_flow_as_executable_app.yml │ ├── samples_tutorials_flow_deploy_docker.yml │ ├── samples_tutorials_flow_deploy_kubernetes.yml │ ├── spell_check.yml │ ├── tools_continuous_delivery.yml │ ├── tools_deploy_runtime.yml │ ├── tools_release_tag.yml │ ├── tools_secret_upload.yml │ ├── tools_tests.yml │ └── wheel_distributing.yml ├── .gitignore ├── .pre-commit-config.yaml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SECURITY.md ├── SUPPORT.md ├── docs ├── README.md ├── cloud │ ├── azureai │ │ ├── deploy-to-azure-appservice.md │ │ ├── faq.md │ │ └── quick-start.md │ └── index.md ├── concepts │ ├── concept-connections.md │ ├── concept-flows.md │ ├── concept-tools.md │ ├── concept-variants.md │ ├── design-principles.md │ └── index.md ├── dev │ ├── dev_setup.md │ └── documentation_guidelines.md ├── how-to-guides │ ├── add-conditional-control-to-a-flow.md │ ├── deploy-a-flow │ │ ├── deploy-using-dev-server.md │ │ ├── deploy-using-docker.md │ │ ├── deploy-using-kubernetes.md │ │ ├── distribute-flow-as-executable-app.md │ │ └── index.md │ ├── develop-a-flow │ │ ├── develop-chat-flow.md │ │ ├── develop-standard-flow.md │ │ └── index.md │ ├── develop-a-tool │ │ ├── add-a-tool-icon.md │ │ ├── create-and-use-tool-package.md │ │ └── index.md │ ├── enable-streaming-mode.md │ ├── faq.md │ ├── index.md │ ├── init-and-test-a-flow.md │ ├── manage-connections.md │ ├── manage-runs.md │ ├── quick-start.md │ ├── run-and-evaluate-a-flow.md │ ├── set-global-configs.md │ ├── tune-prompts-with-variants.md │ └── use-column-mapping.md ├── index.md ├── media │ ├── cloud │ │ └── azureml │ │ │ ├── deploy_appservice_azure_portal_img.png │ │ │ ├── deploy_appservice_set_env_var.png │ │ │ ├── deploy_appservice_test_page.png │ │ │ └── local-to-cloud-run-webview.png │ ├── column_mapping_details.png │ ├── contributing │ │ ├── auto-list-tool-in-extension.png │ │ ├── auto-list-tool-in-studio.png │ │ ├── custom-tool-list-in-extension.png │ │ ├── custom-tool-with-icon-in-extension.png │ │ ├── f12_payload.png │ │ ├── input-relationship.png │ │ ├── install-vsix.png │ │ ├── mapping_input_description.png │ │ ├── tool-folder-structure.png │ │ ├── tool-tooltip.png │ │ └── view-detail.gif │ ├── dev_setup │ │ ├── set_up_pycharm_0.png │ │ ├── set_up_pycharm_1.png │ │ ├── set_up_pycharm_2.png │ │ ├── set_up_vscode_0.png │ │ ├── set_up_vscode_1.png │ │ ├── set_up_vscode_2.png │ │ ├── set_up_vscode_3.png │ │ ├── set_up_vscode_4.png │ │ └── set_up_vscode_5.png │ ├── edit-this-page.png │ ├── how-to-guides │ │ ├── appservice.png │ │ ├── conditional-flow-with-activate │ │ │ ├── activate_config.png │ │ │ ├── activate_when_bypassed.png │ │ │ ├── bypassed_nodes.png │ │ │ ├── dependencies_bypassed.png │ │ │ ├── output_bypassed.png │ │ │ ├── provide_default_value.png │ │ │ └── visual_editor.png │ │ ├── create_connection.png │ │ ├── deploy_flow.png │ │ ├── deploy_flow_test_page.png │ │ ├── develop-a-tool │ │ │ └── use_file_path_in_flow.png │ │ ├── develop-standard-flow │ │ │ ├── add_tool.png │ │ │ ├── edit_tool.png │ │ │ ├── flow_input.png │ │ │ ├── flow_output.png │ │ │ ├── link_llm_with_flow_input_single_output_node.png │ │ │ ├── link_llm_with_multi_output_node.png │ │ │ └── link_python_with_flow_node_input.png │ │ ├── docker.png │ │ ├── how-to-enable-streaming-mode │ │ │ ├── chat_app.gif │ │ │ ├── chat_wikipedia_center.png │ │ │ ├── chat_wikipedia_dual_output_center.png │ │ │ └── scripts │ │ │ │ ├── chat_app.py │ │ │ │ └── event_stream.py │ │ ├── init-and-test-a-flow │ │ │ ├── chat.png │ │ │ ├── flow_folder.png │ │ │ ├── flow_init_files.png │ │ │ ├── flow_init_output.png │ │ │ ├── flow_output_files.png │ │ │ ├── flow_test.png │ │ │ ├── streaming_output.gif │ │ │ ├── vscode_new_flow_1.png │ │ │ ├── vscode_new_flow_2.png │ │ │ └── vscode_test_flow_yaml_codelens.png │ │ ├── kubernetes.png │ │ ├── local.png │ │ ├── quick-start │ │ │ ├── batch_run_dag_yaml.png │ │ │ ├── bulk_run_visual_editor.png │ │ │ ├── flow-directory-and-dag-yaml.png │ │ │ ├── flow-run-create-output-cli.png │ │ │ ├── flow-run-create-output-sdk.png │ │ │ ├── flow-run-create-with-stream-output-sdk.png │ │ │ ├── flow-run-show-details-output-cli.png │ │ │ ├── flow-run-show-details-output-sdk.png │ │ │ ├── flow-run-visualize-single-run.png │ │ │ ├── flow-test-output-cli.png │ │ │ ├── flow_dag.png │ │ │ ├── flow_directory.png │ │ │ ├── flow_test_output.png │ │ │ ├── test_flow_dag_editor.gif │ │ │ ├── test_flow_dag_yaml.gif │ │ │ ├── vs_code_connection_0.png │ │ │ ├── vs_code_connection_1.png │ │ │ ├── vs_code_connection_2.png │ │ │ ├── vs_code_connection_3.png │ │ │ ├── vs_code_dag_0.png │ │ │ ├── vs_code_interpreter_0.png │ │ │ ├── vs_code_interpreter_1.png │ │ │ └── vscode-flow-dag.png │ │ ├── run_create.png │ │ ├── run_list.png │ │ ├── run_show.png │ │ ├── run_show_details.png │ │ ├── run_show_metrics.png │ │ ├── run_visualize.png │ │ ├── visualize_run.png │ │ ├── vscode-tool-list.png │ │ ├── vscode_against_run.png │ │ ├── vscode_against_run_2.png │ │ ├── vscode_batch_run_visual.png │ │ ├── vscode_batch_run_yaml.png │ │ ├── vscode_create_connection.png │ │ ├── vscode_create_connection_1.png │ │ ├── vscode_export.png │ │ ├── vscode_export_as_docker.png │ │ ├── vscode_export_as_local_app.png │ │ ├── vscode_interactive_chat.png │ │ ├── vscode_interactive_chat_1.png │ │ ├── vscode_list_connection.png │ │ ├── vscode_list_runs.png │ │ ├── vscode_open_visual_editor.png │ │ ├── vscode_run_actions.png │ │ ├── vscode_run_detail.png │ │ ├── vscode_single_node_debug_visual.png │ │ ├── vscode_single_node_debug_yaml.png │ │ ├── vscode_single_node_test.png │ │ ├── vscode_single_node_test_visual.png │ │ ├── vscode_start_local_app.png │ │ ├── vscode_test_flow_visual.png │ │ ├── vscode_test_flow_yaml.png │ │ ├── vscode_update_delete_connection.png │ │ ├── vscode_variants_folded.png │ │ └── vscode_variants_unfold.png │ ├── overview │ │ └── prompt_flow_lifecycle.png │ ├── promptflow-dag.png │ └── reference │ │ └── tools-reference │ │ └── open_source_llm_on_vscode_promptflow.png ├── reference │ ├── flow-yaml-schema-reference.md │ ├── index.md │ ├── pf-command-reference.md │ ├── pfazure-command-reference.md │ ├── python-library-reference │ │ └── promptflow.md │ └── tools-reference │ │ ├── embedding_tool.md │ │ ├── faiss_index_lookup_tool.md │ │ ├── llm-tool.md │ │ ├── open_source_llm_tool.md │ │ ├── prompt-tool.md │ │ ├── python-tool.md │ │ ├── serp-api-tool.md │ │ └── vector_db_lookup_tool.md └── tutorials │ └── index.md ├── examples ├── CONTRIBUTING.md ├── README.md ├── configuration.ipynb ├── connections │ ├── .env.example │ ├── README.md │ ├── azure_content_safety.yml │ ├── azure_openai.yml │ ├── cognitive_search.yml │ ├── connection.ipynb │ ├── custom.yml │ ├── openai.yml │ ├── requirements.txt │ └── serp.yml ├── dev_requirements.txt ├── flows │ ├── chat │ │ ├── basic-chat │ │ │ ├── README.md │ │ │ ├── chat.jinja2 │ │ │ ├── data.jsonl │ │ │ ├── flow.dag.yaml │ │ │ └── requirements.txt │ │ ├── chat-with-pdf │ │ │ ├── .promptflow │ │ │ │ └── flow.tools.json │ │ │ ├── README.md │ │ │ ├── __init__.py │ │ │ ├── assets │ │ │ │ ├── batch-run.gif │ │ │ │ ├── chat_with_pdf_console.png │ │ │ │ ├── chat_with_pdf_simple.png │ │ │ │ ├── chat_with_pdf_test_endpoint.png │ │ │ │ ├── chat_with_pdf_test_page.png │ │ │ │ ├── chat_with_pdf_with_rewrite.png │ │ │ │ ├── chatbot_console.gif │ │ │ │ ├── edge-chat-pdf.png │ │ │ │ ├── multi-node-flow-chat-with-pdf.png │ │ │ │ ├── pf-visualize-screenshot.png │ │ │ │ └── single-node-flow.png │ │ │ ├── batch_run.yaml │ │ │ ├── build_index_tool.py │ │ │ ├── chat-with-pdf-azure.ipynb │ │ │ ├── chat-with-pdf.ipynb │ │ │ ├── chat_with_pdf │ │ │ │ ├── .env.example │ │ │ │ ├── README.md │ │ │ │ ├── __init__.py │ │ │ │ ├── build_index.py │ │ │ │ ├── download.py │ │ │ │ ├── find_context.py │ │ │ │ ├── main.py │ │ │ │ ├── qna.py │ │ │ │ ├── qna_prompt.md │ │ │ │ ├── rewrite_question.py │ │ │ │ ├── rewrite_question_prompt.md │ │ │ │ ├── test.ipynb │ │ │ │ └── utils │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── index.py │ │ │ │ │ ├── lock.py │ │ │ │ │ ├── logging.py │ │ │ │ │ ├── oai.py │ │ │ │ │ └── retry.py │ │ │ ├── chat_with_pdf_tool.py │ │ │ ├── data │ │ │ │ ├── bert-paper-qna-1-line.jsonl │ │ │ │ ├── bert-paper-qna-3-line.jsonl │ │ │ │ ├── bert-paper-qna.jsonl │ │ │ │ └── invalid-data-missing-column.jsonl │ │ │ ├── download_tool.py │ │ │ ├── eval_run.yaml │ │ │ ├── find_context_tool.py │ │ │ ├── flow.dag.yaml │ │ │ ├── flow.dag.yaml.multi-node │ │ │ ├── flow.dag.yaml.single-node │ │ │ ├── openai.yaml │ │ │ ├── qna_tool.py │ │ │ ├── requirements.txt │ │ │ ├── rewrite_question_tool.py │ │ │ ├── runtime_env │ │ │ │ ├── Dockerfile │ │ │ │ ├── build.sh │ │ │ │ ├── environment_runtime.yaml │ │ │ │ └── requirements.txt │ │ │ ├── setup_env.py │ │ │ └── tests │ │ │ │ ├── azure_chat_with_pdf_test.py │ │ │ │ ├── base_test.py │ │ │ │ └── chat_with_pdf_test.py │ │ └── chat-with-wikipedia │ │ │ ├── README.md │ │ │ ├── augmented_chat.jinja2 │ │ │ ├── data.jsonl │ │ │ ├── extract_query_from_question.jinja2 │ │ │ ├── flow.dag.yaml │ │ │ ├── get_wiki_url.py │ │ │ ├── process_search_result.py │ │ │ ├── requirements.txt │ │ │ └── search_result_from_url.py │ ├── evaluation │ │ ├── eval-accuracy-maths-to-code │ │ │ ├── aggregate.py │ │ │ ├── flow.dag.yaml │ │ │ ├── line_process.py │ │ │ └── test_data.jsonl │ │ ├── eval-basic │ │ │ ├── README.md │ │ │ ├── aggregate.py │ │ │ ├── data.jsonl │ │ │ ├── flow.dag.yaml │ │ │ ├── line_process.py │ │ │ └── requirements.txt │ │ ├── eval-classification-accuracy │ │ │ ├── README.md │ │ │ ├── calculate_accuracy.py │ │ │ ├── data.jsonl │ │ │ ├── flow.dag.yaml │ │ │ ├── grade.py │ │ │ └── requirements.txt │ │ ├── eval-entity-match-rate │ │ │ ├── README.md │ │ │ ├── cleansing.py │ │ │ ├── data.jsonl │ │ │ ├── flow.dag.yaml │ │ │ ├── is_match_test.py │ │ │ ├── log_metrics.py │ │ │ ├── match.py │ │ │ └── requirements.txt │ │ ├── eval-groundedness │ │ │ ├── README.md │ │ │ ├── aggregate.py │ │ │ ├── calc_groundedness.py │ │ │ ├── data.jsonl │ │ │ ├── flow.dag.yaml │ │ │ ├── gpt_groundedness.md │ │ │ └── requirements.txt │ │ └── eval-perceived-intelligence │ │ │ ├── README.md │ │ │ ├── aggregate.py │ │ │ ├── data.jsonl │ │ │ ├── flow.dag.yaml │ │ │ ├── gpt_perceived_intelligence.md │ │ │ ├── parse_score.py │ │ │ └── requirements.txt │ └── standard │ │ ├── autonomous-agent │ │ ├── README.md │ │ ├── autogpt_class.py │ │ ├── autogpt_easy_start.py │ │ ├── data.jsonl │ │ ├── flow.dag.yaml │ │ ├── functions.py │ │ ├── generate_goal.py │ │ ├── python_repl.py │ │ ├── requirements.txt │ │ ├── system_prompt.jinja2 │ │ ├── triggering_prompt.jinja2 │ │ ├── user_prompt.jinja2 │ │ ├── util.py │ │ └── wiki_search.py │ │ ├── basic-with-builtin-llm │ │ ├── README.md │ │ ├── data.jsonl │ │ ├── flow.dag.yaml │ │ ├── hello.jinja2 │ │ └── requirements.txt │ │ ├── basic-with-connection │ │ ├── README.md │ │ ├── custom.yml │ │ ├── data.jsonl │ │ ├── flow.dag.yaml │ │ ├── hello.jinja2 │ │ ├── hello.py │ │ └── requirements.txt │ │ ├── basic │ │ ├── .env.example │ │ ├── README.md │ │ ├── data.jsonl │ │ ├── flow.dag.yaml │ │ ├── hello.jinja2 │ │ ├── hello.py │ │ ├── requirements.txt │ │ └── run.yml │ │ ├── conditional-flow-for-if-else │ │ ├── README.md │ │ ├── content_safety_check.py │ │ ├── content_safety_check_failed.png │ │ ├── content_safety_check_passed.png │ │ ├── data.jsonl │ │ ├── default_result.py │ │ ├── flow.dag.yaml │ │ ├── generate_result.py │ │ ├── llm_result.py │ │ └── requirements.txt │ │ ├── conditional-flow-for-switch │ │ ├── README.md │ │ ├── class_check.py │ │ ├── classify_with_llm.jinja2 │ │ ├── conditional_flow_for_switch.png │ │ ├── data.jsonl │ │ ├── flow.dag.yaml │ │ ├── generate_response.py │ │ ├── order_search.py │ │ ├── product_info.py │ │ ├── product_recommendation.py │ │ └── requirements.txt │ │ ├── customer-intent-extraction │ │ ├── .amlignore │ │ ├── .env.example │ │ ├── .promptflow │ │ │ └── flow.tools.json │ │ ├── README.md │ │ ├── data │ │ │ └── denormalized-flat.jsonl │ │ ├── extract_intent_tool.py │ │ ├── flow.dag.yaml │ │ ├── inputs.json │ │ ├── intent.py │ │ ├── requirements.txt │ │ ├── user_intent_few_shot.jinja2 │ │ └── user_intent_zero_shot.jinja2 │ │ ├── filepath-input-tool-showcase │ │ ├── flow.dag.yaml │ │ ├── hello_method.py │ │ └── requirements.txt │ │ ├── flow-with-additional-includes │ │ ├── README.md │ │ ├── data.jsonl │ │ ├── flow.dag.yaml │ │ ├── requirements.txt │ │ ├── run.yml │ │ └── run_evaluation.yml │ │ ├── flow-with-symlinks │ │ ├── .promptflow │ │ │ └── flow.tools.json │ │ ├── README.md │ │ ├── create_symlinks.py │ │ ├── flow.dag.yaml │ │ └── requirements.txt │ │ ├── gen-docstring │ │ ├── README.md │ │ ├── azure_open_ai.py │ │ ├── combine_code.jinja2 │ │ ├── combine_code_tool.py │ │ ├── data.jsonl │ │ ├── diff.py │ │ ├── divide_code_tool.py │ │ ├── divider.py │ │ ├── doc_format.jinja2 │ │ ├── file.py │ │ ├── flow.dag.yaml │ │ ├── generate_docstring_tool.py │ │ ├── load_code_tool.py │ │ ├── main.py │ │ ├── prompt.py │ │ ├── requirements.txt │ │ └── result.png │ │ ├── maths-to-code │ │ ├── README.md │ │ ├── ask_llm.jinja2 │ │ ├── code_execution.py │ │ ├── code_refine.py │ │ ├── flow.dag.yaml │ │ ├── math_data.jsonl │ │ ├── math_example.py │ │ ├── math_test.ipynb │ │ ├── prompt_gen.jinja2 │ │ └── requirements.txt │ │ ├── named-entity-recognition │ │ ├── NER-test.ipynb │ │ ├── NER_LLM.jinja2 │ │ ├── README.md │ │ ├── cleansing.py │ │ ├── cleansing_test.py │ │ ├── data.jsonl │ │ ├── eval_test.py │ │ ├── flow.dag.yaml │ │ └── requirements.txt │ │ └── web-classification │ │ ├── .promptflow │ │ └── flow.tools.json │ │ ├── README.md │ │ ├── classify_with_llm.jinja2 │ │ ├── convert_to_dict.py │ │ ├── data.jsonl │ │ ├── fetch_text_content_from_url.py │ │ ├── flow.dag.yaml │ │ ├── prepare_examples.py │ │ ├── requirements.txt │ │ ├── run.yml │ │ ├── run_evaluation.yml │ │ ├── summarize_text_content.jinja2 │ │ └── summarize_text_content__variant_1.jinja2 ├── requirements.txt ├── setup.sh ├── tools │ └── tool-package-quickstart │ │ ├── MANIFEST.in │ │ ├── my_tool_package │ │ ├── __init__.py │ │ ├── icons │ │ │ └── custom-tool-icon.png │ │ ├── tools │ │ │ ├── __init__.py │ │ │ ├── my_tool_1.py │ │ │ ├── my_tool_2.py │ │ │ ├── tool_with_file_path_input.py │ │ │ └── utils.py │ │ └── yamls │ │ │ ├── my_tool_1.yaml │ │ │ ├── my_tool_2.yaml │ │ │ └── tool_with_file_path_input.yaml │ │ ├── setup.py │ │ └── tests │ │ ├── __init__.py │ │ ├── test_my_tool_1.py │ │ ├── test_my_tool_2.py │ │ ├── test_tool_with_file_path_input.py │ │ └── test_utils │ │ └── hello_method.py └── tutorials │ ├── e2e-development │ └── chat-with-pdf.md │ ├── flow-deploy │ ├── .gitignore │ ├── README.md │ ├── azure-app-service │ │ ├── README.md │ │ ├── assets │ │ │ ├── azure_portal_img.png │ │ │ ├── set_env_var.png │ │ │ └── test_page.png │ │ ├── deploy.ps1 │ │ └── deploy.sh │ ├── distribute-flow-as-executable-app │ │ ├── README.md │ │ ├── app.py │ │ └── main.py │ ├── docker │ │ └── README.md │ └── kubernetes │ │ ├── README.md │ │ └── deployment.yaml │ ├── get-started │ ├── quickstart-azure.ipynb │ └── quickstart.ipynb │ ├── quick-start │ └── media │ │ ├── logo_pf.png │ │ └── vsc.png │ └── run-management │ └── cloud-run-management.ipynb ├── scripts ├── building │ ├── dev_requirements.txt │ ├── dev_setup.py │ ├── generate_connection_config.py │ ├── release-env.yml │ ├── run_coverage_tests.py │ └── utils.py ├── compliance-check │ ├── Check-PolicheckScan.ps1 │ └── user_exclusion.xml ├── distributing │ ├── configs │ │ ├── distribution_settings.json │ │ └── promptflow-tools-release-env.yaml │ └── publish_package.py ├── docs │ ├── _static │ │ ├── bg_dark_large.png │ │ ├── bg_dark_small.png │ │ ├── bg_light_large.png │ │ ├── bg_light_small.png │ │ ├── custom.css │ │ ├── custom.js │ │ ├── logo.svg │ │ └── logo32.ico │ ├── conf.py │ ├── doc_generation.ps1 │ ├── gallery_directive │ │ └── __init__.py │ └── promptflow.connections.rst ├── readme │ ├── README.md │ ├── __init__.py │ ├── extract_steps_from_readme.py │ ├── ghactions_driver │ │ ├── __init__.py │ │ ├── bash_script │ │ │ └── bash_script.sh.jinja2 │ │ ├── readme_parse.py │ │ ├── readme_step.py │ │ ├── readme_templates │ │ │ └── README.md.jinja2 │ │ ├── readme_workflow_generate.py │ │ ├── telemetry_obj.py │ │ ├── workflow_steps │ │ │ ├── step_azure_login.yml.jinja2 │ │ │ ├── step_create_env.yml.jinja2 │ │ │ ├── step_create_run_yml.yml.jinja2 │ │ │ ├── step_env_create_aoai.yml.jinja2 │ │ │ ├── step_extract_steps_and_run.yml.jinja2 │ │ │ ├── step_extract_steps_and_run_gpt4.yml.jinja2 │ │ │ ├── step_install_deps.yml.jinja2 │ │ │ ├── step_install_dev_deps.yml.jinja2 │ │ │ └── step_yml_create_aoai.yml.jinja2 │ │ └── workflow_templates │ │ │ ├── basic_workflow.yml.jinja2 │ │ │ ├── basic_workflow_replace.yml.jinja2 │ │ │ ├── pdf_workflow.yml.jinja2 │ │ │ └── workflow_skeleton.yml.jinja2 │ ├── readme.py │ ├── readme_generator.py │ └── workflow_generator.py └── tool │ ├── convert_image_to_data_url.py │ ├── deploy_endpoint.py │ ├── exceptions │ ├── __init__.py │ └── secret_exceptions.py │ ├── generate_connection_config.py │ ├── generate_package_tool_meta.py │ ├── generate_tool_package_template.py │ ├── templates │ ├── MANIFEST.in.j2 │ ├── setup.py.j2 │ ├── test_tool.py.j2 │ ├── test_tool2.py.j2 │ ├── tool.py.j2 │ ├── tool.yaml.j2 │ ├── tool2.py.j2 │ ├── tool2.yaml.j2 │ └── utils.py.j2 │ ├── upload_tool_secret.py │ ├── utils │ ├── __init__.py │ ├── configs │ │ ├── deploy-endpoint-request-body.json │ │ └── promptflow-gallery-tool-test.yaml │ ├── generate_tool_meta_utils.py │ ├── repo_utils.py │ ├── secret_manager.py │ └── tool_utils.py │ └── validate_tool_secret.py ├── setup.cfg └── src ├── promptflow-tools ├── MANIFEST.in ├── NOTICE.txt ├── README.dev.md ├── README.md ├── connections.json.example ├── promptflow │ ├── tools │ │ ├── __init__.py │ │ ├── aoai.py │ │ ├── common.py │ │ ├── embedding.py │ │ ├── exception.py │ │ ├── list.py │ │ ├── open_source_llm.py │ │ ├── openai.py │ │ ├── serpapi.py │ │ ├── template_rendering.py │ │ └── yamls │ │ │ ├── embedding.yaml │ │ │ ├── open_source_llm.yaml │ │ │ └── serpapi.yaml │ └── version.txt ├── requirements.txt ├── setup.py └── tests │ ├── __init__.py │ ├── conftest.py │ ├── pytest.ini │ ├── test_aoai.py │ ├── test_common.py │ ├── test_configs │ └── prompt_templates │ │ ├── marketing_writer │ │ ├── history.json │ │ └── prompt.jinja2 │ │ └── prompt_with_function.jinja2 │ ├── test_embedding.py │ ├── test_handle_openai_error.py │ ├── test_open_source_llm.py │ ├── test_openai.py │ ├── test_serpapi.py │ └── utils.py └── promptflow ├── CHANGELOG.md ├── MANIFEST.in ├── NOTICE.txt ├── README.md ├── dev-connections.json.example ├── dev_requirements.txt ├── promptflow ├── __init__.py ├── _cli │ ├── __init__.py │ ├── _params.py │ ├── _pf │ │ ├── __init__.py │ │ ├── _config.py │ │ ├── _connection.py │ │ ├── _flow.py │ │ ├── _init_entry_generators.py │ │ ├── _run.py │ │ └── entry.py │ ├── _pf_azure │ │ ├── __init__.py │ │ ├── _connection.py │ │ ├── _flow.py │ │ ├── _run.py │ │ ├── _utils.py │ │ └── entry.py │ ├── _user_agent.py │ ├── _utils.py │ ├── data │ │ ├── chat_flow │ │ │ ├── .promptflow │ │ │ │ └── flow.tools.json │ │ │ ├── README.md │ │ │ ├── azure_openai.yaml │ │ │ ├── chat.jinja2 │ │ │ ├── flow.dag.yaml │ │ │ └── openai.yaml │ │ ├── entry_flow │ │ │ ├── flow.dag.yaml.jinja2 │ │ │ ├── flow.tools.json.jinja2 │ │ │ ├── gitignore │ │ │ ├── requirements_txt │ │ │ └── tool.py.jinja2 │ │ ├── evaluation_flow │ │ │ ├── .promptflow │ │ │ │ └── flow.tools.json │ │ │ ├── aggregate.py │ │ │ ├── data.jsonl │ │ │ ├── flow.dag.yaml │ │ │ └── line_process.py │ │ └── standard_flow │ │ │ ├── .promptflow │ │ │ └── flow.tools.json │ │ │ ├── data.jsonl │ │ │ ├── flow.dag.yaml │ │ │ ├── hello.jinja2 │ │ │ └── hello.py │ └── pf.py ├── _constants.py ├── _core │ ├── __init__.py │ ├── _errors.py │ ├── cache_manager.py │ ├── connection_manager.py │ ├── flow_execution_context.py │ ├── generator_proxy.py │ ├── log_manager.py │ ├── metric_logger.py │ ├── openai_injector.py │ ├── operation_context.py │ ├── run_tracker.py │ ├── thread_local_singleton.py │ ├── tool.py │ ├── tool_meta_generator.py │ ├── tools_manager.py │ └── tracer.py ├── _internal │ └── __init__.py ├── _sdk │ ├── __init__.py │ ├── _configuration.py │ ├── _constants.py │ ├── _errors.py │ ├── _load_functions.py │ ├── _logger_factory.py │ ├── _orm │ │ ├── __init__.py │ │ ├── connection.py │ │ ├── retry.py │ │ ├── run_info.py │ │ └── session.py │ ├── _pf_client.py │ ├── _run_functions.py │ ├── _service │ │ ├── __init__.py │ │ ├── app.py │ │ ├── connection.py │ │ ├── entry.py │ │ ├── run.py │ │ └── utils.py │ ├── _serving │ │ ├── __init__.py │ │ ├── _errors.py │ │ ├── app.py │ │ ├── flow_invoker.py │ │ ├── response_creator.py │ │ ├── static │ │ │ ├── index.html │ │ │ └── index.js │ │ ├── swagger.py │ │ └── utils.py │ ├── _user_agent.py │ ├── _utils.py │ ├── _vendor │ │ ├── __init__.py │ │ ├── _asset_utils.py │ │ └── _pathspec.py │ ├── _visualize_functions.py │ ├── data │ │ ├── docker │ │ │ ├── Dockerfile.jinja2 │ │ │ ├── README.md │ │ │ ├── runit │ │ │ │ └── promptflow-serve │ │ │ │ │ ├── finish.jinja2 │ │ │ │ │ └── run.jinja2 │ │ │ └── start.sh.jinja2 │ │ ├── executable │ │ │ ├── README.md │ │ │ ├── app.py.jinja2 │ │ │ ├── app.spec.jinja2 │ │ │ └── main.py.jinja2 │ │ └── visualize.j2 │ ├── entities │ │ ├── __init__.py │ │ ├── _connection.py │ │ ├── _flow.py │ │ ├── _run.py │ │ ├── _run_inputs.py │ │ ├── _validation │ │ │ ├── __init__.py │ │ │ ├── core.py │ │ │ └── schema.py │ │ └── _yaml_translatable.py │ ├── operations │ │ ├── __init__.py │ │ ├── _connection_operations.py │ │ ├── _flow_operations.py │ │ ├── _local_azure_connection_operations.py │ │ ├── _local_storage_operations.py │ │ ├── _run_operations.py │ │ ├── _run_submitter.py │ │ └── _test_submitter.py │ └── schemas │ │ ├── __init__.py │ │ ├── _base.py │ │ ├── _connection.py │ │ ├── _fields.py │ │ ├── _flow.py │ │ └── _run.py ├── _telemetry │ ├── __init__.py │ ├── activity.py │ ├── logging_handler.py │ └── telemetry.py ├── _utils │ ├── __init__.py │ ├── connection_utils.py │ ├── context_utils.py │ ├── credential_scrubber.py │ ├── dataclass_serializer.py │ ├── exception_utils.py │ ├── flow_utils.py │ ├── load_data.py │ ├── logger_utils.py │ ├── openai_metrics_calculator.py │ ├── retry_utils.py │ ├── thread_utils.py │ ├── tool_utils.py │ └── utils.py ├── _version.py ├── azure │ ├── __init__.py │ ├── _constants │ │ ├── __init__.py │ │ ├── _component.py │ │ └── _flow.py │ ├── _entities │ │ ├── __init__.py │ │ ├── _flow.py │ │ └── _workspace_connection_spec.py │ ├── _load_functions.py │ ├── _ml │ │ └── __init__.py │ ├── _pf_client.py │ ├── _restclient │ │ ├── README.md │ │ ├── __init__.py │ │ ├── flow │ │ │ ├── __init__.py │ │ │ ├── _azure_machine_learning_designer_service_client.py │ │ │ ├── _configuration.py │ │ │ ├── _patch.py │ │ │ ├── _vendor.py │ │ │ ├── aio │ │ │ │ ├── __init__.py │ │ │ │ ├── _azure_machine_learning_designer_service_client.py │ │ │ │ ├── _configuration.py │ │ │ │ ├── _patch.py │ │ │ │ └── operations │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── _bulk_runs_operations.py │ │ │ │ │ ├── _connection_operations.py │ │ │ │ │ ├── _connections_operations.py │ │ │ │ │ ├── _flow_runs_admin_operations.py │ │ │ │ │ ├── _flow_runtimes_operations.py │ │ │ │ │ ├── _flow_sessions_admin_operations.py │ │ │ │ │ ├── _flow_sessions_operations.py │ │ │ │ │ ├── _flows_operations.py │ │ │ │ │ ├── _flows_provider_operations.py │ │ │ │ │ └── _tools_operations.py │ │ │ ├── models │ │ │ │ ├── __init__.py │ │ │ │ ├── _azure_machine_learning_designer_service_client_enums.py │ │ │ │ ├── _models.py │ │ │ │ └── _models_py3.py │ │ │ ├── operations │ │ │ │ ├── __init__.py │ │ │ │ ├── _bulk_runs_operations.py │ │ │ │ ├── _connection_operations.py │ │ │ │ ├── _connections_operations.py │ │ │ │ ├── _flow_runs_admin_operations.py │ │ │ │ ├── _flow_runtimes_operations.py │ │ │ │ ├── _flow_sessions_admin_operations.py │ │ │ │ ├── _flow_sessions_operations.py │ │ │ │ ├── _flows_operations.py │ │ │ │ ├── _flows_provider_operations.py │ │ │ │ └── _tools_operations.py │ │ │ └── py.typed │ │ ├── flow_service_caller.py │ │ └── service_caller_factory.py │ ├── _schemas │ │ ├── __init__.py │ │ └── _flow_schema.py │ ├── _utils │ │ ├── __init__.py │ │ ├── _url_utils.py │ │ └── gerneral.py │ ├── operations │ │ ├── __init__.py │ │ ├── _arm_connection_operations.py │ │ ├── _artifact_utilities.py │ │ ├── _connection_operations.py │ │ ├── _fileshare_storeage_helper.py │ │ ├── _flow_operations.py │ │ └── _run_operations.py │ └── resources │ │ └── component_spec_template.yaml ├── connections │ └── __init__.py ├── contracts │ ├── __init__.py │ ├── _errors.py │ ├── _run_management.py │ ├── flow.py │ ├── multimedia.py │ ├── run_info.py │ ├── run_mode.py │ ├── tool.py │ ├── trace.py │ └── types.py ├── entities │ └── __init__.py ├── exceptions.py ├── executor │ ├── __init__.py │ ├── _dag_manager.py │ ├── _errors.py │ ├── _flow_nodes_scheduler.py │ ├── _input_assignment_parser.py │ ├── _line_execution_process_pool.py │ ├── _result.py │ ├── _tool_invoker.py │ ├── _tool_resolver.py │ ├── flow_executor.py │ └── flow_validator.py ├── integrations │ ├── __init__.py │ └── langchain.py ├── operations │ └── __init__.py └── storage │ ├── __init__.py │ ├── _cache_storage.py │ ├── _errors.py │ ├── _run_storage.py │ ├── _sqlite_client.py │ └── run_records.py ├── pyproject.toml ├── setup.py └── tests ├── _constants.py ├── conftest.py ├── executor ├── .coveragerc ├── __init__.py ├── e2etests │ ├── __init__.py │ ├── test_activate.py │ ├── test_concurent_execution.py │ ├── test_executor_happypath.py │ ├── test_executor_timeout.py │ ├── test_executor_validation.py │ ├── test_langchain.py │ ├── test_logs.py │ ├── test_package_tool.py │ ├── test_skip.py │ ├── test_telemetry.py │ └── test_traces.py ├── package_tools │ ├── custom_llm_tool.py │ ├── custom_llm_tool │ │ ├── flow.dag.yaml │ │ ├── inputs.json │ │ ├── my_prompt.jinja2 │ │ ├── package_tool_definition.json │ │ └── samples.json │ ├── custom_llm_tool_with_duplicated_inputs │ │ ├── flow.dag.yaml │ │ ├── package_tool_definition.json │ │ └── prompt_with_duplicated_inputs.jinja2 │ ├── tool_with_connection.py │ ├── tool_with_connection │ │ ├── flow.dag.yaml │ │ └── package_tool_definition.json │ ├── tool_with_init_error.py │ └── tool_with_init_error │ │ ├── flow.dag.yaml │ │ └── package_tool_definition.json ├── unittests │ ├── __init__.py │ ├── _core │ │ ├── __init__.py │ │ ├── test_api_injector.py │ │ ├── test_connection_manager.py │ │ ├── test_generator_proxy.py │ │ ├── test_log_manager.py │ │ ├── test_metric_logger.py │ │ ├── test_operation_context.py │ │ ├── test_tools_manager.py │ │ └── test_tracer.py │ ├── _utils │ │ ├── __init__.py │ │ ├── test_connection_utils.py │ │ ├── test_credential_scrubber.py │ │ ├── test_dataclass_serializer.py │ │ ├── test_exception_utils.py │ │ ├── test_generate_tool_meta_utils.py │ │ ├── test_logger_utils.py │ │ ├── test_thread_utils.py │ │ └── test_tool_utils.py │ ├── contracts │ │ ├── __init__.py │ │ ├── test_flow.py │ │ └── test_tool.py │ ├── executor │ │ ├── __init__.py │ │ ├── test_dag_manager.py │ │ ├── test_errors.py │ │ ├── test_exceptions.py │ │ ├── test_flow_executor.py │ │ ├── test_flow_validator.py │ │ ├── test_input_assignment_parser.py │ │ ├── test_result.py │ │ └── test_tool_resolver.py │ ├── integrations │ │ └── test_langchain.py │ ├── processpool │ │ ├── __init__.py │ │ └── test_healthy_ensured_process.py │ └── storage │ │ ├── __init__.py │ │ ├── test_azureml_run_storage_v2.py │ │ └── test_queue_run_storage.py └── utils.py ├── sdk_cli_azure_test ├── __init__.py ├── _azure_utils.py ├── conftest.py ├── e2etests │ ├── __init__.py │ ├── classificationAccuracy.csv │ ├── test_arm_connection_operations.py │ ├── test_cli_with_azure.py │ ├── test_connection_operations.py │ ├── test_flow_in_azure_ml.py │ ├── test_flow_operations.py │ ├── test_run_operations.py │ └── test_telemetry.py └── unittests │ ├── __init__.py │ ├── test_arm_connection_build.py │ ├── test_cli.py │ ├── test_flow_entity.py │ ├── test_run_entity.py │ └── test_utils.py ├── sdk_cli_global_config_test ├── __init__.py ├── conftest.py └── e2etests │ ├── __init__.py │ └── test_global_config.py ├── sdk_cli_test ├── .coveragerc ├── __init__.py ├── conftest.py ├── e2etests │ ├── __init__.py │ ├── test_cli.py │ ├── test_connection.py │ ├── test_custom_strong_type_connection.py │ ├── test_flow_local_operations.py │ ├── test_flow_run.py │ ├── test_flow_serve.py │ ├── test_flow_test.py │ └── test_orm.py └── unittests │ ├── __init__.py │ ├── test_config.py │ ├── test_connection.py │ ├── test_flow_invoker.py │ ├── test_local_storage_operations.py │ ├── test_orm.py │ ├── test_pf_client.py │ ├── test_run.py │ └── test_utils.py ├── sdk_pfs_test ├── .coveragerc ├── __init__.py ├── conftest.py ├── e2etests │ ├── __init__.py │ ├── test_connection_apis.py │ ├── test_general_apis.py │ └── test_run_apis.py └── utils.py └── test_configs ├── configs ├── .azureml │ └── config.json └── mock_flow1 │ └── .azureml │ └── config.json ├── connections ├── .env ├── azure_content_safety_connection.yaml ├── azure_openai_connection.yaml ├── cognitive_search_connection.yaml ├── custom_connection.yaml ├── custom_strong_type_connection.yaml ├── empty.env ├── form_recognizer_connection.yaml ├── openai_connection.yaml ├── qdrant_connection.yaml ├── serp_connection.yaml ├── update_azure_openai_connection.yaml ├── update_custom_connection.yaml ├── update_custom_strong_type_connection.yaml └── weaviate_connection.yaml ├── datas ├── classificationAccuracy.csv ├── env_var_names.jsonl ├── load_data_cases │ ├── 10k.jsonl │ ├── 10k │ │ ├── 5k.1.jsonl │ │ └── 5k.2.jsonl │ ├── colors.csv │ ├── colors.json │ ├── colors.jsonl │ ├── colors.parquet │ └── colors.tsv ├── webClassification1.jsonl └── webClassification3.jsonl ├── flows ├── activate_with_no_inputs │ ├── expected_result.json │ ├── flow.dag.yaml │ ├── inputs.json │ ├── node_a.py │ └── node_b.py ├── basic-with-connection │ ├── data.jsonl │ ├── flow.dag.yaml │ ├── hello.jinja2 │ ├── hello.py │ ├── inputs.json │ └── samples.json ├── basic_with_builtin_llm_node │ ├── flow.dag.yaml │ └── hello.jinja2 ├── chat_flow │ ├── chat.jinja2 │ ├── flow.dag.yaml │ └── show_answer.py ├── chat_flow_with_default_history │ ├── chat.jinja2 │ └── flow.dag.yaml ├── chat_flow_with_defined_chat_history │ ├── chat.jinja2 │ ├── flow.dag.yaml │ └── show_answer.py ├── chat_flow_with_exception │ ├── chat.jinja2 │ ├── flow.dag.yaml │ └── show_answer.py ├── chat_flow_with_multi_output │ ├── chat.jinja2 │ └── flow.dag.yaml ├── chat_flow_with_python_node_streaming_output │ ├── flow.dag.yaml │ └── stream.py ├── chat_flow_with_stream_output │ ├── chat.jinja2 │ └── flow.dag.yaml ├── chat_flow_without_defined_chat_history │ ├── chat.jinja2 │ ├── flow.dag.yaml │ └── show_answer.py ├── classification_accuracy_evaluation │ ├── .promptflow │ │ └── flow.tools.json │ ├── calculate_accuracy.py │ ├── expected_metrics.json │ ├── expected_status_summary.json │ ├── flow.dag.yaml │ ├── grade.py │ └── samples.json ├── concurrent_execution_flow │ ├── flow.dag.yaml │ ├── inputs.json │ ├── wait_long.py │ └── wait_short.py ├── conditional_chat_flow_with_skip │ ├── conditional_node.py │ ├── flow.dag.yaml │ ├── inputs.json │ ├── is_even.py │ └── print_result.py ├── conditional_flow_with_activate │ ├── expected_result.json │ ├── expected_status_summary.json │ ├── flow.dag.yaml │ ├── icm_retriever.py │ ├── incident_id_extractor.py │ ├── incident_info_extractor.py │ ├── inputs.json │ ├── investigation_method.py │ ├── investigation_steps.jinja2 │ ├── job_info_extractor.py │ ├── kql_tsg_retriever.py │ ├── retriever_summary.py │ └── tsg_retriever.py ├── conditional_flow_with_skip │ ├── conditional_node.py │ ├── flow.dag.yaml │ ├── inputs.json │ ├── is_even.py │ └── print_result.py ├── connection_as_input │ ├── conn_tool.py │ └── flow.dag.yaml ├── custom_connection_flow │ ├── .promptflow │ │ └── flow.tools.json │ ├── flow.dag.yaml │ └── print_env.py ├── custom_strong_type_connection_basic_flow │ ├── data.jsonl │ └── flow.dag.yaml ├── default_input │ ├── flow.dag.yaml │ ├── test_print_aggregation.py │ └── test_print_input.py ├── export │ ├── .gitignore │ └── linux │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── connections │ │ └── custom_connection.yaml │ │ ├── flow │ │ ├── .amlignore │ │ ├── extract_intent_tool.py │ │ ├── flow.dag.yaml │ │ ├── intent.py │ │ ├── requirements_txt │ │ ├── setup.sh │ │ ├── user_intent_few_shot.jinja2 │ │ └── user_intent_zero_shot.jinja2 │ │ ├── runit │ │ └── promptflow-serve │ │ │ ├── finish │ │ │ └── run │ │ ├── settings.json │ │ └── start.sh ├── external_files │ ├── convert_to_dict.py │ ├── fetch_text_content_from_url.py │ └── summarize_text_content.jinja2 ├── failed_flow │ ├── flow.dag.yaml │ └── hello.py ├── flow_with_dict_input │ ├── .promptflow │ │ └── flow.tools.json │ ├── flow.dag.yaml │ └── print_val.py ├── flow_with_dict_input_with_variant │ ├── flow.dag.yaml │ └── print_val.py ├── flow_with_environment │ ├── .promptflow │ │ └── flow.tools.json │ ├── flow.dag.yaml │ ├── print_env.py │ └── requirements ├── flow_with_invalid_import │ ├── flow.dag.yaml │ └── hello.py ├── flow_with_langchain_traces │ ├── code_first_input.csv │ ├── data_inputs.json │ ├── flow.dag.yaml │ ├── samples.json │ └── test_langchain_traces.py ├── flow_with_list_input │ ├── flow.dag.yaml │ └── print_val.py ├── flow_with_non_english_input │ ├── data.jsonl │ ├── flow.dag.yaml │ └── hello.jinja2 ├── flow_with_sys_inject │ ├── custom_lib │ │ └── foo.py │ ├── flow.dag.yaml │ └── hello.py ├── flow_with_user_output │ ├── .promptflow │ │ └── flow.tools.json │ ├── flow.dag.yaml │ └── print_val.py ├── generator_tools │ ├── char_generator.py │ ├── echo.py │ └── flow.dag.yaml ├── intent-copilot │ ├── .amlignore │ ├── .gitignore │ ├── .promptflow │ │ └── flow.tools.json │ ├── data │ │ └── denormalized-flat.jsonl │ ├── extract_intent_tool.py │ ├── flow.dag.yaml │ ├── intent.py │ ├── requirements_txt │ ├── setup.sh │ ├── user_intent_few_shot.jinja2 │ └── user_intent_zero_shot.jinja2 ├── llm_tool_with_duplicated_inputs │ ├── flow.dag.yaml │ └── prompt_with_duplicated_inputs.jinja2 ├── long_run │ ├── flow.dag.yaml │ └── long_run.py ├── meta_files │ ├── flow.dag.yaml │ ├── flow.meta.yaml │ ├── remote_flow_short_path.meta.yaml │ ├── remote_fs.meta.yaml │ └── samples.json ├── no_inputs_outputs │ ├── flow.dag.yaml │ └── say_hello.py ├── one_line_of_bulktest_timeout │ ├── expected_status_summary.json │ ├── flow.dag.yaml │ ├── my_python_tool.py │ ├── my_python_tool_with_failed_line.py │ └── samples.json ├── openai_chat_api_flow │ ├── chat.py │ ├── flow.dag.yaml │ └── samples.json ├── openai_completion_api_flow │ ├── completion.py │ ├── flow.dag.yaml │ └── samples.json ├── package_tools │ └── flow.dag.yaml ├── partial_fail │ ├── data.jsonl │ ├── flow.dag.yaml │ └── print_env.py ├── print_env_var │ ├── .promptflow │ │ └── flow.tools.json │ ├── flow.dag.yaml │ └── print_env.py ├── print_input_flow │ ├── flow.dag.yaml │ └── print_input.py ├── prompt_tool_with_duplicated_inputs │ ├── flow.dag.yaml │ └── prompt_with_duplicated_inputs.jinja2 ├── prompt_tools │ ├── flow.dag.yaml │ ├── summarize_text_content_prompt.jinja2 │ └── summarize_text_content_prompt.meta.json ├── python_stream_tools │ ├── echo_input.py │ ├── flow.dag.yaml │ └── inputs.json ├── python_tool_partial_failure │ ├── expected_status_summary.json │ ├── flow.dag.yaml │ ├── inputs.json │ ├── inputs_mapping.json │ ├── my_python_tool_with_failed_line.py │ └── samples.json ├── python_tool_with_image_input_and_output │ ├── flow.dag.yaml │ ├── logo.jpg │ └── python_with_image.py ├── python_tool_with_multiple_image_nodes │ ├── flow.dag.yaml │ ├── logo.jpg │ └── python_with_image.py ├── saved_component_spec │ ├── command.yaml │ ├── parallel.yaml │ └── parallel_anonymous.yaml ├── script_with___file__ │ ├── flow.dag.yaml │ ├── folder │ │ └── another-tool.py │ ├── script_with___file__.meta.json │ └── script_with___file__.py ├── script_with_import │ ├── dummy_utils │ │ ├── main.meta.json │ │ ├── main.py │ │ └── util_tool.py │ ├── fail.py │ └── flow.dag.yaml ├── simple_aggregation │ ├── accuracy.py │ ├── flow.dag.yaml │ └── passthrough.py ├── simple_fetch_url │ ├── fetch_text_content_from_url.py │ └── flow.dag.yaml ├── simple_flow_with_python_tool │ ├── divide_num.py │ └── flow.dag.yaml ├── simple_flow_with_python_tool_and_aggregate │ ├── aggregate_num.py │ ├── divide_num.py │ └── flow.dag.yaml ├── unordered_nodes │ └── flow.dag.yaml ├── unordered_nodes_with_activate │ └── flow.dag.yaml ├── unordered_nodes_with_skip │ └── flow.dag.yaml ├── web_classification │ ├── .promptflow │ │ └── flow.tools.json │ ├── classify_with_llm.jinja2 │ ├── convert_to_dict.py │ ├── fetch_text_content_from_url.py │ ├── fetch_text_content_from_url_input.jsonl │ ├── flow.dag.yaml │ ├── prepare_examples.py │ ├── samples.json │ ├── summarize_text_content.jinja2 │ ├── summarize_text_content__variant_1.jinja2 │ └── webClassification20.csv ├── web_classification_input_dir │ └── details.jsonl ├── web_classification_invalid │ ├── classify_with_llm.jinja2 │ ├── flow.dag.yaml │ ├── prepare_examples.py │ ├── samples.json │ └── summarize_text_content__variant_1.jinja2 ├── web_classification_no_variants │ ├── .promptflow │ │ ├── flow.env_files │ │ │ └── setup.sh │ │ ├── flow.tools.json │ │ └── lkg_sources │ │ │ ├── classify_with_llm.jinja2 │ │ │ ├── convert_to_dict.py │ │ │ ├── fetch_text_content_from_url.py │ │ │ ├── prepare_examples.py │ │ │ ├── summarize_text_content.jinja2 │ │ │ └── summarize_text_content__variant_1.jinja2 │ ├── classify_with_llm.jinja2 │ ├── convert_to_dict.py │ ├── fetch_text_content_from_url.py │ ├── flow.dag.yaml │ ├── prepare_examples.py │ ├── samples.json │ ├── summarize_text_content.jinja2 │ └── summarize_text_content__variant_1.jinja2 ├── web_classification_no_variants_unordered │ ├── classify_with_llm.jinja2 │ ├── convert_to_dict.py │ ├── fetch_text_content_from_url.py │ ├── flow.dag.yaml │ ├── prepare_examples.py │ ├── samples.json │ ├── summarize_text_content.jinja2 │ └── summarize_text_content__variant_1.jinja2 ├── web_classification_v1 │ ├── .promptflow │ │ └── flow.tools.json │ ├── classify_with_llm.jinja2 │ ├── convert_to_dict.py │ ├── fetch_text_content_from_url.py │ ├── flow.dag.yaml │ ├── prepare_examples.py │ ├── samples.json │ ├── summarize_text_content.jinja2 │ └── summarize_text_content__variant_1.jinja2 ├── web_classification_v2 │ ├── .promptflow │ │ └── flow.tools.json │ ├── classify_with_llm.jinja2 │ ├── convert_to_dict.py │ ├── fetch_text_content_from_url.py │ ├── flow.dag.yaml │ ├── prepare_examples.py │ ├── samples.json │ ├── summarize_text_content.jinja2 │ └── summarize_text_content__variant_1.jinja2 ├── web_classification_with_additional_include │ ├── classify_with_llm.jinja2 │ ├── flow.dag.yaml │ ├── prepare_examples.py │ ├── samples.json │ └── summarize_text_content__variant_1.jinja2 ├── web_classification_with_exception │ ├── classify_with_llm.jinja2 │ ├── convert_to_dict.py │ ├── fetch_text_content_from_url.py │ ├── flow.dag.yaml │ ├── prepare_examples.py │ ├── samples.json │ ├── summarize_text_content.jinja2 │ └── summarize_text_content__variant_1.jinja2 └── web_classification_with_invalid_additional_include │ └── flow.dag.yaml ├── runs ├── env_file ├── illegal │ ├── extra_field.yaml │ ├── missing_data.yaml │ └── non_exist_data.yaml ├── input_with_dict_val.yaml ├── run_with_connections.yaml ├── run_with_connections_model.yaml ├── run_with_env.yaml ├── sample_bulk_run.yaml ├── sample_bulk_run_cloud.yaml ├── sample_bulk_run_with_resources.yaml └── sample_eval_run.yaml ├── wrong_flows ├── aggregation_activate_reference_non_aggregation │ └── flow.dag.yaml ├── aggregation_skip_reference_non_aggregation │ └── flow.dag.yaml ├── all_nodes_bypassed │ ├── flow.dag.yaml │ ├── inputs.json │ └── test.py ├── flow_input_reference_invalid │ ├── divide_num.py │ └── flow.dag.yaml ├── flow_output_reference_invalid │ ├── divide_num.py │ └── flow.dag.yaml ├── flow_output_unserializable │ ├── divide_num.py │ └── flow.dag.yaml ├── invalid_connection │ ├── flow.dag.yaml │ └── summarize_text_content__variant_1.jinja2 ├── node_circular_dependency │ ├── divide_num.py │ └── flow.dag.yaml ├── node_condition_conflict │ └── flow.dag.yaml ├── node_missing_type_or_source │ ├── divide_num.py │ └── flow.dag.yaml ├── node_reference_not_found │ ├── divide_num.py │ └── flow.dag.yaml ├── nodes_cycle │ └── flow.dag.yaml ├── nodes_cycle_with_activate │ └── flow.dag.yaml ├── nodes_cycle_with_skip │ └── flow.dag.yaml ├── nodes_names_duplicated │ ├── another_stringify_num.py │ ├── flow.dag.yaml │ └── stringify_num.py ├── non_aggregation_reference_aggregation │ └── flow.dag.yaml ├── outputs_reference_not_valid │ ├── flow.dag.yaml │ └── stringify_num.py ├── outputs_with_invalid_flow_inputs_ref │ ├── flow.dag.yaml │ └── stringify_num.py ├── source_file_missing │ ├── flow.dag.jinja.yaml │ └── flow.dag.python.yaml ├── tool_type_missing │ ├── flow.dag.yaml │ └── summarize_text_content__variant_1.jinja2 ├── wrong_api │ ├── flow.dag.yaml │ └── summarize_text_content__variant_1.jinja2 ├── wrong_module │ ├── flow.dag.yaml │ └── summarize_text_content__variant_1.jinja2 ├── wrong_node_reference │ └── flow.dag.yaml ├── wrong_package_in_package_tools │ └── flow.dag.yaml ├── wrong_provider │ ├── flow.dag.yaml │ └── summarize_text_content__variant_1.jinja2 └── wrong_tool_in_package_tools │ └── flow.dag.yaml └── wrong_tools ├── load_error.py ├── multiple_tools.py └── no_end.jinja2 /.devcontainer/codespaces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/.devcontainer/codespaces.png -------------------------------------------------------------------------------- /.devcontainer/default_requirements.txt: -------------------------------------------------------------------------------- 1 | azure-cli 2 | azure-identity 3 | opencensus-ext-azure 4 | promptflow[azure] 5 | promptflow-tools -------------------------------------------------------------------------------- /.devcontainer/devcontainers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/.devcontainer/devcontainers.png -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @microsoft/prompt-flow-approvers 2 | -------------------------------------------------------------------------------- /.github/labeler.yml: -------------------------------------------------------------------------------- 1 | examples: 2 | - examples/** 3 | documentation: 4 | - docs/** 5 | cli: 6 | - src/promptflow/promptflow/_cli/** 7 | sdk: 8 | - src/promptflow/promptflow/_sdk/** 9 | - src/promptflow/promptflow/azure/** 10 | promptflow: 11 | - src/promptflow/** 12 | promptflow-tools: 13 | - src/promptflow-tools/** 14 | fundamental: 15 | - scripts/** 16 | - .github/** 17 | -------------------------------------------------------------------------------- /.github/workflows/labeler.yml: -------------------------------------------------------------------------------- 1 | name: "Pull Request Labeler" 2 | on: 3 | - pull_request_target 4 | 5 | jobs: 6 | triage: 7 | permissions: 8 | contents: read 9 | pull-requests: write 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/labeler@v4 -------------------------------------------------------------------------------- /SUPPORT.md: -------------------------------------------------------------------------------- 1 | # Support 2 | 3 | ## How to file issues and get help 4 | 5 | This project uses GitHub Issues to track bugs and feature requests. Please search the existing 6 | issues before filing new issues to avoid duplicates. For new issues, file your bug or 7 | feature request as a new Issue. 8 | 9 | ## Microsoft Support Policy 10 | 11 | Support for this **PROJECT or PRODUCT** is limited to the resources listed above. 12 | -------------------------------------------------------------------------------- /docs/cloud/azureai/faq.md: -------------------------------------------------------------------------------- 1 | # Frequency asked questions (FAQ) 2 | 3 | ## Troubleshooting ## 4 | 5 | ### Token expired when run pfazure cmd 6 | 7 | If hit error "AADSTS700082: The refresh token has expired due to inactivity." when running pfazure cmd, it's caused by local cached token expired. Please clear the cached token under "%LOCALAPPDATA%/.IdentityService/msal.cache". Then run below command to login again: 8 | ```sh 9 | az login 10 | ``` -------------------------------------------------------------------------------- /docs/cloud/index.md: -------------------------------------------------------------------------------- 1 | # Cloud 2 | 3 | You can develope your flow locally and seamlessly move the experience to azure cloud. 4 | 5 | ```{toctree} 6 | :caption: AzureAI 7 | :maxdepth: 1 8 | azureai/quick-start 9 | azureai/deploy-to-azure-appservice 10 | azureai/faq 11 | ``` -------------------------------------------------------------------------------- /docs/concepts/index.md: -------------------------------------------------------------------------------- 1 | # Concepts 2 | 3 | In this section, you will learn the basic concepts of prompt flow. 4 | 5 | ```{toctree} 6 | :maxdepth: 1 7 | 8 | concept-flows 9 | concept-tools 10 | concept-connections 11 | concept-variants 12 | design-principles 13 | ``` -------------------------------------------------------------------------------- /docs/how-to-guides/develop-a-flow/index.md: -------------------------------------------------------------------------------- 1 | # Develop a flow 2 | We provide guides on how to develop a flow by writing a flow yaml from scratch in this section. 3 | 4 | ```{toctree} 5 | :maxdepth: 1 6 | :hidden: 7 | 8 | develop-standard-flow 9 | develop-chat-flow 10 | ``` -------------------------------------------------------------------------------- /docs/how-to-guides/develop-a-tool/index.md: -------------------------------------------------------------------------------- 1 | # Develop a tool 2 | We provide guides on how to develop a tool and use it. 3 | 4 | ```{toctree} 5 | :maxdepth: 1 6 | :hidden: 7 | 8 | create-and-use-tool-package 9 | add-a-tool-icon 10 | ``` -------------------------------------------------------------------------------- /docs/media/cloud/azureml/deploy_appservice_azure_portal_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/cloud/azureml/deploy_appservice_azure_portal_img.png -------------------------------------------------------------------------------- /docs/media/cloud/azureml/deploy_appservice_set_env_var.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/cloud/azureml/deploy_appservice_set_env_var.png -------------------------------------------------------------------------------- /docs/media/cloud/azureml/deploy_appservice_test_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/cloud/azureml/deploy_appservice_test_page.png -------------------------------------------------------------------------------- /docs/media/cloud/azureml/local-to-cloud-run-webview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/cloud/azureml/local-to-cloud-run-webview.png -------------------------------------------------------------------------------- /docs/media/column_mapping_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/column_mapping_details.png -------------------------------------------------------------------------------- /docs/media/contributing/auto-list-tool-in-extension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/contributing/auto-list-tool-in-extension.png -------------------------------------------------------------------------------- /docs/media/contributing/auto-list-tool-in-studio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/contributing/auto-list-tool-in-studio.png -------------------------------------------------------------------------------- /docs/media/contributing/custom-tool-list-in-extension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/contributing/custom-tool-list-in-extension.png -------------------------------------------------------------------------------- /docs/media/contributing/custom-tool-with-icon-in-extension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/contributing/custom-tool-with-icon-in-extension.png -------------------------------------------------------------------------------- /docs/media/contributing/f12_payload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/contributing/f12_payload.png -------------------------------------------------------------------------------- /docs/media/contributing/input-relationship.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/contributing/input-relationship.png -------------------------------------------------------------------------------- /docs/media/contributing/install-vsix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/contributing/install-vsix.png -------------------------------------------------------------------------------- /docs/media/contributing/mapping_input_description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/contributing/mapping_input_description.png -------------------------------------------------------------------------------- /docs/media/contributing/tool-folder-structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/contributing/tool-folder-structure.png -------------------------------------------------------------------------------- /docs/media/contributing/tool-tooltip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/contributing/tool-tooltip.png -------------------------------------------------------------------------------- /docs/media/contributing/view-detail.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/contributing/view-detail.gif -------------------------------------------------------------------------------- /docs/media/dev_setup/set_up_pycharm_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/dev_setup/set_up_pycharm_0.png -------------------------------------------------------------------------------- /docs/media/dev_setup/set_up_pycharm_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/dev_setup/set_up_pycharm_1.png -------------------------------------------------------------------------------- /docs/media/dev_setup/set_up_pycharm_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/dev_setup/set_up_pycharm_2.png -------------------------------------------------------------------------------- /docs/media/dev_setup/set_up_vscode_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/dev_setup/set_up_vscode_0.png -------------------------------------------------------------------------------- /docs/media/dev_setup/set_up_vscode_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/dev_setup/set_up_vscode_1.png -------------------------------------------------------------------------------- /docs/media/dev_setup/set_up_vscode_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/dev_setup/set_up_vscode_2.png -------------------------------------------------------------------------------- /docs/media/dev_setup/set_up_vscode_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/dev_setup/set_up_vscode_3.png -------------------------------------------------------------------------------- /docs/media/dev_setup/set_up_vscode_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/dev_setup/set_up_vscode_4.png -------------------------------------------------------------------------------- /docs/media/dev_setup/set_up_vscode_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/dev_setup/set_up_vscode_5.png -------------------------------------------------------------------------------- /docs/media/edit-this-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/edit-this-page.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/appservice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/appservice.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/conditional-flow-with-activate/activate_config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/conditional-flow-with-activate/activate_config.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/conditional-flow-with-activate/activate_when_bypassed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/conditional-flow-with-activate/activate_when_bypassed.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/conditional-flow-with-activate/bypassed_nodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/conditional-flow-with-activate/bypassed_nodes.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/conditional-flow-with-activate/dependencies_bypassed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/conditional-flow-with-activate/dependencies_bypassed.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/conditional-flow-with-activate/output_bypassed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/conditional-flow-with-activate/output_bypassed.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/conditional-flow-with-activate/provide_default_value.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/conditional-flow-with-activate/provide_default_value.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/conditional-flow-with-activate/visual_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/conditional-flow-with-activate/visual_editor.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/create_connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/create_connection.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/deploy_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/deploy_flow.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/deploy_flow_test_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/deploy_flow_test_page.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/develop-a-tool/use_file_path_in_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/develop-a-tool/use_file_path_in_flow.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/develop-standard-flow/add_tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/develop-standard-flow/add_tool.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/develop-standard-flow/edit_tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/develop-standard-flow/edit_tool.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/develop-standard-flow/flow_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/develop-standard-flow/flow_input.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/develop-standard-flow/flow_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/develop-standard-flow/flow_output.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/develop-standard-flow/link_llm_with_flow_input_single_output_node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/develop-standard-flow/link_llm_with_flow_input_single_output_node.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/develop-standard-flow/link_llm_with_multi_output_node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/develop-standard-flow/link_llm_with_multi_output_node.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/develop-standard-flow/link_python_with_flow_node_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/develop-standard-flow/link_python_with_flow_node_input.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/docker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/docker.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/how-to-enable-streaming-mode/chat_app.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/how-to-enable-streaming-mode/chat_app.gif -------------------------------------------------------------------------------- /docs/media/how-to-guides/how-to-enable-streaming-mode/chat_wikipedia_center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/how-to-enable-streaming-mode/chat_wikipedia_center.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/how-to-enable-streaming-mode/chat_wikipedia_dual_output_center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/how-to-enable-streaming-mode/chat_wikipedia_dual_output_center.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/init-and-test-a-flow/chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/init-and-test-a-flow/chat.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/init-and-test-a-flow/flow_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/init-and-test-a-flow/flow_folder.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/init-and-test-a-flow/flow_init_files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/init-and-test-a-flow/flow_init_files.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/init-and-test-a-flow/flow_init_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/init-and-test-a-flow/flow_init_output.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/init-and-test-a-flow/flow_output_files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/init-and-test-a-flow/flow_output_files.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/init-and-test-a-flow/flow_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/init-and-test-a-flow/flow_test.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/init-and-test-a-flow/streaming_output.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/init-and-test-a-flow/streaming_output.gif -------------------------------------------------------------------------------- /docs/media/how-to-guides/init-and-test-a-flow/vscode_new_flow_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/init-and-test-a-flow/vscode_new_flow_1.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/init-and-test-a-flow/vscode_new_flow_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/init-and-test-a-flow/vscode_new_flow_2.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/init-and-test-a-flow/vscode_test_flow_yaml_codelens.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/init-and-test-a-flow/vscode_test_flow_yaml_codelens.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/kubernetes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/kubernetes.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/local.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/local.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/batch_run_dag_yaml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/batch_run_dag_yaml.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/bulk_run_visual_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/bulk_run_visual_editor.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/flow-directory-and-dag-yaml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/flow-directory-and-dag-yaml.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/flow-run-create-output-cli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/flow-run-create-output-cli.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/flow-run-create-output-sdk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/flow-run-create-output-sdk.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/flow-run-create-with-stream-output-sdk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/flow-run-create-with-stream-output-sdk.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/flow-run-show-details-output-cli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/flow-run-show-details-output-cli.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/flow-run-show-details-output-sdk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/flow-run-show-details-output-sdk.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/flow-run-visualize-single-run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/flow-run-visualize-single-run.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/flow-test-output-cli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/flow-test-output-cli.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/flow_dag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/flow_dag.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/flow_directory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/flow_directory.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/flow_test_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/flow_test_output.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/test_flow_dag_editor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/test_flow_dag_editor.gif -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/test_flow_dag_yaml.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/test_flow_dag_yaml.gif -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/vs_code_connection_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/vs_code_connection_0.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/vs_code_connection_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/vs_code_connection_1.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/vs_code_connection_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/vs_code_connection_2.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/vs_code_connection_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/vs_code_connection_3.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/vs_code_dag_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/vs_code_dag_0.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/vs_code_interpreter_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/vs_code_interpreter_0.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/vs_code_interpreter_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/vs_code_interpreter_1.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/quick-start/vscode-flow-dag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/quick-start/vscode-flow-dag.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/run_create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/run_create.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/run_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/run_list.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/run_show.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/run_show.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/run_show_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/run_show_details.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/run_show_metrics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/run_show_metrics.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/run_visualize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/run_visualize.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/visualize_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/visualize_run.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode-tool-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode-tool-list.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_against_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_against_run.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_against_run_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_against_run_2.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_batch_run_visual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_batch_run_visual.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_batch_run_yaml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_batch_run_yaml.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_create_connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_create_connection.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_create_connection_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_create_connection_1.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_export.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_export_as_docker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_export_as_docker.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_export_as_local_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_export_as_local_app.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_interactive_chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_interactive_chat.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_interactive_chat_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_interactive_chat_1.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_list_connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_list_connection.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_list_runs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_list_runs.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_open_visual_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_open_visual_editor.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_run_actions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_run_actions.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_run_detail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_run_detail.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_single_node_debug_visual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_single_node_debug_visual.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_single_node_debug_yaml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_single_node_debug_yaml.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_single_node_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_single_node_test.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_single_node_test_visual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_single_node_test_visual.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_start_local_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_start_local_app.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_test_flow_visual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_test_flow_visual.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_test_flow_yaml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_test_flow_yaml.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_update_delete_connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_update_delete_connection.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_variants_folded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_variants_folded.png -------------------------------------------------------------------------------- /docs/media/how-to-guides/vscode_variants_unfold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/how-to-guides/vscode_variants_unfold.png -------------------------------------------------------------------------------- /docs/media/overview/prompt_flow_lifecycle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/overview/prompt_flow_lifecycle.png -------------------------------------------------------------------------------- /docs/media/promptflow-dag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/promptflow-dag.png -------------------------------------------------------------------------------- /docs/media/reference/tools-reference/open_source_llm_on_vscode_promptflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/docs/media/reference/tools-reference/open_source_llm_on_vscode_promptflow.png -------------------------------------------------------------------------------- /docs/reference/python-library-reference/promptflow.md: -------------------------------------------------------------------------------- 1 | # PLACEHOLDER -------------------------------------------------------------------------------- /examples/connections/.env.example: -------------------------------------------------------------------------------- 1 | api_key= -------------------------------------------------------------------------------- /examples/connections/azure_content_safety.yml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/AzureContentSafetyConnection.schema.json 2 | name: azure_content_safety_connection 3 | type: azure_content_safety 4 | api_key: "" 5 | endpoint: "endpoint" 6 | api_version: "2023-04-30-preview" 7 | 8 | -------------------------------------------------------------------------------- /examples/connections/azure_openai.yml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/AzureOpenAIConnection.schema.json 2 | name: open_ai_connection 3 | type: azure_open_ai 4 | api_key: "" 5 | api_base: "aoai-api-endpoint" 6 | api_type: "azure" 7 | -------------------------------------------------------------------------------- /examples/connections/cognitive_search.yml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/CognitiveSearchConnection.schema.json 2 | name: cognitive_search_connection 3 | type: cognitive_search 4 | api_key: "" 5 | api_base: "endpoint" 6 | api_version: "2023-07-01-Preview" 7 | -------------------------------------------------------------------------------- /examples/connections/custom.yml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/CustomConnection.schema.json 2 | name: custom_connection 3 | type: custom 4 | configs: 5 | key1: "test1" 6 | secrets: # required 7 | api-key: "" -------------------------------------------------------------------------------- /examples/connections/openai.yml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/OpenAIConnection.schema.json 2 | name: open_ai_connection 3 | type: open_ai 4 | api_key: "" 5 | organization: "" # optional 6 | -------------------------------------------------------------------------------- /examples/connections/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow 2 | promptflow-tools 3 | python-dotenv 4 | -------------------------------------------------------------------------------- /examples/connections/serp.yml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/SerpConnection.schema.json 2 | name: serp_connection 3 | type: serp 4 | api_key: "" 5 | -------------------------------------------------------------------------------- /examples/dev_requirements.txt: -------------------------------------------------------------------------------- 1 | # required for notebook sample ci 2 | ipython_genutils 3 | ipykernel 4 | papermill 5 | keyrings.alt 6 | black-nb 7 | pypandoc # for markdown reader 8 | pypandoc_binary # pypandoc pandoc backend 9 | panflute # for pandoc filters 10 | jinja2 # for readme generations -------------------------------------------------------------------------------- /examples/flows/chat/basic-chat/chat.jinja2: -------------------------------------------------------------------------------- 1 | system: 2 | You are a helpful assistant. 3 | 4 | {% for item in chat_history %} 5 | user: 6 | {{item.inputs.question}} 7 | assistant: 8 | {{item.outputs.answer}} 9 | {% endfor %} 10 | 11 | user: 12 | {{question}} -------------------------------------------------------------------------------- /examples/flows/chat/basic-chat/data.jsonl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/flows/chat/basic-chat/data.jsonl -------------------------------------------------------------------------------- /examples/flows/chat/basic-chat/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow 2 | promptflow-tools -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/__init__.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | 4 | sys.path.append( 5 | os.path.join(os.path.dirname(os.path.abspath(__file__)), "chat_with_pdf") 6 | ) 7 | -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/assets/batch-run.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/flows/chat/chat-with-pdf/assets/batch-run.gif -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/assets/chat_with_pdf_console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/flows/chat/chat-with-pdf/assets/chat_with_pdf_console.png -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/assets/chat_with_pdf_simple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/flows/chat/chat-with-pdf/assets/chat_with_pdf_simple.png -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/assets/chat_with_pdf_test_endpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/flows/chat/chat-with-pdf/assets/chat_with_pdf_test_endpoint.png -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/assets/chat_with_pdf_test_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/flows/chat/chat-with-pdf/assets/chat_with_pdf_test_page.png -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/assets/chat_with_pdf_with_rewrite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/flows/chat/chat-with-pdf/assets/chat_with_pdf_with_rewrite.png -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/assets/chatbot_console.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/flows/chat/chat-with-pdf/assets/chatbot_console.gif -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/assets/edge-chat-pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/flows/chat/chat-with-pdf/assets/edge-chat-pdf.png -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/assets/multi-node-flow-chat-with-pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/flows/chat/chat-with-pdf/assets/multi-node-flow-chat-with-pdf.png -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/assets/pf-visualize-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/flows/chat/chat-with-pdf/assets/pf-visualize-screenshot.png -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/assets/single-node-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/flows/chat/chat-with-pdf/assets/single-node-flow.png -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/build_index_tool.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | from chat_with_pdf.build_index import create_faiss_index 3 | 4 | 5 | @tool 6 | def build_index_tool(pdf_path: str) -> str: 7 | return create_faiss_index(pdf_path) 8 | -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/chat_with_pdf/__init__.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | 4 | sys.path.append(os.path.dirname(os.path.abspath(__file__))) 5 | -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/chat_with_pdf/qna.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from utils.oai import OAIChat 4 | 5 | 6 | def qna(prompt: str, history: list): 7 | max_completion_tokens = int(os.environ.get("MAX_COMPLETION_TOKENS")) 8 | 9 | chat = OAIChat() 10 | stream = chat.stream( 11 | messages=history + [{"role": "user", "content": prompt}], 12 | max_tokens=max_completion_tokens, 13 | ) 14 | 15 | return stream 16 | -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/chat_with_pdf/utils/__init__.py: -------------------------------------------------------------------------------- 1 | __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore 2 | -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/chat_with_pdf/utils/logging.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | 4 | def log(message: str): 5 | verbose = os.environ.get("VERBOSE", "false") 6 | if verbose.lower() == "true": 7 | print(message, flush=True) 8 | -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/data/bert-paper-qna-1-line.jsonl: -------------------------------------------------------------------------------- 1 | {"pdf_url":"https://arxiv.org/pdf/1810.04805.pdf", "chat_history":[], "question": "What is the name of the new language representation model introduced in the document?", "answer": "BERT", "context": "We introduce a new language representation model called BERT, which stands for Bidirectional Encoder Representations from Transformers."} -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/data/invalid-data-missing-column.jsonl: -------------------------------------------------------------------------------- 1 | {"pdf_url":"https://arxiv.org/pdf/1810.04805.pdf"} 2 | -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/download_tool.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | from chat_with_pdf.download import download 3 | 4 | 5 | @tool 6 | def download_tool(url: str, env_ready_signal: str) -> str: 7 | return download(url) 8 | -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/eval_run.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/Run.schema.json 2 | #name: eval_groundedness_default_20230820_200152_009000 3 | flow: ../../evaluation/eval-groundedness 4 | run: chat_with_pdf_default_20230820_162219_559000 5 | column_mapping: 6 | question: ${run.inputs.question} 7 | answer: ${run.outputs.answer} 8 | context: ${run.outputs.context} -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/find_context_tool.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | from chat_with_pdf.find_context import find_context 3 | 4 | 5 | @tool 6 | def find_context_tool(question: str, index_path: str): 7 | prompt, context = find_context(question, index_path) 8 | 9 | return {"prompt": prompt, "context": [c.text for c in context]} 10 | -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/requirements.txt: -------------------------------------------------------------------------------- 1 | PyPDF2 2 | faiss-cpu 3 | openai 4 | jinja2 5 | python-dotenv 6 | tiktoken 7 | promptflow[azure] 8 | promptflow-tools -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/rewrite_question_tool.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | from chat_with_pdf.rewrite_question import rewrite_question 3 | 4 | 5 | @tool 6 | def rewrite_question_tool(question: str, history: list, env_ready_signal: str): 7 | return rewrite_question(question, history) 8 | -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/runtime_env/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/azureml/promptflow/promptflow-runtime:latest 2 | COPY ./requirements.txt ./ 3 | RUN pip install --no-cache-dir -r requirements.txt -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/runtime_env/environment_runtime.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/latest/environment.schema.json 2 | name: chat_with_pdf 3 | image: docker.io/modulesdkpreview/chat_with_pdf 4 | inference_config: 5 | liveness_route: 6 | port: 8080 7 | path: /health 8 | readiness_route: 9 | port: 8080 10 | path: /health 11 | scoring_route: 12 | port: 8080 13 | path: /score 14 | -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-pdf/runtime_env/requirements.txt: -------------------------------------------------------------------------------- 1 | PyPDF2 2 | faiss-cpu 3 | openai 4 | jinja2 5 | python-dotenv 6 | tiktoken -------------------------------------------------------------------------------- /examples/flows/chat/chat-with-wikipedia/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow 2 | promptflow-tools 3 | bs4 -------------------------------------------------------------------------------- /examples/flows/evaluation/eval-basic/data.jsonl: -------------------------------------------------------------------------------- 1 | {"groundtruth": "Tomorrow's weather will be sunny.","prediction": "The weather will be sunny tomorrow."} 2 | -------------------------------------------------------------------------------- /examples/flows/evaluation/eval-basic/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow 2 | promptflow-tools -------------------------------------------------------------------------------- /examples/flows/evaluation/eval-classification-accuracy/data.jsonl: -------------------------------------------------------------------------------- 1 | {"groundtruth": "App","prediction": "App"} 2 | {"groundtruth": "Channel","prediction": "Channel"} 3 | {"groundtruth": "Academic","prediction": "Academic"} 4 | -------------------------------------------------------------------------------- /examples/flows/evaluation/eval-classification-accuracy/grade.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def grade(groundtruth: str, prediction: str): 6 | return "Correct" if groundtruth.lower() == prediction.lower() else "Incorrect" 7 | -------------------------------------------------------------------------------- /examples/flows/evaluation/eval-classification-accuracy/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow 2 | promptflow-tools -------------------------------------------------------------------------------- /examples/flows/evaluation/eval-entity-match-rate/cleansing.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | from promptflow import tool 3 | 4 | 5 | @tool 6 | def cleansing(entities_str: str) -> List[str]: 7 | # Split, remove leading and trailing spaces/tabs/dots 8 | parts = entities_str.split(",") 9 | cleaned_parts = [part.strip(" \t.\"") for part in parts] 10 | entities = [part for part in cleaned_parts if len(part) > 0] 11 | return entities 12 | -------------------------------------------------------------------------------- /examples/flows/evaluation/eval-entity-match-rate/data.jsonl: -------------------------------------------------------------------------------- 1 | {"entities": ["software engineer","CEO"],"ground_truth": "\"CEO, Software Engineer, Finance Manager\""} 2 | {"entities": ["Software Engineer","CEO", "Finance Manager"],"ground_truth": "\"CEO, Software Engineer, Finance Manager\""} 3 | -------------------------------------------------------------------------------- /examples/flows/evaluation/eval-entity-match-rate/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow 2 | promptflow-tools -------------------------------------------------------------------------------- /examples/flows/evaluation/eval-groundedness/calc_groundedness.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | import re 3 | 4 | 5 | @tool 6 | def parse_score(gpt_score: str): 7 | return float(extract_float(gpt_score)) 8 | 9 | 10 | def extract_float(s): 11 | match = re.search(r"[-+]?\d*\.\d+|\d+", s) 12 | if match: 13 | return float(match.group()) 14 | else: 15 | return None 16 | -------------------------------------------------------------------------------- /examples/flows/evaluation/eval-groundedness/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow 2 | promptflow-tools -------------------------------------------------------------------------------- /examples/flows/evaluation/eval-perceived-intelligence/parse_score.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | import re 3 | 4 | 5 | @tool 6 | def parse_score(gpt_score: str): 7 | return float(extract_float(gpt_score)) 8 | 9 | 10 | def extract_float(s): 11 | match = re.search(r"[-+]?\d*\.\d+|\d+", s) 12 | if match: 13 | return float(match.group()) 14 | else: 15 | return None 16 | -------------------------------------------------------------------------------- /examples/flows/evaluation/eval-perceived-intelligence/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow 2 | promptflow-tools -------------------------------------------------------------------------------- /examples/flows/standard/autonomous-agent/data.jsonl: -------------------------------------------------------------------------------- 1 | {"name": "FilmTriviaGPT", "role": "an AI specialized in film trivia that provides accurate and up-to-date information about movies, directors, actors, and more.", "goals": ["Introduce 'Lord of the Rings' film trilogy including the film title, release year, director, current age of the director, production company and a brief summary of the film."]} -------------------------------------------------------------------------------- /examples/flows/standard/autonomous-agent/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow 2 | promptflow-tools 3 | tiktoken 4 | bs4 -------------------------------------------------------------------------------- /examples/flows/standard/autonomous-agent/triggering_prompt.jinja2: -------------------------------------------------------------------------------- 1 | Determine which next function to use, and respond using stringfield JSON object. If you have completed all your tasks, make sure to use the 'finish' function to signal and remember show your results. -------------------------------------------------------------------------------- /examples/flows/standard/autonomous-agent/user_prompt.jinja2: -------------------------------------------------------------------------------- 1 | Goals: {{goals}} -------------------------------------------------------------------------------- /examples/flows/standard/basic-with-builtin-llm/data.jsonl: -------------------------------------------------------------------------------- 1 | {"text": "Python Hello World!"} 2 | {"text": "C Hello World!"} 3 | {"text": "C# Hello World!"} -------------------------------------------------------------------------------- /examples/flows/standard/basic-with-builtin-llm/hello.jinja2: -------------------------------------------------------------------------------- 1 | system: 2 | You are a assistant which can write code. Response should only contain code. 3 | 4 | user: 5 | Write a simple {{text}} program that displays the greeting message when executed. -------------------------------------------------------------------------------- /examples/flows/standard/basic-with-builtin-llm/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow 2 | promptflow-tools 3 | python-dotenv -------------------------------------------------------------------------------- /examples/flows/standard/basic-with-connection/custom.yml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/CustomConnection.schema.json 2 | name: basic_custom_connection 3 | type: custom 4 | configs: 5 | api_type: azure 6 | api_version: 2023-03-15-preview 7 | api_base: https://.openai.azure.com/ 8 | secrets: # must-have 9 | api_key: 10 | -------------------------------------------------------------------------------- /examples/flows/standard/basic-with-connection/data.jsonl: -------------------------------------------------------------------------------- 1 | {"text": "Python Hello World!"} 2 | {"text": "C Hello World!"} 3 | {"text": "C# Hello World!"} 4 | -------------------------------------------------------------------------------- /examples/flows/standard/basic-with-connection/hello.jinja2: -------------------------------------------------------------------------------- 1 | {# Please replace the template with your own prompt. #} 2 | Write a simple {{text}} program that displays the greeting message when executed. -------------------------------------------------------------------------------- /examples/flows/standard/basic-with-connection/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow[azure] 2 | promptflow-tools 3 | python-dotenv -------------------------------------------------------------------------------- /examples/flows/standard/basic/.env.example: -------------------------------------------------------------------------------- 1 | AZURE_OPENAI_API_KEY= 2 | AZURE_OPENAI_API_BASE= 3 | AZURE_OPENAI_API_TYPE=azure 4 | -------------------------------------------------------------------------------- /examples/flows/standard/basic/data.jsonl: -------------------------------------------------------------------------------- 1 | {"text": "Python Hello World!"} 2 | {"text": "C Hello World!"} 3 | {"text": "C# Hello World!"} 4 | -------------------------------------------------------------------------------- /examples/flows/standard/basic/hello.jinja2: -------------------------------------------------------------------------------- 1 | {# Please replace the template with your own prompt. #} 2 | Write a simple {{text}} program that displays the greeting message when executed. -------------------------------------------------------------------------------- /examples/flows/standard/basic/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow[azure] 2 | promptflow-tools 3 | python-dotenv -------------------------------------------------------------------------------- /examples/flows/standard/basic/run.yml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/Run.schema.json 2 | flow: . 3 | data: data.jsonl 4 | environment_variables: 5 | # environment variables from connection 6 | AZURE_OPENAI_API_KEY: ${open_ai_connection.api_key} 7 | AZURE_OPENAI_API_BASE: ${open_ai_connection.api_base} 8 | AZURE_OPENAI_API_TYPE: azure -------------------------------------------------------------------------------- /examples/flows/standard/conditional-flow-for-if-else/content_safety_check.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | import random 3 | 4 | 5 | @tool 6 | def content_safety_check(text: str) -> str: 7 | # You can use a content safety node to replace this tool. 8 | return random.choice([True, False]) 9 | -------------------------------------------------------------------------------- /examples/flows/standard/conditional-flow-for-if-else/content_safety_check_failed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/flows/standard/conditional-flow-for-if-else/content_safety_check_failed.png -------------------------------------------------------------------------------- /examples/flows/standard/conditional-flow-for-if-else/content_safety_check_passed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/flows/standard/conditional-flow-for-if-else/content_safety_check_passed.png -------------------------------------------------------------------------------- /examples/flows/standard/conditional-flow-for-if-else/data.jsonl: -------------------------------------------------------------------------------- 1 | {"question": "What is Prompt flow?"} 2 | {"question": "What is ChatGPT?"} -------------------------------------------------------------------------------- /examples/flows/standard/conditional-flow-for-if-else/default_result.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def default_result(question: str) -> str: 6 | return f"I'm not familiar with your query: {question}." 7 | -------------------------------------------------------------------------------- /examples/flows/standard/conditional-flow-for-if-else/generate_result.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def generate_result(llm_result="", default_result="") -> str: 6 | if llm_result: 7 | return llm_result 8 | else: 9 | return default_result 10 | -------------------------------------------------------------------------------- /examples/flows/standard/conditional-flow-for-if-else/llm_result.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def llm_result(question: str) -> str: 6 | # You can use an LLM node to replace this tool. 7 | return ( 8 | "Prompt flow is a suite of development tools designed to streamline " 9 | "the end-to-end development cycle of LLM-based AI applications." 10 | ) 11 | -------------------------------------------------------------------------------- /examples/flows/standard/conditional-flow-for-if-else/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow 2 | promptflow-tools -------------------------------------------------------------------------------- /examples/flows/standard/conditional-flow-for-switch/class_check.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def class_check(llm_result: str) -> str: 6 | intentions_list = ["order_search", "product_info", "product_recommendation"] 7 | matches = [intention for intention in intentions_list if intention in llm_result.lower()] 8 | return matches[0] if matches else "unknown" 9 | -------------------------------------------------------------------------------- /examples/flows/standard/conditional-flow-for-switch/conditional_flow_for_switch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/flows/standard/conditional-flow-for-switch/conditional_flow_for_switch.png -------------------------------------------------------------------------------- /examples/flows/standard/conditional-flow-for-switch/data.jsonl: -------------------------------------------------------------------------------- 1 | {"query": "When will my order be shipped?"} 2 | {"query": "Can you help me find information about this T-shirt?"} 3 | {"query": "Can you recommend me a useful prompt tool?"} -------------------------------------------------------------------------------- /examples/flows/standard/conditional-flow-for-switch/generate_response.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def generate_response(order_search="", product_info="", product_recommendation="") -> str: 6 | default_response = "Sorry, no results matching your search were found." 7 | responses = [order_search, product_info, product_recommendation] 8 | return next((response for response in responses if response), default_response) 9 | -------------------------------------------------------------------------------- /examples/flows/standard/conditional-flow-for-switch/order_search.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def order_search(query: str) -> str: 6 | print(f"Your query is {query}.\nSearching for order...") 7 | return "Your order is being mailed, please wait patiently." 8 | -------------------------------------------------------------------------------- /examples/flows/standard/conditional-flow-for-switch/product_info.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def product_info(query: str) -> str: 6 | print(f"Your query is {query}.\nLooking for product information...") 7 | return "This product is produced by Microsoft." 8 | -------------------------------------------------------------------------------- /examples/flows/standard/conditional-flow-for-switch/product_recommendation.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def product_recommendation(query: str) -> str: 6 | print(f"Your query is {query}.\nRecommending products...") 7 | return "I recommend promptflow to you, which can solve your problem very well." 8 | -------------------------------------------------------------------------------- /examples/flows/standard/conditional-flow-for-switch/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow 2 | promptflow-tools -------------------------------------------------------------------------------- /examples/flows/standard/customer-intent-extraction/.amlignore: -------------------------------------------------------------------------------- 1 | *.ipynb 2 | .venv/ 3 | .data/ 4 | .env 5 | .vscode/ 6 | outputs/ 7 | connection.json -------------------------------------------------------------------------------- /examples/flows/standard/customer-intent-extraction/.env.example: -------------------------------------------------------------------------------- 1 | CHAT_DEPLOYMENT_NAME=gpt-35-turbo 2 | AZURE_OPENAI_API_KEY= 3 | AZURE_OPENAI_API_BASE= 4 | -------------------------------------------------------------------------------- /examples/flows/standard/customer-intent-extraction/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow 2 | promptflow-tools 3 | python-dotenv 4 | langchain 5 | jinja2 -------------------------------------------------------------------------------- /examples/flows/standard/filepath-input-tool-showcase/hello_method.py: -------------------------------------------------------------------------------- 1 | def hello(input_text: str) -> str: 2 | # Replace with your own code. 3 | return "Hello " + input_text 4 | -------------------------------------------------------------------------------- /examples/flows/standard/filepath-input-tool-showcase/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow 2 | promptflow-tools 3 | my-tools-package -------------------------------------------------------------------------------- /examples/flows/standard/flow-with-additional-includes/data.jsonl: -------------------------------------------------------------------------------- 1 | {"url": "https://www.youtube.com/watch?v=o5ZQyXaAv1g", "answer": "Channel", "evidence": "Url"} 2 | {"url": "https://arxiv.org/abs/2307.04767", "answer": "Academic", "evidence": "Text content"} 3 | {"url": "https://play.google.com/store/apps/details?id=com.twitter.android", "answer": "App", "evidence": "Both"} 4 | -------------------------------------------------------------------------------- /examples/flows/standard/flow-with-additional-includes/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow[azure] 2 | promptflow-tools 3 | bs4 -------------------------------------------------------------------------------- /examples/flows/standard/flow-with-additional-includes/run.yml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/Run.schema.json 2 | flow: . 3 | data: data.jsonl 4 | variant: ${summarize_text_content.variant_1} -------------------------------------------------------------------------------- /examples/flows/standard/flow-with-additional-includes/run_evaluation.yml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/Run.schema.json 2 | flow: ../../evaluation/eval-classification-accuracy 3 | data: data.jsonl 4 | run: web_classification_variant_1_20230724_173442_973403 # replace with your run name 5 | column_mapping: 6 | groundtruth: ${data.answer} 7 | prediction: ${run.outputs.category} -------------------------------------------------------------------------------- /examples/flows/standard/flow-with-symlinks/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow[azure] 2 | promptflow-tools 3 | bs4 -------------------------------------------------------------------------------- /examples/flows/standard/gen-docstring/combine_code.jinja2: -------------------------------------------------------------------------------- 1 | {{divided|join('')}} -------------------------------------------------------------------------------- /examples/flows/standard/gen-docstring/combine_code_tool.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | from divider import Divider 3 | 4 | 5 | @tool 6 | def combine_code(divided: list[str]): 7 | code = Divider.combine(divided) 8 | return code 9 | -------------------------------------------------------------------------------- /examples/flows/standard/gen-docstring/data.jsonl: -------------------------------------------------------------------------------- 1 | {"source": "./divider.py"} 2 | {"source": "./azure_open_ai.py"} 3 | {"source": "./generate_docstring_tool.py"} 4 | -------------------------------------------------------------------------------- /examples/flows/standard/gen-docstring/divide_code_tool.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | from divider import Divider 3 | 4 | 5 | @tool 6 | def divide_code(file_content: str): 7 | # Divide the code into several parts according to the global import/class/function. 8 | divided = Divider.divide_file(file_content) 9 | return divided 10 | -------------------------------------------------------------------------------- /examples/flows/standard/gen-docstring/load_code_tool.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | from file import File 3 | 4 | 5 | @tool 6 | def load_code(source: str): 7 | file = File(source) 8 | return file.content 9 | -------------------------------------------------------------------------------- /examples/flows/standard/gen-docstring/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow[azure] 2 | promptflow-tools 3 | python-dotenv 4 | jinja2 5 | tiktoken -------------------------------------------------------------------------------- /examples/flows/standard/gen-docstring/result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/flows/standard/gen-docstring/result.png -------------------------------------------------------------------------------- /examples/flows/standard/maths-to-code/requirements.txt: -------------------------------------------------------------------------------- 1 | langchain 2 | sympy 3 | promptflow[azure] 4 | promptflow-tools -------------------------------------------------------------------------------- /examples/flows/standard/named-entity-recognition/cleansing.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | from promptflow import tool 3 | 4 | 5 | @tool 6 | def cleansing(entities_str: str) -> List[str]: 7 | # Split, remove leading and trailing spaces/tabs/dots 8 | parts = entities_str.split(",") 9 | cleaned_parts = [part.strip(" \t.\"") for part in parts] 10 | entities = [part for part in cleaned_parts if len(part) > 0] 11 | return entities 12 | -------------------------------------------------------------------------------- /examples/flows/standard/named-entity-recognition/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow 2 | promptflow-tools -------------------------------------------------------------------------------- /examples/flows/standard/web-classification/convert_to_dict.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | from promptflow import tool 4 | 5 | 6 | @tool 7 | def convert_to_dict(input_str: str): 8 | try: 9 | return json.loads(input_str) 10 | except Exception as e: 11 | print("The input is not valid, error: {}".format(e)) 12 | return {"category": "None", "evidence": "None"} 13 | -------------------------------------------------------------------------------- /examples/flows/standard/web-classification/data.jsonl: -------------------------------------------------------------------------------- 1 | {"url": "https://www.youtube.com/watch?v=kYqRtjDBci8", "answer": "Channel", "evidence": "Both"} 2 | {"url": "https://arxiv.org/abs/2307.04767", "answer": "Academic", "evidence": "Both"} 3 | {"url": "https://play.google.com/store/apps/details?id=com.twitter.android", "answer": "App", "evidence": "Both"} 4 | -------------------------------------------------------------------------------- /examples/flows/standard/web-classification/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow[azure] 2 | promptflow-tools 3 | bs4 -------------------------------------------------------------------------------- /examples/flows/standard/web-classification/run.yml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/Run.schema.json 2 | flow: . 3 | data: data.jsonl 4 | variant: ${summarize_text_content.variant_1} -------------------------------------------------------------------------------- /examples/flows/standard/web-classification/run_evaluation.yml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/Run.schema.json 2 | flow: ../../evaluation/eval-classification-accuracy 3 | data: data.jsonl 4 | run: web_classification_variant_1_20230724_173442_973403 # replace with your run name 5 | column_mapping: 6 | groundtruth: ${data.answer} 7 | prediction: ${run.outputs.category} -------------------------------------------------------------------------------- /examples/flows/standard/web-classification/summarize_text_content.jinja2: -------------------------------------------------------------------------------- 1 | system: 2 | Please summarize the following text in one paragraph. 100 words. 3 | Do not add any information that is not in the text. 4 | 5 | user: 6 | Text: {{text}} 7 | Summary: -------------------------------------------------------------------------------- /examples/flows/standard/web-classification/summarize_text_content__variant_1.jinja2: -------------------------------------------------------------------------------- 1 | system: 2 | Please summarize some keywords of this paragraph and have some details of each keywords. 3 | Do not add any information that is not in the text. 4 | 5 | user: 6 | Text: {{text}} 7 | Summary: -------------------------------------------------------------------------------- /examples/requirements.txt: -------------------------------------------------------------------------------- 1 | promptflow[azure] 2 | promptflow-tools==0.1.0.b5 3 | python-dotenv 4 | bs4 5 | -------------------------------------------------------------------------------- /examples/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | pip install -r requirements.txt 5 | # 6 | 7 | pip list -------------------------------------------------------------------------------- /examples/tools/tool-package-quickstart/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include my_tool_package/yamls/*.yaml -------------------------------------------------------------------------------- /examples/tools/tool-package-quickstart/my_tool_package/__init__.py: -------------------------------------------------------------------------------- 1 | __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore 2 | -------------------------------------------------------------------------------- /examples/tools/tool-package-quickstart/my_tool_package/icons/custom-tool-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/tools/tool-package-quickstart/my_tool_package/icons/custom-tool-icon.png -------------------------------------------------------------------------------- /examples/tools/tool-package-quickstart/my_tool_package/tools/__init__.py: -------------------------------------------------------------------------------- 1 | __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore 2 | -------------------------------------------------------------------------------- /examples/tools/tool-package-quickstart/my_tool_package/yamls/my_tool_1.yaml: -------------------------------------------------------------------------------- 1 | my_tool_package.tools.my_tool_1.my_tool: 2 | function: my_tool 3 | inputs: 4 | connection: 5 | type: 6 | - CustomConnection 7 | input_text: 8 | type: 9 | - string 10 | module: my_tool_package.tools.my_tool_1 11 | name: My First Tool 12 | description: This is my first tool 13 | type: python 14 | -------------------------------------------------------------------------------- /examples/tools/tool-package-quickstart/my_tool_package/yamls/my_tool_2.yaml: -------------------------------------------------------------------------------- 1 | my_tool_package.tools.my_tool_2.MyTool.my_tool: 2 | class_name: MyTool 3 | function: my_tool 4 | inputs: 5 | connection: 6 | type: 7 | - CustomConnection 8 | input_text: 9 | type: 10 | - string 11 | module: my_tool_package.tools.my_tool_2 12 | name: My Second Tool 13 | description: This is my second tool 14 | type: python 15 | -------------------------------------------------------------------------------- /examples/tools/tool-package-quickstart/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/tools/tool-package-quickstart/tests/__init__.py -------------------------------------------------------------------------------- /examples/tools/tool-package-quickstart/tests/test_utils/hello_method.py: -------------------------------------------------------------------------------- 1 | def hello(input_text: str) -> str: 2 | # Replace with your own code. 3 | return "Hello " + input_text 4 | -------------------------------------------------------------------------------- /examples/tutorials/flow-deploy/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | **/build/flow 3 | **/build/connections 4 | **/build/settings.json -------------------------------------------------------------------------------- /examples/tutorials/flow-deploy/README.md: -------------------------------------------------------------------------------- 1 | # Deploy flow as applications 2 | 3 | This folder contains examples of how to build & deploy flow as applications like Web Application packaged in Docker format. -------------------------------------------------------------------------------- /examples/tutorials/flow-deploy/azure-app-service/assets/azure_portal_img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/tutorials/flow-deploy/azure-app-service/assets/azure_portal_img.png -------------------------------------------------------------------------------- /examples/tutorials/flow-deploy/azure-app-service/assets/set_env_var.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/tutorials/flow-deploy/azure-app-service/assets/set_env_var.png -------------------------------------------------------------------------------- /examples/tutorials/flow-deploy/azure-app-service/assets/test_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/tutorials/flow-deploy/azure-app-service/assets/test_page.png -------------------------------------------------------------------------------- /examples/tutorials/quick-start/media/logo_pf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/tutorials/quick-start/media/logo_pf.png -------------------------------------------------------------------------------- /examples/tutorials/quick-start/media/vsc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/examples/tutorials/quick-start/media/vsc.png -------------------------------------------------------------------------------- /scripts/building/dev_requirements.txt: -------------------------------------------------------------------------------- 1 | setuptools 2 | wheel 3 | twine==4.0.0 4 | portalocker~=1.2 5 | setuptools_rust 6 | pytest 7 | pytest-xdist 8 | pytest-sugar 9 | pytest-timeout 10 | azure-keyvault 11 | azure-identity 12 | -------------------------------------------------------------------------------- /scripts/building/release-env.yml: -------------------------------------------------------------------------------- 1 | name: release-env 2 | channels: 3 | - defaults 4 | - conda-forge 5 | dependencies: 6 | - pip 7 | - pip: 8 | - setuptools 9 | - twine==4.0.0 10 | - portalocker~=1.2 11 | - setuptools_rust 12 | - pytest 13 | - pytest-xdist 14 | - pytest-sugar 15 | - pytest-timeout 16 | - azure-keyvault 17 | - azure-identity 18 | -------------------------------------------------------------------------------- /scripts/compliance-check/user_exclusion.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | SRC\PROMPTFLOW\PROMPTFLOW\_SDK\_SERVING\STATIC\INDEX.JS 5 | 6 | -------------------------------------------------------------------------------- /scripts/distributing/configs/promptflow-tools-release-env.yaml: -------------------------------------------------------------------------------- 1 | name: release-env 2 | channels: 3 | - defaults 4 | - conda-forge 5 | dependencies: 6 | - python=3.8 7 | - pip 8 | - pip: 9 | - setuptools 10 | - twine==4.0.0 11 | - azure-storage-blob==12.16.0 12 | -------------------------------------------------------------------------------- /scripts/docs/_static/bg_dark_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/scripts/docs/_static/bg_dark_large.png -------------------------------------------------------------------------------- /scripts/docs/_static/bg_dark_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/scripts/docs/_static/bg_dark_small.png -------------------------------------------------------------------------------- /scripts/docs/_static/bg_light_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/scripts/docs/_static/bg_light_large.png -------------------------------------------------------------------------------- /scripts/docs/_static/bg_light_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/scripts/docs/_static/bg_light_small.png -------------------------------------------------------------------------------- /scripts/docs/_static/logo32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/scripts/docs/_static/logo32.ico -------------------------------------------------------------------------------- /scripts/readme/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/scripts/readme/__init__.py -------------------------------------------------------------------------------- /scripts/readme/ghactions_driver/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/scripts/readme/ghactions_driver/__init__.py -------------------------------------------------------------------------------- /scripts/readme/ghactions_driver/bash_script/bash_script.sh.jinja2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -xe 3 | {{ command }} -------------------------------------------------------------------------------- /scripts/readme/ghactions_driver/telemetry_obj.py: -------------------------------------------------------------------------------- 1 | class Telemetry(object): 2 | pass 3 | -------------------------------------------------------------------------------- /scripts/readme/ghactions_driver/workflow_steps/step_azure_login.yml.jinja2: -------------------------------------------------------------------------------- 1 | - name: {{ step_name }} 2 | uses: azure/login@v1 3 | with: 4 | creds: ${{ '{{' }} secrets.AZURE_CREDENTIALS }} -------------------------------------------------------------------------------- /scripts/readme/ghactions_driver/workflow_steps/step_env_create_aoai.yml.jinja2: -------------------------------------------------------------------------------- 1 | - name: {{ step_name }} 2 | working-directory: {{ working_dir }} 3 | run: | 4 | if [[ -e .env ]]; then 5 | pf connection create --file .env --name {{ connection_name }} 6 | pf connection list 7 | fi 8 | -------------------------------------------------------------------------------- /scripts/readme/ghactions_driver/workflow_steps/step_install_deps.yml.jinja2: -------------------------------------------------------------------------------- 1 | - name: {{ step_name }} 2 | working-directory: examples 3 | run: | 4 | if [[ -e requirements.txt ]]; then 5 | python -m pip install --upgrade pip 6 | pip install -r requirements.txt 7 | fi -------------------------------------------------------------------------------- /scripts/readme/ghactions_driver/workflow_steps/step_install_dev_deps.yml.jinja2: -------------------------------------------------------------------------------- 1 | - name: {{ step_name }} 2 | working-directory: examples 3 | run: | 4 | python -m pip install --upgrade pip 5 | pip install -r dev_requirements.txt -------------------------------------------------------------------------------- /scripts/readme/ghactions_driver/workflow_steps/step_yml_create_aoai.yml.jinja2: -------------------------------------------------------------------------------- 1 | - name: {{ step_name }} 2 | working-directory: ${{ '{{' }} github.workspace }} 3 | run: pf connection create --file {{ yaml_name }} --set api_key=${{ '{{' }} secrets.AOAI_API_KEY_TEST }} api_base=${{ '{{' }} secrets.AOAI_API_ENDPOINT_TEST }} -------------------------------------------------------------------------------- /scripts/tool/exceptions/__init__.py: -------------------------------------------------------------------------------- 1 | from .secret_exceptions import SecretNameAlreadyExistsException, SecretNameInvalidException, SecretNoSetPermissionException # noqa: F401, E501 2 | -------------------------------------------------------------------------------- /scripts/tool/exceptions/secret_exceptions.py: -------------------------------------------------------------------------------- 1 | class SecretNameAlreadyExistsException(Exception): 2 | pass 3 | 4 | 5 | class SecretNameInvalidException(Exception): 6 | pass 7 | 8 | 9 | class SecretNoSetPermissionException(Exception): 10 | pass 11 | -------------------------------------------------------------------------------- /scripts/tool/templates/MANIFEST.in.j2: -------------------------------------------------------------------------------- 1 | include {{ package_name }}/yamls/*.yaml -------------------------------------------------------------------------------- /scripts/tool/templates/tool.yaml.j2: -------------------------------------------------------------------------------- 1 | {{ package_name }}.tools.{{ tool_name }}.{{ function_name }}: 2 | function: {{ function_name }} 3 | inputs: 4 | connection: 5 | type: 6 | - CustomConnection 7 | input_text: 8 | type: 9 | - string 10 | module: {{ package_name }}.tools.{{ tool_name }} 11 | name: Hello World Tool 12 | description: This is hello world tool 13 | type: python 14 | -------------------------------------------------------------------------------- /scripts/tool/templates/tool2.yaml.j2: -------------------------------------------------------------------------------- 1 | {{ package_name }}.tools.{{ tool_name }}.{{ class_name }}.{{ function_name }}: 2 | class_name: {{ class_name }} 3 | function: {{ function_name }} 4 | inputs: 5 | url: 6 | type: 7 | - string 8 | query: 9 | type: 10 | - string 11 | module: {{ package_name }}.tools.{{ tool_name }} 12 | name: Hello World Tool 13 | description: This is hello world tool 14 | type: python 15 | -------------------------------------------------------------------------------- /scripts/tool/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/scripts/tool/utils/__init__.py -------------------------------------------------------------------------------- /scripts/tool/utils/configs/promptflow-gallery-tool-test.yaml: -------------------------------------------------------------------------------- 1 | storage: 2 | storage_account: promptflowgall5817910653 3 | deployment: 4 | subscription_id: 96aede12-2f73-41cb-b983-6d11a904839b 5 | resource_group: promptflow 6 | workspace_name: promptflow-gallery 7 | endpoint_name: tool-test638236049123389546 8 | deployment_name: blue 9 | mt_service_endpoint: https://eastus2euap.api.azureml.ms -------------------------------------------------------------------------------- /src/promptflow-tools/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include promptflow/tools/yamls/*.yaml -------------------------------------------------------------------------------- /src/promptflow-tools/promptflow/tools/__init__.py: -------------------------------------------------------------------------------- 1 | from .aoai import AzureOpenAI # noqa: F401 2 | from .openai import OpenAI # noqa: F401 3 | from .serpapi import SerpAPI # noqa: F401 4 | -------------------------------------------------------------------------------- /src/promptflow-tools/promptflow/version.txt: -------------------------------------------------------------------------------- 1 | VERSION = "0.1.0b8" -------------------------------------------------------------------------------- /src/promptflow-tools/requirements.txt: -------------------------------------------------------------------------------- 1 | google-search-results==2.4.1 2 | promptflow 3 | -------------------------------------------------------------------------------- /src/promptflow-tools/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow-tools/tests/__init__.py -------------------------------------------------------------------------------- /src/promptflow-tools/tests/pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | markers = 3 | skip_if_no_key: skip the test if actual api key is not provided. -------------------------------------------------------------------------------- /src/promptflow-tools/tests/test_configs/prompt_templates/prompt_with_function.jinja2: -------------------------------------------------------------------------------- 1 | system: 2 | Don't make assumptions about what values to plug into functions. Ask for clarification if a user request is ambiguous. 3 | 4 | user: 5 | {{prev_question}} 6 | 7 | assistant: 8 | {{prev_answer}} 9 | 10 | function: 11 | name: 12 | {{name}} 13 | 14 | content: 15 | {{result}} 16 | 17 | user: 18 | {{question}} 19 | -------------------------------------------------------------------------------- /src/promptflow/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include promptflow/azure/resources/* 2 | include promptflow/_sdk/_serving/static/* 3 | recursive-include promptflow/_cli/data * 4 | recursive-include promptflow/_sdk/data * 5 | -------------------------------------------------------------------------------- /src/promptflow/dev_requirements.txt: -------------------------------------------------------------------------------- 1 | pre-commit 2 | nox 3 | mock 4 | pytest-cov 5 | coverage==6.0.1 6 | pytest-forked 7 | pytest-xdist 8 | pytest-timeout 9 | pytest-mock 10 | pytest-nunit 11 | pytest 12 | pydash 13 | wheel 14 | azure-mgmt-storage==21.0.0 15 | # Note: This is possibly-insecure, do not add this to setup. 16 | keyrings.alt 17 | 18 | promptflow-tools 19 | 20 | beautifulsoup4==4.12.2 21 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_cli/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore 6 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_cli/_pf/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore 6 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_cli/_pf_azure/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore 6 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_cli/_user_agent.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | from promptflow._version import VERSION 5 | 6 | USER_AGENT = "{}/{}".format("promptflow-cli", VERSION) 7 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_cli/data/chat_flow/azure_openai.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/AzureOpenAIConnection.schema.json 2 | name: open_ai_connection 3 | type: azure_open_ai 4 | api_key: "" 5 | api_base: "" 6 | api_type: "azure" 7 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_cli/data/chat_flow/chat.jinja2: -------------------------------------------------------------------------------- 1 | system: 2 | You are a helpful assistant. 3 | 4 | {% for item in chat_history %} 5 | user: 6 | {{item.inputs.question}} 7 | assistant: 8 | {{item.outputs.answer}} 9 | {% endfor %} 10 | 11 | user: 12 | {{question}} 13 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_cli/data/chat_flow/openai.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/OpenAIConnection.schema.json 2 | name: open_ai_connection 3 | type: open_ai 4 | api_key: "" 5 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_cli/data/entry_flow/gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | __pycache__/ 3 | .promptflow/* 4 | !.promptflow/flow.tools.json 5 | .runs/ 6 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_cli/data/entry_flow/requirements_txt: -------------------------------------------------------------------------------- 1 | promptflow -------------------------------------------------------------------------------- /src/promptflow/promptflow/_cli/data/evaluation_flow/data.jsonl: -------------------------------------------------------------------------------- 1 | {"groundtruth": "App", "prediction": "App"} 2 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_cli/data/standard_flow/data.jsonl: -------------------------------------------------------------------------------- 1 | {"text": "Hello World!"} 2 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_cli/data/standard_flow/hello.jinja2: -------------------------------------------------------------------------------- 1 | {# Please replace the template with your own prompt. #} Write a simple {{text}} program that displays the greeting message when executed. 2 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_cli/pf.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | from promptflow._cli._pf.entry import main 6 | 7 | # this is a compatibility layer for the old CLI which is used for vscode extension 8 | if __name__ == "__main__": 9 | main() 10 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_core/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_sdk/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore 6 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_sdk/_service/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore 6 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_sdk/_serving/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore 6 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_sdk/_user_agent.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | from promptflow._version import VERSION 5 | 6 | USER_AGENT = "{}/{}".format("promptflow-sdk", VERSION) 7 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_sdk/_vendor/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | from ._asset_utils import IgnoreFile, get_ignore_file, get_upload_files_from_folder 6 | 7 | __all__ = ["get_ignore_file", "IgnoreFile", "get_upload_files_from_folder"] 8 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_sdk/operations/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore 6 | 7 | from ._run_operations import RunOperations 8 | 9 | __all__ = [ 10 | "RunOperations", 11 | ] 12 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_sdk/schemas/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore 6 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_telemetry/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_utils/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/_version.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | VERSION = "0.0.1" 6 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/azure/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore 6 | 7 | from ._pf_client import PFClient 8 | 9 | __all__ = ["PFClient"] 10 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/azure/_entities/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore 6 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/azure/_restclient/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/azure/_restclient/flow/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. -------------------------------------------------------------------------------- /src/promptflow/promptflow/azure/_schemas/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore 6 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/azure/_utils/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore 6 | 7 | from .gerneral import is_arm_id 8 | 9 | __all__ = ["is_arm_id"] 10 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/azure/operations/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore 6 | 7 | 8 | from ._run_operations import RunOperations 9 | 10 | __all__ = ["RunOperations"] 11 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/azure/resources/component_spec_template.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/latest/commandComponent.schema.json 2 | # will be changed to flow to support parallelism 3 | type: command 4 | outputs: 5 | output: 6 | # PRS team will always aggregate all the outputs into a single file under this folder for now 7 | type: uri_folder 8 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/contracts/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/contracts/_errors.py: -------------------------------------------------------------------------------- 1 | from promptflow.exceptions import UserErrorException, ValidationException 2 | 3 | 4 | class FailedToImportModule(UserErrorException): 5 | pass 6 | 7 | 8 | class NodeConditionConflict(ValidationException): 9 | pass 10 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/executor/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | # flake8: noqa 6 | from .flow_executor import FlowExecutor 7 | from .flow_validator import FlowValidator 8 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/integrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/promptflow/integrations/__init__.py -------------------------------------------------------------------------------- /src/promptflow/promptflow/storage/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | from ._cache_storage import AbstractCacheStorage # noqa: F401 6 | from ._run_storage import AbstractRunStorage # noqa: F401 7 | 8 | __all__ = ["AbstractCacheStorage", "AbstractRunStorage"] 9 | -------------------------------------------------------------------------------- /src/promptflow/promptflow/storage/_errors.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | 5 | 6 | class DuplicatedPrimaryKeyException(Exception): 7 | pass 8 | 9 | 10 | class NotFoundException(Exception): 11 | pass 12 | -------------------------------------------------------------------------------- /src/promptflow/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.black] 2 | line-length = 120 3 | 4 | [tool.pytest.ini_options] 5 | markers = [ 6 | "sdk_test", 7 | "cli_test", 8 | "unittest", 9 | "e2etest", 10 | "flaky", 11 | "endpointtest", 12 | "mt_endpointtest", 13 | ] 14 | 15 | [tool.coverage.run] 16 | omit = [ 17 | # omit anything in a _restclient directory anywhere 18 | "*/_restclient/*", 19 | ] 20 | -------------------------------------------------------------------------------- /src/promptflow/tests/executor/.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | omit = 3 | */promptflow/_cli/* 4 | */promptflow/_sdk/* 5 | */promptflow/_telemetry/* 6 | */promptflow/azure/* 7 | */promptflow/entities/* 8 | */promptflow/operations/* 9 | *__init__.py* 10 | -------------------------------------------------------------------------------- /src/promptflow/tests/executor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/executor/__init__.py -------------------------------------------------------------------------------- /src/promptflow/tests/executor/e2etests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/executor/e2etests/__init__.py -------------------------------------------------------------------------------- /src/promptflow/tests/executor/package_tools/custom_llm_tool/inputs.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/promptflow/tests/executor/package_tools/custom_llm_tool/my_prompt.jinja2: -------------------------------------------------------------------------------- 1 | {# Please replace the template with your own prompt. #} 2 | Write a simple program that displays the greeting message: "{{text}}" when executed. 3 | -------------------------------------------------------------------------------- /src/promptflow/tests/executor/package_tools/custom_llm_tool/samples.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "text": "Hello" 4 | }, 5 | { 6 | "text": "Hello World!" 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /src/promptflow/tests/executor/package_tools/custom_llm_tool_with_duplicated_inputs/prompt_with_duplicated_inputs.jinja2: -------------------------------------------------------------------------------- 1 | {{api}} 2 | -------------------------------------------------------------------------------- /src/promptflow/tests/executor/package_tools/tool_with_connection/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: {} 2 | outputs: {} 3 | nodes: 4 | - name: tool_with_conn 5 | type: python 6 | source: 7 | type: package 8 | tool: tool_with_connection 9 | inputs: 10 | conn: test_conn 11 | -------------------------------------------------------------------------------- /src/promptflow/tests/executor/package_tools/tool_with_connection/package_tool_definition.json: -------------------------------------------------------------------------------- 1 | { 2 | "tool_with_connection": { 3 | "function": "tool_with_test_conn", 4 | "inputs": { 5 | "conn": {"type": ["TestConnection"]} 6 | }, 7 | "module": "tool_with_connection", 8 | "name": "Test Tool with Connection", 9 | "type": "python" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/promptflow/tests/executor/package_tools/tool_with_init_error.py: -------------------------------------------------------------------------------- 1 | from promptflow import ToolProvider, tool 2 | 3 | 4 | class TestLoadErrorTool(ToolProvider): 5 | def __init__(self): 6 | raise Exception("Tool load error.") 7 | 8 | @tool 9 | def tool(self, name: str): 10 | return name 11 | -------------------------------------------------------------------------------- /src/promptflow/tests/executor/package_tools/tool_with_init_error/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: {} 2 | outputs: {} 3 | nodes: 4 | - name: tool_with_init_error 5 | type: python 6 | source: 7 | type: package 8 | tool: tool_with_init_error 9 | inputs: 10 | name: test_name 11 | -------------------------------------------------------------------------------- /src/promptflow/tests/executor/package_tools/tool_with_init_error/package_tool_definition.json: -------------------------------------------------------------------------------- 1 | { 2 | "tool_with_init_error": { 3 | "class_name": "TestLoadErrorTool", 4 | "function": "tool", 5 | "inputs": { 6 | "name": {"type": ["string"]} 7 | }, 8 | "module": "tool_with_init_error", 9 | "name": "Tool with init error", 10 | "type": "python" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/promptflow/tests/executor/unittests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/executor/unittests/__init__.py -------------------------------------------------------------------------------- /src/promptflow/tests/executor/unittests/_core/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/executor/unittests/_core/__init__.py -------------------------------------------------------------------------------- /src/promptflow/tests/executor/unittests/_utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/executor/unittests/_utils/__init__.py -------------------------------------------------------------------------------- /src/promptflow/tests/executor/unittests/contracts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/executor/unittests/contracts/__init__.py -------------------------------------------------------------------------------- /src/promptflow/tests/executor/unittests/executor/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/executor/unittests/executor/__init__.py -------------------------------------------------------------------------------- /src/promptflow/tests/executor/unittests/processpool/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/executor/unittests/processpool/__init__.py -------------------------------------------------------------------------------- /src/promptflow/tests/executor/unittests/storage/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/executor/unittests/storage/__init__.py -------------------------------------------------------------------------------- /src/promptflow/tests/sdk_cli_azure_test/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | -------------------------------------------------------------------------------- /src/promptflow/tests/sdk_cli_azure_test/e2etests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/sdk_cli_azure_test/e2etests/__init__.py -------------------------------------------------------------------------------- /src/promptflow/tests/sdk_cli_azure_test/e2etests/classificationAccuracy.csv: -------------------------------------------------------------------------------- 1 | groundtruth,prediction 2 | App,App 3 | App,App 4 | App,App 5 | App,App 6 | App,App 7 | App,App 8 | App,App 9 | -------------------------------------------------------------------------------- /src/promptflow/tests/sdk_cli_azure_test/unittests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/sdk_cli_azure_test/unittests/__init__.py -------------------------------------------------------------------------------- /src/promptflow/tests/sdk_cli_global_config_test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/sdk_cli_global_config_test/__init__.py -------------------------------------------------------------------------------- /src/promptflow/tests/sdk_cli_global_config_test/e2etests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/sdk_cli_global_config_test/e2etests/__init__.py -------------------------------------------------------------------------------- /src/promptflow/tests/sdk_cli_test/.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | source = 3 | */promptflow/_cli/* 4 | */promptflow/_sdk/* 5 | */promptflow/azure/* 6 | omit = 7 | */promptflow/azure/_restclient/* 8 | *__init__.py* 9 | -------------------------------------------------------------------------------- /src/promptflow/tests/sdk_cli_test/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/sdk_cli_test/__init__.py -------------------------------------------------------------------------------- /src/promptflow/tests/sdk_cli_test/e2etests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/sdk_cli_test/e2etests/__init__.py -------------------------------------------------------------------------------- /src/promptflow/tests/sdk_cli_test/unittests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/sdk_cli_test/unittests/__init__.py -------------------------------------------------------------------------------- /src/promptflow/tests/sdk_pfs_test/.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | source = 3 | */promptflow/_sdk/_service/* 4 | omit = 5 | */promptflow/_cli/* 6 | */promptflow/azure/* 7 | */promptflow/entities/* 8 | */promptflow/operations/* 9 | *__init__.py* 10 | -------------------------------------------------------------------------------- /src/promptflow/tests/sdk_pfs_test/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | -------------------------------------------------------------------------------- /src/promptflow/tests/sdk_pfs_test/e2etests/__init__.py: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------- 2 | # Copyright (c) Microsoft Corporation. All rights reserved. 3 | # --------------------------------------------------------- 4 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/configs/.azureml/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "subscription_id": "sub_default", 3 | "resource_group": "rg_default", 4 | "workspace_name": "ws_default" 5 | } -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/configs/mock_flow1/.azureml/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "subscription_id": "sub1", 3 | "resource_group": "rg1", 4 | "workspace_name": "ws1" 5 | } -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/connections/.env: -------------------------------------------------------------------------------- 1 | aaa=bbb 2 | ccc=ddd 3 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/connections/azure_content_safety_connection.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/AzureContentSafetyConnection.schema.json 2 | name: my_azure_content_safety_connection 3 | type: azure_content_safety # snake case 4 | api_key: "" 5 | endpoint: "endpoint" 6 | api_version: "2023-04-30-preview" 7 | api_type: Content Safety 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/connections/azure_openai_connection.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/AzureOpenAIConnection.schema.json 2 | name: my_azure_open_ai_connection 3 | type: azure_open_ai # snake case 4 | api_key: "" 5 | api_base: "aoai-api-endpoint" 6 | api_type: "azure" 7 | api_version: "2023-07-01-preview" 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/connections/cognitive_search_connection.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/CognitiveSearchConnection.schema.json 2 | name: my_cognitive_search_connection 3 | type: cognitive_search # snake case 4 | api_key: "" 5 | api_base: "endpoint" 6 | api_version: "2023-07-01-Preview" 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/connections/custom_connection.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/CustomConnection.schema.json 2 | name: my_custom_connection 3 | type: custom 4 | configs: 5 | key1: "test1" 6 | secrets: # must-have 7 | key2: "test2" 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/connections/custom_strong_type_connection.yaml: -------------------------------------------------------------------------------- 1 | name: my_custom_strong_type_connection 2 | type: custom 3 | custom_type: MyFirstConnection 4 | module: my_tool_package.connections 5 | package: test-custom-tools 6 | package_version: 0.0.2 7 | configs: 8 | api_base: "This is my first connection." 9 | secrets: # must-have 10 | api_key: "" -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/connections/empty.env: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/test_configs/connections/empty.env -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/connections/form_recognizer_connection.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/FormRecognizerConnection.schema.json 2 | name: my_form_recognizer_connection 3 | type: form_recognizer 4 | api_key: "" 5 | endpoint: "endpoint" 6 | api_version: "2023-07-31" 7 | api_type: Form Recognizer 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/connections/openai_connection.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/OpenAIConnection.schema.json 2 | name: my_open_ai_connection 3 | type: open_ai 4 | api_key: "" 5 | organization: "org" 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/connections/qdrant_connection.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/QdrantConnection.schema.json 2 | name: my_qdrant_connection 3 | type: qdrant 4 | api_key: "" 5 | api_base: "endpoint" 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/connections/serp_connection.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/SerpConnection.schema.json 2 | name: my_serp_connection 3 | type: serp 4 | api_key: "" 5 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/connections/update_azure_openai_connection.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/AzureOpenAIConnection.schema.json 2 | name: my_azure_open_ai_connection 3 | type: azure_open_ai # snake case 4 | api_key: "******" # Use the scrub value to test key2 not being updated 5 | api_base: "new_value" 6 | api_type: "azure" 7 | api_version: "2023-07-01-preview" 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/connections/update_custom_connection.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/CustomConnection.schema.json 2 | name: my_custom_connection 3 | type: custom 4 | configs: 5 | key1: "new_value" 6 | secrets: # must-have 7 | key2: "******" # Use the scrub value to test key2 not being updated 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/connections/update_custom_strong_type_connection.yaml: -------------------------------------------------------------------------------- 1 | name: my_custom_strong_type_connection 2 | type: custom 3 | custom_type: MyFirstConnection 4 | module: my_tool_package.connections 5 | package: test-custom-tools 6 | package_version: 0.0.2 7 | configs: 8 | api_base: "new_value" 9 | secrets: # must-have 10 | api_key: "******" -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/connections/weaviate_connection.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/promptflow/latest/WeaviateConnection.schema.json 2 | name: my_weaviate_connection 3 | type: weaviate 4 | api_key: "" 5 | api_base: "endpoint" 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/datas/classificationAccuracy.csv: -------------------------------------------------------------------------------- 1 | line_number,variant_id,groundtruth,prediction 2 | 0,variant_0,App,App 3 | 0,variant_0,App,App 4 | 0,variant_0,App,App 5 | 0,variant_0,App,App 6 | 0,variant_0,App,App 7 | 0,variant_0,App,App 8 | 0,variant_0,App,App 9 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/datas/env_var_names.jsonl: -------------------------------------------------------------------------------- 1 | {"key": "API_BASE"} 2 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/datas/load_data_cases/colors.csv: -------------------------------------------------------------------------------- 1 | name,id_text,id_int,id_float 2 | Red,"1.0",1,1.0 3 | Blue,"3.0",3,3.0 4 | Yellow,"2.0",3,2.0 -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/datas/load_data_cases/colors.jsonl: -------------------------------------------------------------------------------- 1 | {"name": "Red", "id_text": "1.0", "id_int": 1, "id_float": 1.0 } 2 | {"name": "Blue", "id_text": "3.0", "id_int": 3, "id_float": 3.0 } 3 | {"name": "Yellow", "id_text": "2.0", "id_int": 2, "id_float": 2.0 } -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/datas/load_data_cases/colors.parquet: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/test_configs/datas/load_data_cases/colors.parquet -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/datas/load_data_cases/colors.tsv: -------------------------------------------------------------------------------- 1 | name id_text id_int id_float 2 | 0 Red 1.0 1 1.0 3 | 1 Blue 3.0 3 3.0 4 | 2 Yellow 2.0 2 2.0 5 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/datas/webClassification1.jsonl: -------------------------------------------------------------------------------- 1 | {"url": "https://www.youtube.com/watch?v=o5ZQyXaAv1g", "answer": "Channel", "evidence": "Url", "variant_id": "fake_variant1"} 2 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/datas/webClassification3.jsonl: -------------------------------------------------------------------------------- 1 | {"url": "https://www.youtube.com/watch?v=o5ZQyXaAv1g", "answer": "Channel", "evidence": "Url", "variant_id": "fake_variant1"} 2 | {"url": "https://www.youtube.com/watch?v=o5ZQyXaAv1g", "answer": "Channel", "evidence": "Url", "variant_id": "fake_variant1"} 3 | {"url": "https://www.youtube.com/watch?v=o5ZQyXaAv1g", "answer": "Channel", "evidence": "Url", "variant_id": "fake_variant1"} -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/activate_with_no_inputs/expected_result.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "expected_node_count": 2, 4 | "expected_outputs":{ 5 | "text": "hello world" 6 | }, 7 | "expected_bypassed_nodes":[] 8 | } 9 | ] -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/activate_with_no_inputs/inputs.json: -------------------------------------------------------------------------------- 1 | { 2 | "text": "world" 3 | } -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/activate_with_no_inputs/node_a.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def my_python_tool(input1: str) -> str: 6 | return 'hello ' + input1 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/activate_with_no_inputs/node_b.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def my_python_tool(): 6 | print("Avtivate") 7 | return 'Executing...' 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/basic-with-connection/data.jsonl: -------------------------------------------------------------------------------- 1 | {"text": "Hello World!"} 2 | {"text": "Hello PromptFlow!"} 3 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/basic-with-connection/hello.jinja2: -------------------------------------------------------------------------------- 1 | {# Please replace the template with your own prompt. #} 2 | Write a simple {{text}} program that displays the greeting message when executed. 3 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/basic-with-connection/inputs.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/basic-with-connection/samples.json: -------------------------------------------------------------------------------- 1 | [{"text": "Hello World!"}] 2 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/basic_with_builtin_llm_node/hello.jinja2: -------------------------------------------------------------------------------- 1 | system: 2 | You are a assistant which can write code. Response should only contain code. 3 | 4 | user: 5 | Write a simple {{text}} program that displays the greeting message when executed. -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/chat_flow/chat.jinja2: -------------------------------------------------------------------------------- 1 | system: 2 | You are a helpful assistant. 3 | 4 | {% for item in chat_history %} 5 | user: 6 | {{item.inputs.question}} 7 | assistant: 8 | {{item.outputs.answer}} 9 | {% endfor %} 10 | 11 | user: 12 | {{question}} -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/chat_flow/show_answer.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def show_answer(chat_answer: str): 6 | print("print:", chat_answer) 7 | return chat_answer 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/chat_flow_with_default_history/chat.jinja2: -------------------------------------------------------------------------------- 1 | system: 2 | You are a helpful assistant. 3 | 4 | {% for item in chat_history %} 5 | user: 6 | {{item.inputs.question}} 7 | assistant: 8 | {{item.outputs.answer}} 9 | {% endfor %} 10 | 11 | user: 12 | {{question}} -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/chat_flow_with_defined_chat_history/chat.jinja2: -------------------------------------------------------------------------------- 1 | system: 2 | You are a helpful assistant. 3 | 4 | {% for item in chat_history %} 5 | user: 6 | {{item.inputs.question}} 7 | assistant: 8 | {{item.outputs.answer}} 9 | {% endfor %} 10 | 11 | user: 12 | {{question}} -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/chat_flow_with_defined_chat_history/show_answer.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def show_answer(chat_answer: str): 6 | print("print:", chat_answer) 7 | return chat_answer 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/chat_flow_with_exception/chat.jinja2: -------------------------------------------------------------------------------- 1 | system: 2 | You are a helpful assistant. 3 | 4 | {% for item in chat_history %} 5 | user: 6 | {{item.inputs.question}} 7 | assistant: 8 | {{item.outputs.answer}} 9 | {% endfor %} 10 | 11 | user: 12 | {{question}} -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/chat_flow_with_exception/show_answer.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def show_answer(chat_answer: str): 6 | raise Exception("mock exception") 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/chat_flow_with_multi_output/chat.jinja2: -------------------------------------------------------------------------------- 1 | system: 2 | You are a helpful assistant. 3 | 4 | {% for item in chat_history %} 5 | user: 6 | {{item.inputs.question}} 7 | assistant: 8 | {{item.outputs.answer}} 9 | {% endfor %} 10 | 11 | user: 12 | {{question}} -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/chat_flow_with_python_node_streaming_output/stream.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | from typing import Generator 3 | 4 | 5 | def stream(question: str) -> Generator[str, None, None]: 6 | for word in question: 7 | yield word 8 | 9 | 10 | @tool 11 | def my_python_tool(chat_history: list[dict], question: str) -> dict: 12 | return {"answer": stream(question)} 13 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/chat_flow_with_stream_output/chat.jinja2: -------------------------------------------------------------------------------- 1 | system: 2 | You are a helpful assistant. 3 | 4 | {% for item in chat_history %} 5 | user: 6 | {{item.inputs.question}} 7 | assistant: 8 | {{item.outputs.answer}} 9 | {% endfor %} 10 | 11 | user: 12 | {{question}} -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/chat_flow_without_defined_chat_history/chat.jinja2: -------------------------------------------------------------------------------- 1 | system: 2 | You are a helpful assistant. 3 | 4 | {% for item in chat_history %} 5 | user: 6 | {{item.inputs.question}} 7 | assistant: 8 | {{item.outputs.answer}} 9 | {% endfor %} 10 | 11 | user: 12 | {{question}} -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/chat_flow_without_defined_chat_history/show_answer.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def show_answer(chat_answer: str): 6 | print("print:", chat_answer) 7 | return chat_answer 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/classification_accuracy_evaluation/expected_metrics.json: -------------------------------------------------------------------------------- 1 | {"accuracy": 0.67} -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/classification_accuracy_evaluation/expected_status_summary.json: -------------------------------------------------------------------------------- 1 | { 2 | "__pf__.nodes.grade.completed": 3, 3 | "__pf__.nodes.calculate_accuracy.completed": 1, 4 | "__pf__.lines.completed": 3, 5 | "__pf__.lines.failed": 0 6 | } -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/classification_accuracy_evaluation/grade.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def grade(groundtruth: str, prediction: str): 6 | groundtruth = groundtruth.lower().strip('"') 7 | prediction = prediction.lower().strip('"') 8 | return "Correct" if groundtruth == prediction else "Incorrect" 9 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/concurrent_execution_flow/inputs.json: -------------------------------------------------------------------------------- 1 | { 2 | "input1": "False", 3 | "input2": "False", 4 | "input3": "False", 5 | "input4": "False" 6 | } -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/concurrent_execution_flow/wait_long.py: -------------------------------------------------------------------------------- 1 | from time import sleep 2 | from promptflow import tool 3 | 4 | 5 | @tool 6 | def wait(**args) -> int: 7 | sleep(5) 8 | return str(args) 9 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/concurrent_execution_flow/wait_short.py: -------------------------------------------------------------------------------- 1 | import threading 2 | from time import sleep 3 | from promptflow import tool 4 | 5 | 6 | @tool 7 | def wait(**kwargs) -> int: 8 | if kwargs["throw_exception"]: 9 | raise Exception("test exception") 10 | for i in range(10): 11 | print(f"Thread {threading.get_ident()} write test log number {i}") 12 | sleep(2) 13 | return 0 14 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/conditional_chat_flow_with_skip/conditional_node.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def conditional_node(message: str): 6 | return message + "\nExecute the conditional_node" 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/conditional_chat_flow_with_skip/inputs.json: -------------------------------------------------------------------------------- 1 | { 2 | "number": 10 3 | } 4 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/conditional_chat_flow_with_skip/is_even.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def is_even(number: int): 6 | if number % 2 == 0: 7 | return {"is_even": True, "message": f"{number} is even number, skip the next node"} 8 | return {"is_even": False, "message": f"{number} is odd number, go to the next node"} 9 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/conditional_chat_flow_with_skip/print_result.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def print_result(message: str): 6 | return "Result: " + message 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/conditional_flow_with_activate/icm_retriever.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def icm_retriever(content: str) -> str: 6 | return "ICM: " + content -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/conditional_flow_with_activate/incident_info_extractor.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def extract_incident_info(incident: dict) -> str: 6 | retriever_type = ["icm", "tsg", "kql"] 7 | return { 8 | "retriever": retriever_type[incident["incident_id"]], 9 | "incident_content": incident["incident_content"] 10 | } -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/conditional_flow_with_activate/investigation_method.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def choose_investigation_method(method1="Skip job info extractor", method2="Skip incident info extractor"): 6 | method = {} 7 | if method1: 8 | method["first"] = method1 9 | if method2: 10 | method["second"] = method2 11 | return method 12 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/conditional_flow_with_activate/investigation_steps.jinja2: -------------------------------------------------------------------------------- 1 | system: 2 | You are a helpful assistant. 3 | user: 4 | When an incident occurs, there have 3 ways to deal with it, please choose one. 5 | 1. {{first_method}} 6 | 2. {{second_method}} 7 | 3. {{third_method}} -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/conditional_flow_with_activate/job_info_extractor.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def extract_job_info(incident_content: str) -> str: 6 | print(f"Incident: {incident_content}") 7 | return "Execute job info extractor" 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/conditional_flow_with_activate/kql_tsg_retriever.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def kql_retriever(content: str) -> str: 6 | return "KQL: " + content -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/conditional_flow_with_activate/retriever_summary.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def retriever_summary(summary) -> str: 6 | print(f"Summary: {summary}") 7 | return "Execute incident info extractor" 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/conditional_flow_with_activate/tsg_retriever.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def tsg_retriever(content: str) -> str: 6 | return "TSG: " + content -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/conditional_flow_with_skip/conditional_node.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def conditional_node(message: str): 6 | return message + "\nExecute the conditional_node" 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/conditional_flow_with_skip/inputs.json: -------------------------------------------------------------------------------- 1 | { 2 | "number": 10 3 | } 4 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/conditional_flow_with_skip/is_even.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def is_even(number: int): 6 | if number % 2 == 0: 7 | return {"is_even": True, "message": f"{number} is even number, skip the next node"} 8 | return {"is_even": False, "message": f"{number} is odd number, go to the next node"} 9 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/conditional_flow_with_skip/print_result.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def print_result(message: str): 6 | return "Result: " + message 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/connection_as_input/conn_tool.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | from promptflow.connections import AzureOpenAIConnection 3 | 4 | 5 | @tool 6 | def conn_tool(conn: AzureOpenAIConnection): 7 | assert isinstance(conn, AzureOpenAIConnection) 8 | return conn.api_base -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/connection_as_input/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: {} 2 | outputs: 3 | output: 4 | type: string 5 | reference: ${conn_node.output} 6 | nodes: 7 | - name: conn_node 8 | type: python 9 | source: 10 | type: code 11 | path: conn_tool.py 12 | inputs: 13 | conn: azure_open_ai_connection 14 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/custom_connection_flow/.promptflow/flow.tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "package": {}, 3 | "code": { 4 | "print_env.py": { 5 | "type": "python", 6 | "inputs": { 7 | "key": { 8 | "type": [ 9 | "string" 10 | ] 11 | } 12 | }, 13 | "function": "get_env_var" 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/custom_connection_flow/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | key: 3 | type: string 4 | outputs: 5 | output: 6 | type: string 7 | reference: ${print_env.output.value} 8 | nodes: 9 | - name: print_env 10 | type: python 11 | source: 12 | type: code 13 | path: print_env.py 14 | inputs: 15 | key: ${inputs.key} 16 | connection: custom_connection 17 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/custom_connection_flow/print_env.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from promptflow import tool 4 | from promptflow.connections import CustomConnection 5 | 6 | 7 | @tool 8 | def get_env_var(key: str, connection: CustomConnection): 9 | # get from env var 10 | return {"value": os.environ.get(key)} 11 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/custom_strong_type_connection_basic_flow/data.jsonl: -------------------------------------------------------------------------------- 1 | {"text": "Hello World!"} 2 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/default_input/test_print_aggregation.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | from promptflow import tool 3 | 4 | @tool 5 | def test_print_input(inputs: List[str]): 6 | print(inputs) 7 | return inputs -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/default_input/test_print_input.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def test_print_input(input: str): 6 | print(input) 7 | return input -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/export/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | encrption_key.txt 3 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/export/linux/flow/.amlignore: -------------------------------------------------------------------------------- 1 | *.ipynb 2 | .venv/ 3 | .data/ 4 | .env 5 | .vscode/ 6 | outputs/ 7 | connection.json 8 | .gitignore 9 | README.md 10 | eval_cli.md 11 | data/ 12 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/export/linux/flow/requirements_txt: -------------------------------------------------------------------------------- 1 | keyrings.alt 2 | promptflow-tools 3 | promptflow 4 | langchain 5 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/export/linux/flow/setup.sh: -------------------------------------------------------------------------------- 1 | echo Hello Promptflow! 2 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/export/linux/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "CUSTOM_CONNECTION_AZURE_OPENAI_API_KEY": "" 3 | } -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/external_files/convert_to_dict.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | from promptflow import tool 4 | 5 | 6 | @tool 7 | def convert_to_dict(input_str: str): 8 | try: 9 | return json.loads(input_str) 10 | except Exception as e: 11 | print("input is not valid, error: {}".format(e)) 12 | return {"category": "None", "evidence": "None"} 13 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/external_files/summarize_text_content.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize the following text in one paragraph. 100 words. 2 | Do not add any information that is not in the text. 3 | Text: {{text}} 4 | Summary: 5 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/failed_flow/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | text: 3 | type: string 4 | outputs: 5 | output_prompt: 6 | type: string 7 | reference: ${echo_my_prompt.output} 8 | nodes: 9 | - inputs: 10 | text: ${inputs.text} 11 | name: echo_my_prompt 12 | type: python 13 | source: 14 | type: code 15 | path: hello.py 16 | node_variants: {} 17 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_dict_input/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | key: 3 | type: object 4 | outputs: 5 | output: 6 | type: string 7 | reference: ${print_val.output.value} 8 | nodes: 9 | - name: print_val 10 | type: python 11 | source: 12 | type: code 13 | path: print_val.py 14 | inputs: 15 | key: ${inputs.key} 16 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_dict_input/print_val.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def get_val(key): 6 | # get from env var 7 | print(key) 8 | if not isinstance(key, dict): 9 | raise TypeError(f"key must be a dict, got {type(key)}") 10 | return {"value": f"{key}: {type(key)}"} 11 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_dict_input_with_variant/print_val.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | from promptflow.connections import CustomConnection 3 | 4 | 5 | @tool 6 | def get_val(key, conn: CustomConnection): 7 | # get from env var 8 | print(key) 9 | if not isinstance(key, dict): 10 | raise TypeError(f"key must be a dict, got {type(key)}") 11 | return {"value": f"{key}: {type(key)}"} 12 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_environment/.promptflow/flow.tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "package": {}, 3 | "code": { 4 | "print_env.py": { 5 | "type": "python", 6 | "inputs": { 7 | "key": { 8 | "type": [ 9 | "string" 10 | ] 11 | } 12 | }, 13 | "function": "get_env_var" 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_environment/print_env.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from promptflow import tool 4 | 5 | 6 | @tool 7 | def get_env_var(key: str): 8 | print(os.environ.get(key)) 9 | # get from env var 10 | return {"value": os.environ.get(key)} 11 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_environment/requirements: -------------------------------------------------------------------------------- 1 | # Add your python packages here 2 | a 3 | b 4 | c -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_invalid_import/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | text: 3 | type: string 4 | outputs: 5 | output_prompt: 6 | type: string 7 | reference: ${echo_my_prompt.output} 8 | nodes: 9 | - inputs: 10 | text: ${inputs.text} 11 | name: echo_my_prompt 12 | type: python 13 | source: 14 | type: code 15 | path: hello.py 16 | node_variants: {} 17 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_invalid_import/hello.py: -------------------------------------------------------------------------------- 1 | import package_not_exist 2 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_langchain_traces/code_first_input.csv: -------------------------------------------------------------------------------- 1 | question 2 | What is 2 to the 10th power? 3 | What is the sum of 2 and 2? 4 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_langchain_traces/data_inputs.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": "code_first_input.csv" 3 | } -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_langchain_traces/samples.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "question": "What is 2 to the 10th power?" 4 | }, 5 | { 6 | "question": "What is the sum of 2 and 2?" 7 | } 8 | ] -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_list_input/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | key: 3 | type: list 4 | outputs: 5 | output: 6 | type: string 7 | reference: ${print_val.output.value} 8 | nodes: 9 | - name: print_val 10 | type: python 11 | source: 12 | type: code 13 | path: print_val.py 14 | inputs: 15 | key: ${inputs.key} 16 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_list_input/print_val.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from promptflow import tool 4 | 5 | 6 | @tool 7 | def get_val(key): 8 | # get from env var 9 | print(key) 10 | return {"value": f"{key}: {type(key)}"} 11 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_non_english_input/data.jsonl: -------------------------------------------------------------------------------- 1 | {"text": "Hello 123 日本語"} 2 | {"text": "World 123 日本語"} 3 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_non_english_input/hello.jinja2: -------------------------------------------------------------------------------- 1 | {{text}} -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_sys_inject/custom_lib/foo.py: -------------------------------------------------------------------------------- 1 | def foo(param: str) -> str: 2 | return f"{param} from func foo" 3 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_sys_inject/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | text: 3 | type: string 4 | outputs: 5 | output_prompt: 6 | type: string 7 | reference: ${echo_my_prompt.output} 8 | nodes: 9 | - inputs: 10 | input1: ${inputs.text} 11 | name: echo_my_prompt 12 | type: python 13 | source: 14 | type: code 15 | path: hello.py 16 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_sys_inject/hello.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | from promptflow import tool 5 | 6 | sys.path.append(f"{os.path.dirname(__file__)}/custom_lib") 7 | from custom_lib.foo import foo 8 | 9 | 10 | @tool 11 | def my_python_tool(input1: str) -> str: 12 | return foo(param=input1) 13 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_user_output/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | key: 3 | type: object 4 | outputs: 5 | output: 6 | type: string 7 | reference: ${print_val.output.value} 8 | nodes: 9 | - name: print_val 10 | type: python 11 | source: 12 | type: code 13 | path: print_val.py 14 | inputs: 15 | key: ${inputs.key} 16 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/flow_with_user_output/print_val.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | from promptflow import tool 4 | 5 | 6 | @tool 7 | def get_val(key): 8 | # get from env var 9 | print(key) 10 | print("user log") 11 | print("error log", file=sys.stderr) -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/generator_tools/char_generator.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | @tool 4 | def character_generator(text: str): 5 | """Generate characters from a string.""" 6 | 7 | for char in text: 8 | yield char -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/generator_tools/echo.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | from char_generator import character_generator 3 | 4 | @tool 5 | def echo(text): 6 | """Echo the input string.""" 7 | 8 | echo_text = "Echo - " + "".join(character_generator(text)) 9 | return echo_text -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/generator_tools/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | text: 3 | type: string 4 | outputs: 5 | answer: 6 | type: string 7 | reference: ${echo.output} 8 | nodes: 9 | - name: echo 10 | type: python 11 | source: 12 | type: code 13 | path: echo.py 14 | inputs: 15 | text: ${inputs.text} 16 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/intent-copilot/.amlignore: -------------------------------------------------------------------------------- 1 | *.ipynb 2 | .venv/ 3 | .data/ 4 | .env 5 | .vscode/ 6 | outputs/ 7 | connection.json 8 | .gitignore 9 | README.md 10 | eval_cli.md 11 | data/ 12 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/intent-copilot/.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | __pycache__/ 3 | .promptflow/* 4 | !.promptflow/flow.tools.json 5 | .runs/ 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/intent-copilot/requirements_txt: -------------------------------------------------------------------------------- 1 | keyrings.alt 2 | promptflow-tools 3 | promptflow 4 | langchain 5 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/intent-copilot/setup.sh: -------------------------------------------------------------------------------- 1 | echo Hello Promptflow! 2 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/llm_tool_with_duplicated_inputs/prompt_with_duplicated_inputs.jinja2: -------------------------------------------------------------------------------- 1 | {{prompt}} -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/long_run/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: {} 2 | outputs: 3 | output: 4 | type: string 5 | reference: ${long_run_node.output} 6 | nodes: 7 | - name: long_run_node 8 | type: python 9 | inputs: {} 10 | source: 11 | type: code 12 | path: long_run.py 13 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/long_run/long_run.py: -------------------------------------------------------------------------------- 1 | import time 2 | from promptflow import tool 3 | 4 | 5 | def f1(): 6 | time.sleep(61) 7 | return 0 8 | 9 | 10 | def f2(): 11 | return f1() 12 | 13 | 14 | @tool 15 | def long_run_func(): 16 | return f2() 17 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/meta_files/flow.meta.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/latest/flow.schema.json 2 | name: web_classificiation_flow_3 3 | display_name: Web Classification 4 | type: standard 5 | description: Create flows that use large language models to classify URLs into multiple categories. 6 | path: ./flow.dag.yaml 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/meta_files/remote_fs.meta.yaml: -------------------------------------------------------------------------------- 1 | $schema: https://azuremlschemas.azureedge.net/latest/flow.schema.json 2 | name: classification_accuracy_eval 3 | type: evaluate 4 | path: azureml://datastores/workspaceworkingdirectory/paths/Users/wanhan/my_flow_snapshot/flow.dag.yaml 5 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/meta_files/samples.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "line_number": 0, 4 | "variant_id": "variant_0", 5 | "groundtruth": "App", 6 | "prediction": "App" 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/no_inputs_outputs/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | outputs: 2 | nodes: 3 | - name: say_hello 4 | type: python 5 | source: 6 | type: code 7 | path: say_hello.py 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/no_inputs_outputs/say_hello.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def stringify_num(): 6 | print("hello world") 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/one_line_of_bulktest_timeout/expected_status_summary.json: -------------------------------------------------------------------------------- 1 | { 2 | "__pf__.nodes.my_python_tool.completed": 3, 3 | "__pf__.nodes.my_python_tool_with_failed_line.completed": 2, 4 | "__pf__.nodes.my_python_tool_with_failed_line.failed": 1, 5 | "__pf__.lines.completed": 2, 6 | "__pf__.lines.failed": 1 7 | } -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/one_line_of_bulktest_timeout/my_python_tool.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | import random 3 | 4 | 5 | @tool 6 | def my_python_tool(idx: int) -> int: 7 | return idx -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/one_line_of_bulktest_timeout/my_python_tool_with_failed_line.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | import random 3 | import time 4 | 5 | 6 | @tool 7 | def my_python_tool_with_failed_line(idx: int, mod=5) -> int: 8 | if idx % mod == 0: 9 | while True: 10 | time.sleep(60) 11 | return idx 12 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/one_line_of_bulktest_timeout/samples.json: -------------------------------------------------------------------------------- 1 | [{"idx": 1}, {"idx": 4}, {"idx": 10}] -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/openai_chat_api_flow/samples.json: -------------------------------------------------------------------------------- 1 | { 2 | "question": "What is the capital of the United States of America?", 3 | "chat_history": [] 4 | } 5 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/openai_completion_api_flow/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | prompt: 3 | type: string 4 | outputs: 5 | output: 6 | type: string 7 | reference: ${completion.output} 8 | nodes: 9 | - name: completion 10 | type: python 11 | source: 12 | type: code 13 | path: completion.py 14 | inputs: 15 | prompt: ${inputs.prompt} 16 | connection: azure_open_ai_connection 17 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/openai_completion_api_flow/samples.json: -------------------------------------------------------------------------------- 1 | { 2 | "prompt": "What is the capital of the United States of America?" 3 | } 4 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/partial_fail/data.jsonl: -------------------------------------------------------------------------------- 1 | {"key": "no"} 2 | {"key": "raise"} 3 | {"key": "matter"} 4 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/partial_fail/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | key: 3 | type: string 4 | outputs: 5 | output: 6 | type: string 7 | reference: ${print_env.output.value} 8 | nodes: 9 | - name: print_env 10 | type: python 11 | source: 12 | type: code 13 | path: print_env.py 14 | inputs: 15 | key: ${inputs.key} 16 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/partial_fail/print_env.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from promptflow import tool 4 | 5 | 6 | @tool 7 | def get_env_var(key: str): 8 | if key == "raise": 9 | raise Exception("expected raise!") 10 | 11 | print(os.environ.get(key)) 12 | # get from env var 13 | return {"value": os.environ.get(key)} 14 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/print_env_var/.promptflow/flow.tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "package": {}, 3 | "code": { 4 | "print_env.py": { 5 | "type": "python", 6 | "inputs": { 7 | "key": { 8 | "type": [ 9 | "string" 10 | ] 11 | } 12 | }, 13 | "function": "get_env_var" 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/print_env_var/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | key: 3 | type: string 4 | outputs: 5 | output: 6 | type: string 7 | reference: ${print_env.output.value} 8 | nodes: 9 | - name: print_env 10 | type: python 11 | source: 12 | type: code 13 | path: print_env.py 14 | inputs: 15 | key: ${inputs.key} 16 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/print_env_var/print_env.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from promptflow import tool 4 | 5 | 6 | @tool 7 | def get_env_var(key: str): 8 | print(os.environ.get(key)) 9 | # get from env var 10 | return {"value": os.environ.get(key)} 11 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/print_input_flow/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | text: 3 | type: string 4 | outputs: 5 | output_text: 6 | type: string 7 | reference: ${print_input.output} 8 | nodes: 9 | - name: print_input 10 | type: python 11 | source: 12 | type: code 13 | path: print_input.py 14 | inputs: 15 | text: ${inputs.text} 16 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/print_input_flow/print_input.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | import sys 3 | 4 | 5 | @tool 6 | def print_inputs( 7 | text: str = None, 8 | ): 9 | print(f"STDOUT: {text}") 10 | print(f"STDERR: {text}", file=sys.stderr) 11 | return text 12 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/prompt_tool_with_duplicated_inputs/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | text: 3 | type: string 4 | outputs: 5 | output_prompt: 6 | type: string 7 | reference: ${prompt_tool_with_duplicated_inputs.output} 8 | nodes: 9 | - name: prompt_tool_with_duplicated_inputs 10 | type: prompt 11 | source: 12 | type: code 13 | path: prompt_with_duplicated_inputs.jinja2 14 | inputs: 15 | text: ${inputs.text} -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/prompt_tool_with_duplicated_inputs/prompt_with_duplicated_inputs.jinja2: -------------------------------------------------------------------------------- 1 | {{template}} -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/prompt_tools/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | text: 3 | type: string 4 | outputs: 5 | output_prompt: 6 | type: string 7 | reference: ${summarize_text_content_prompt.output} 8 | nodes: 9 | - name: summarize_text_content_prompt 10 | type: prompt 11 | source: 12 | type: code 13 | path: summarize_text_content_prompt.jinja2 14 | inputs: 15 | text: ${inputs.text} -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/prompt_tools/summarize_text_content_prompt.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize the following text in one paragraph. 50 words. 2 | 3 | Do not add any information that is not in the text. 4 | 5 | Text: {{text}} 6 | 7 | Summary: -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/prompt_tools/summarize_text_content_prompt.meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "summarize_text_content_prompt", 3 | "type": "prompt", 4 | "inputs": { 5 | "text": { 6 | "type": [ 7 | "string" 8 | ] 9 | } 10 | }, 11 | "source": "summarize_text_content_prompt.jinja2" 12 | } -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/python_stream_tools/echo_input.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | @tool 4 | def my_python_tool(input: str) -> str: 5 | yield "Echo: " 6 | for word in input.split(): 7 | yield word + " " -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/python_stream_tools/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | text: 3 | type: string 4 | outputs: 5 | output_echo: 6 | type: string 7 | reference: ${echo_my_input.output} 8 | nodes: 9 | - name: echo_my_input 10 | type: python 11 | source: 12 | type: code 13 | path: echo_input.py 14 | inputs: 15 | input: ${inputs.text} 16 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/python_stream_tools/inputs.json: -------------------------------------------------------------------------------- 1 | { 2 | "text": "Hello World!" 3 | } -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/python_tool_partial_failure/expected_status_summary.json: -------------------------------------------------------------------------------- 1 | { 2 | "__pf__.nodes.my_python_tool_with_failed_line_1.completed": 7, 3 | "__pf__.nodes.my_python_tool_with_failed_line_1.failed": 3, 4 | "__pf__.nodes.my_python_tool_with_failed_line_2.completed": 5, 5 | "__pf__.nodes.my_python_tool_with_failed_line_2.failed": 2, 6 | "__pf__.lines.completed": 5, 7 | "__pf__.lines.failed": 5 8 | } -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/python_tool_partial_failure/inputs_mapping.json: -------------------------------------------------------------------------------- 1 | { 2 | "idx": "${output.idx}", 3 | "mod": "${data.mod}", 4 | "mod_2": "${data.mod_2}" 5 | } 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/python_tool_partial_failure/my_python_tool_with_failed_line.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def my_python_tool_with_failed_line(idx: int, mod) -> int: 6 | if idx % mod == 0: 7 | raise Exception("Failed") 8 | return idx -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/python_tool_with_image_input_and_output/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | image: 3 | type: image 4 | default: logo.jpg 5 | outputs: 6 | output: 7 | type: image 8 | reference: ${python_node.output} 9 | nodes: 10 | - name: python_node 11 | type: python 12 | source: 13 | type: code 14 | path: python_with_image.py 15 | inputs: 16 | image: ${inputs.image} -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/python_tool_with_image_input_and_output/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/test_configs/flows/python_tool_with_image_input_and_output/logo.jpg -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/python_tool_with_image_input_and_output/python_with_image.py: -------------------------------------------------------------------------------- 1 | from promptflow.contracts.multimedia import Image 2 | from promptflow import tool 3 | 4 | 5 | @tool 6 | def python_with_image(image: Image) -> Image: 7 | return image 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/python_tool_with_multiple_image_nodes/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PB2204/promptflow/9ee54a900defc2df769c6e327f796f3a31d3ed9b/src/promptflow/tests/test_configs/flows/python_tool_with_multiple_image_nodes/logo.jpg -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/python_tool_with_multiple_image_nodes/python_with_image.py: -------------------------------------------------------------------------------- 1 | from promptflow.contracts.multimedia import Image 2 | from promptflow import tool 3 | 4 | 5 | @tool 6 | def python_with_image(image: Image) -> Image: 7 | return image 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/script_with___file__/folder/another-tool.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | print(f"The script is {__file__}") 5 | 6 | 7 | @tool 8 | def my_python_tool(input1: str) -> str: 9 | from pathlib import Path 10 | assert Path(__file__).as_posix().endswith("folder/another-tool.py") 11 | assert __name__ == "__pf_main__" 12 | return f"Prompt: {input1} {__file__}" 13 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/script_with___file__/script_with___file__.meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "script_with___file__", 3 | "type": "python", 4 | "inputs": { 5 | "input1": { 6 | "type": [ 7 | "string" 8 | ] 9 | } 10 | }, 11 | "source": "script_with___file__.py", 12 | "function": "my_python_tool" 13 | } -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/script_with_import/dummy_utils/main.meta.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "main", 3 | "type": "python", 4 | "inputs": { 5 | "x": { 6 | "type": [ 7 | "string" 8 | ] 9 | } 10 | }, 11 | "source": "dummy_utils/main.py", 12 | "function": "main" 13 | } -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/script_with_import/dummy_utils/main.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | from dummy_utils.util_tool import passthrough 3 | 4 | 5 | @tool 6 | def main(x: str): 7 | return passthrough(x) 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/script_with_import/dummy_utils/util_tool.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def passthrough(x: str): 6 | return x 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/script_with_import/fail.py: -------------------------------------------------------------------------------- 1 | from aaa import bbb # noqa: F401 -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/script_with_import/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | text: 3 | type: string 4 | outputs: 5 | output: 6 | type: string 7 | reference: ${node1.output} 8 | nodes: 9 | - name: node1 10 | type: python 11 | source: 12 | type: code 13 | path: dummy_utils/main.py 14 | inputs: 15 | x: ${inputs.text} 16 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/simple_aggregation/passthrough.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def passthrough(input: str): 6 | return input -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/simple_flow_with_python_tool/divide_num.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def divide_num(num: int) -> int: 6 | return (int)(num / 2) 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/simple_flow_with_python_tool/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | num: 3 | type: int 4 | outputs: 5 | content: 6 | type: string 7 | reference: ${divide_num.output} 8 | nodes: 9 | - name: divide_num 10 | type: python 11 | source: 12 | type: code 13 | path: divide_num.py 14 | inputs: 15 | num: ${inputs.num} 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/simple_flow_with_python_tool_and_aggregate/aggregate_num.py: -------------------------------------------------------------------------------- 1 | import statistics 2 | from typing import List 3 | 4 | from promptflow import tool 5 | 6 | 7 | @tool 8 | def aggregate_num(num: List[int]) -> int: 9 | return statistics.mean(num) 10 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/simple_flow_with_python_tool_and_aggregate/divide_num.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def divide_num(num: int) -> int: 6 | return (int)(num / 2) 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification/convert_to_dict.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | from promptflow import tool 4 | 5 | 6 | @tool 7 | def convert_to_dict(input_str: str): 8 | try: 9 | return json.loads(input_str) 10 | except Exception as e: 11 | print("input is not valid, error: {}".format(e)) 12 | return {"category": "None", "evidence": "None"} 13 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification/fetch_text_content_from_url_input.jsonl: -------------------------------------------------------------------------------- 1 | {"inputs.url":"https://www.microsoft.com/en-us/d/xbox-wireless-controller-stellar-shift-special-edition/94fbjc7h0h6h"} 2 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification/samples.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://www.microsoft.com/en-us/d/xbox-wireless-controller-stellar-shift-special-edition/94fbjc7h0h6h" 4 | }, 5 | { 6 | "url": "https://www.apple.com/shop/buy-iphone/iphone-14" 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification/summarize_text_content.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize the following text in one paragraph. 100 words. 2 | Do not add any information that is not in the text. 3 | Text: {{text}} 4 | Summary: 5 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification/summarize_text_content__variant_1.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize some keywords of this paragraph and have some details of each keywords. 2 | Do not add any information that is not in the text. 3 | 4 | Text: {{text}} 5 | Summary: 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_input_dir/details.jsonl: -------------------------------------------------------------------------------- 1 | {"url": "https://www.youtube.com/watch?v=o5ZQyXaAv1g", "answer": "Channel", "evidence": "Url"} 2 | {"url": "https://www.youtube.com/watch?v=o5ZQyXaAv1g", "answer": "Channel", "evidence": "Url"} 3 | {"url": "https://www.youtube.com/watch?v=o5ZQyXaAv1g", "answer": "Channel", "evidence": "Url"} 4 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_invalid/samples.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "line_number": 0, 4 | "variant_id": "variant_0", 5 | "groundtruth": "App", 6 | "prediction": "App" 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_invalid/summarize_text_content__variant_1.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize some keywords of this paragraph and have some details of each keywords. 2 | Do not add any information that is not in the text. 3 | 4 | Text: {{text}} 5 | Summary: 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_no_variants/.promptflow/flow.env_files/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Install your packages here. 3 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_no_variants/.promptflow/lkg_sources/convert_to_dict.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | from promptflow import tool 4 | 5 | 6 | @tool 7 | def convert_to_dict(input_str: str): 8 | try: 9 | return json.loads(input_str) 10 | except Exception as e: 11 | print("input is not valid, error: {}".format(e)) 12 | return {"category": "None", "evidence": "None"} 13 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_no_variants/.promptflow/lkg_sources/summarize_text_content.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize the following text in one paragraph. 100 words. 2 | Do not add any information that is not in the text. 3 | Text: {{text}} 4 | Summary: 5 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_no_variants/.promptflow/lkg_sources/summarize_text_content__variant_1.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize some keywords of this paragraph and have some details of each keywords. 2 | Do not add any information that is not in the text. 3 | 4 | Text: {{text}} 5 | Summary: 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_no_variants/convert_to_dict.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | from promptflow import tool 4 | 5 | 6 | @tool 7 | def convert_to_dict(input_str: str): 8 | try: 9 | return json.loads(input_str) 10 | except Exception as e: 11 | print("input is not valid, error: {}".format(e)) 12 | return {"category": "None", "evidence": "None"} 13 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_no_variants/samples.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "line_number": 0, 4 | "variant_id": "variant_0", 5 | "groundtruth": "App", 6 | "prediction": "App" 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_no_variants/summarize_text_content.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize the following text in one paragraph. 100 words. 2 | Do not add any information that is not in the text. 3 | Text: {{text}} 4 | Summary: 5 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_no_variants/summarize_text_content__variant_1.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize some keywords of this paragraph and have some details of each keywords. 2 | Do not add any information that is not in the text. 3 | 4 | Text: {{text}} 5 | Summary: 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_no_variants_unordered/convert_to_dict.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | from promptflow import tool 4 | 5 | 6 | @tool 7 | def convert_to_dict(input_str: str): 8 | try: 9 | return json.loads(input_str) 10 | except Exception as e: 11 | print("input is not valid, error: {}".format(e)) 12 | return {"category": "None", "evidence": "None"} 13 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_no_variants_unordered/samples.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "line_number": 0, 4 | "variant_id": "variant_0", 5 | "groundtruth": "App", 6 | "prediction": "App" 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_no_variants_unordered/summarize_text_content.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize the following text in one paragraph. 100 words. 2 | Do not add any information that is not in the text. 3 | Text: {{text}} 4 | Summary: 5 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_no_variants_unordered/summarize_text_content__variant_1.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize some keywords of this paragraph and have some details of each keywords. 2 | Do not add any information that is not in the text. 3 | 4 | Text: {{text}} 5 | Summary: 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_v1/convert_to_dict.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | from promptflow import tool 4 | 5 | 6 | @tool 7 | def convert_to_dict(input_str: str): 8 | try: 9 | return json.loads(input_str) 10 | except Exception as e: 11 | print("input is not valid, error: {}".format(e)) 12 | return {"category": "None", "evidence": "None"} 13 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_v1/samples.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://www.microsoft.com/en-us/d/xbox-wireless-controller-stellar-shift-special-edition/94fbjc7h0h6h" 4 | }, 5 | { 6 | "url": "https://www.apple.com/shop/buy-iphone/iphone-14" 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_v1/summarize_text_content.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize the following text in one paragraph. 100 words. 2 | Do not add any information that is not in the text. 3 | Text: {{text}} 4 | Summary: 5 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_v1/summarize_text_content__variant_1.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize some keywords of this paragraph and have some details of each keywords. 2 | Do not add any information that is not in the text. 3 | 4 | Text: {{text}} 5 | Summary: 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_v2/convert_to_dict.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | from promptflow import tool 4 | 5 | 6 | @tool 7 | def convert_to_dict(input_str: str): 8 | try: 9 | return json.loads(input_str) 10 | except Exception as e: 11 | print("input is not valid, error: {}".format(e)) 12 | return {"category": "None", "evidence": "None"} 13 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_v2/samples.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "line_number": 0, 4 | "variant_id": "variant_0", 5 | "groundtruth": "App", 6 | "prediction": "App" 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_v2/summarize_text_content.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize the following text in one paragraph. 100 words. 2 | Do not add any information that is not in the text. 3 | Text: {{text}} 4 | Summary: 5 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_v2/summarize_text_content__variant_1.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize some keywords of this paragraph and have some details of each keywords. 2 | Do not add any information that is not in the text. 3 | 4 | Text: {{text}} 5 | Summary: 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_with_additional_include/samples.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "line_number": 0, 4 | "variant_id": "variant_0", 5 | "groundtruth": "App", 6 | "prediction": "App" 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_with_additional_include/summarize_text_content__variant_1.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize some keywords of this paragraph and have some details of each keywords. 2 | Do not add any information that is not in the text. 3 | 4 | Text: {{text}} 5 | Summary: 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_with_exception/convert_to_dict.py: -------------------------------------------------------------------------------- 1 | 2 | from promptflow import tool 3 | 4 | 5 | @tool 6 | def convert_to_dict(input_str: str): 7 | raise Exception("mock exception") 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_with_exception/samples.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "https://www.microsoft.com/en-us/d/xbox-wireless-controller-stellar-shift-special-edition/94fbjc7h0h6h" 4 | }, 5 | { 6 | "url": "https://www.apple.com/shop/buy-iphone/iphone-14" 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_with_exception/summarize_text_content.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize the following text in one paragraph. 100 words. 2 | Do not add any information that is not in the text. 3 | Text: {{text}} 4 | Summary: 5 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/flows/web_classification_with_exception/summarize_text_content__variant_1.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize some keywords of this paragraph and have some details of each keywords. 2 | Do not add any information that is not in the text. 3 | 4 | Text: {{text}} 5 | Summary: 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/runs/env_file: -------------------------------------------------------------------------------- 1 | FOO=BAR 2 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/runs/input_with_dict_val.yaml: -------------------------------------------------------------------------------- 1 | flow: ../flows/flow_with_dict_input 2 | data: ../datas/webClassification1.jsonl 3 | column_mapping: 4 | key: 5 | val1: 1 6 | val2: 2 7 | url: ${data.url} 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/runs/run_with_connections.yaml: -------------------------------------------------------------------------------- 1 | flow: ../flows/web_classification 2 | data: ../datas/webClassification1.jsonl 3 | column_mapping: 4 | url: "${data.url}" 5 | variant: ${summarize_text_content.variant_0} 6 | 7 | # run config: env related 8 | environment_variables: env_file 9 | 10 | connections: 11 | classify_with_llm: 12 | connection: new_ai_connection 13 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/runs/run_with_env.yaml: -------------------------------------------------------------------------------- 1 | flow: ../flows/print_env_var 2 | data: ../datas/env_var_names.jsonl 3 | 4 | # run config: env related 5 | environment_variables: 6 | API_BASE: ${azure_open_ai_connection.api_base} 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/runs/sample_bulk_run.yaml: -------------------------------------------------------------------------------- 1 | name: flow_run_20230629_101205 2 | description: sample bulk run 3 | flow: ../flows/web_classification 4 | data: ../datas/webClassification1.jsonl 5 | column_mapping: 6 | url: "${data.url}" 7 | variant: ${summarize_text_content.variant_0} 8 | 9 | # run config: env related 10 | environment_variables: env_file 11 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/runs/sample_bulk_run_cloud.yaml: -------------------------------------------------------------------------------- 1 | name: flow_run_20230629_101205 2 | flow: ../flows/web_classification 3 | data: ../datas/webClassification1.jsonl 4 | column_mapping: 5 | url: "${data.url}" 6 | variant: ${summarize_text_content.variant_0} 7 | 8 | # run config: env related 9 | environment_variables: env_file 10 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/runs/sample_eval_run.yaml: -------------------------------------------------------------------------------- 1 | flow: ../flows/classification_accuracy_evaluation 2 | data: ../datas/webClassification1.jsonl 3 | column_mapping: 4 | groundtruth: "${data.answer}" 5 | prediction: "${run.outputs.category}" 6 | variant_id: "${data.variant_id}" 7 | run: flow_run_20230629_101205 # ./sample_bulk_run.yaml 8 | 9 | # run config: env related 10 | environment_variables: env_file 11 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/all_nodes_bypassed/inputs.json: -------------------------------------------------------------------------------- 1 | { 2 | "text": "bypass" 3 | } -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/all_nodes_bypassed/test.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def test(text: str): 6 | return text + "hello world!" 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/flow_input_reference_invalid/divide_num.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def divide_num(num: int) -> int: 6 | return (int)(num / 2) 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/flow_input_reference_invalid/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | num: 3 | type: int 4 | outputs: 5 | content: 6 | type: string 7 | reference: ${divide_num.output} 8 | nodes: 9 | - name: divide_num 10 | type: python 11 | source: 12 | type: code 13 | path: divide_num.py 14 | inputs: 15 | num: ${inputs.num_1} 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/flow_output_reference_invalid/divide_num.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def divide_num(num: int) -> int: 6 | return (int)(num / 2) 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/flow_output_reference_invalid/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | num: 3 | type: int 4 | outputs: 5 | content: 6 | type: string 7 | reference: "" 8 | nodes: 9 | - name: divide_num 10 | type: python 11 | source: 12 | type: code 13 | path: divide_num.py 14 | inputs: 15 | num: ${inputs.num} 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/flow_output_unserializable/divide_num.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def divide_num(num: int): 6 | return UnserializableClass(num=(int)(num / 2)) 7 | 8 | 9 | class UnserializableClass: 10 | def __init__(self, num: int): 11 | self.num = num 12 | 13 | def __str__(self): 14 | return str(self.num) -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/flow_output_unserializable/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | num: 3 | type: int 4 | outputs: 5 | content: 6 | type: string 7 | reference: ${divide_num.output} 8 | nodes: 9 | - name: divide_num 10 | type: python 11 | source: 12 | type: code 13 | path: divide_num.py 14 | inputs: 15 | num: ${inputs.num} 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/invalid_connection/summarize_text_content__variant_1.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize some keywords of this paragraph and have some details of each keywords. 2 | Do not add any information that is not in the text. 3 | 4 | Text: {{text}} 5 | Summary: 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/node_circular_dependency/divide_num.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def divide_num(num: int) -> int: 6 | return (int)(num / 2) 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/node_missing_type_or_source/divide_num.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def divide_num(num: int) -> int: 6 | return (int)(num / 2) 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/node_missing_type_or_source/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | num: 3 | type: int 4 | outputs: 5 | content: 6 | type: string 7 | reference: ${divide_num.output} 8 | nodes: 9 | - name: divide_num 10 | source: 11 | type: code 12 | path: divide_num.py 13 | inputs: 14 | num: ${inputs.num} 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/node_reference_not_found/divide_num.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def divide_num(num: int) -> int: 6 | return (int)(num / 2) 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/nodes_names_duplicated/another_stringify_num.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def stringify_num(num: int): 6 | return str(num) 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/nodes_names_duplicated/stringify_num.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def stringify_num(num: int): 6 | return str(num) 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/outputs_reference_not_valid/flow.dag.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | num: 3 | type: int 4 | outputs: 5 | content: 6 | type: string 7 | reference: ${another_stringify_num.output} 8 | nodes: 9 | - name: stringify_num 10 | type: python 11 | source: 12 | type: code 13 | path: stringify_num.py 14 | inputs: 15 | num: ${inputs.num} 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/outputs_reference_not_valid/stringify_num.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def stringify_num(num: int): 6 | return str(num) 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/outputs_with_invalid_flow_inputs_ref/stringify_num.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def stringify_num(num: int): 6 | return str(num) 7 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/source_file_missing/flow.dag.python.yaml: -------------------------------------------------------------------------------- 1 | inputs: 2 | num: 3 | type: int 4 | outputs: 5 | content: 6 | type: string 7 | reference: ${stringify_num.output} 8 | nodes: 9 | - name: stringify_num 10 | type: python 11 | source: 12 | type: code 13 | path: stringify_num.py 14 | inputs: 15 | num: ${inputs.num} 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/tool_type_missing/summarize_text_content__variant_1.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize some keywords of this paragraph and have some details of each keywords. 2 | Do not add any information that is not in the text. 3 | 4 | Text: {{text}} 5 | Summary: 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/wrong_api/summarize_text_content__variant_1.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize some keywords of this paragraph and have some details of each keywords. 2 | Do not add any information that is not in the text. 3 | 4 | Text: {{text}} 5 | Summary: 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/wrong_module/summarize_text_content__variant_1.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize some keywords of this paragraph and have some details of each keywords. 2 | Do not add any information that is not in the text. 3 | 4 | Text: {{text}} 5 | Summary: 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_flows/wrong_provider/summarize_text_content__variant_1.jinja2: -------------------------------------------------------------------------------- 1 | Please summarize some keywords of this paragraph and have some details of each keywords. 2 | Do not add any information that is not in the text. 3 | 4 | Text: {{text}} 5 | Summary: 6 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_tools/load_error.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 1 / 0 4 | 5 | @tool 6 | def tool1(): 7 | pass 8 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_tools/multiple_tools.py: -------------------------------------------------------------------------------- 1 | from promptflow import tool 2 | 3 | 4 | @tool 5 | def tool1(): 6 | pass 7 | 8 | 9 | @tool 10 | def tool2(): 11 | pass 12 | -------------------------------------------------------------------------------- /src/promptflow/tests/test_configs/wrong_tools/no_end.jinja2: -------------------------------------------------------------------------------- 1 | {% for val in values %} 2 | {{val}} --------------------------------------------------------------------------------