text
stringlengths
13
1.77M
id
stringlengths
22
127
metadata
dict
__index_level_0__
int64
0
28
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from .activity import ( # noqa: F401 ActivityCompletionStatus, ActivityType, log_activity, monitor_operation, request_i...
promptflow/src/promptflow/promptflow/_sdk/_telemetry/__init__.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/_telemetry/__init__.py", "repo_id": "promptflow", "token_count": 150 }
14
# syntax=docker/dockerfile:1 FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build WORKDIR / COPY ./flow /flow COPY ./connections /connections COPY ./start.sh /start.sh FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime COPY --from=build / / ENV IS_IN_DOCKER="true" EXPOSE 8080 RUN apt-get update && apt-get install -y run...
promptflow/src/promptflow/promptflow/_sdk/data/docker_csharp/Dockerfile.jinja2/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/data/docker_csharp/Dockerfile.jinja2", "repo_id": "promptflow", "token_count": 194 }
15
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from os import PathLike from pathlib import Path from typing import Union from promptflow._constants import LANGUAGE_KEY, FlowLanguage from...
promptflow/src/promptflow/promptflow/_sdk/entities/_eager_flow.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/entities/_eager_flow.py", "repo_id": "promptflow", "token_count": 742 }
16
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import copy import datetime import json import logging import shutil from dataclasses import asdict, dataclass from functools import partia...
promptflow/src/promptflow/promptflow/_sdk/operations/_local_storage_operations.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/operations/_local_storage_operations.py", "repo_id": "promptflow", "token_count": 10022 }
17
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import io import re from jinja2 import Template from .yaml_utils import dump_yaml, load_yaml_string def generate_custom_strong_type_conn...
promptflow/src/promptflow/promptflow/_utils/connection_utils.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_utils/connection_utils.py", "repo_id": "promptflow", "token_count": 1814 }
18
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import contextvars import logging import threading from promptflow._utils.utils import set_context class RepeatLogTimer(threading.Timer)...
promptflow/src/promptflow/promptflow/_utils/thread_utils.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_utils/thread_utils.py", "repo_id": "promptflow", "token_count": 505 }
19
# How to automatically generate the REST client code Rest client code in this folder are not manually written, but generated by autorest. ## Setup + install [nodejs](https://nodejs.org/en) + install autorest + run `npm install -g autorest` ## Download swagger.json Download swagger.json from [here](https://int.api.a...
promptflow/src/promptflow/promptflow/azure/_restclient/README.md/0
{ "file_path": "promptflow/src/promptflow/promptflow/azure/_restclient/README.md", "repo_id": "promptflow", "token_count": 901 }
20
# coding=utf-8 # -------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.2, generator: @autorest/python@5.12.2) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # ------------------------------...
promptflow/src/promptflow/promptflow/azure/_restclient/flow/aio/operations/_flow_runtimes_operations.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/azure/_restclient/flow/aio/operations/_flow_runtimes_operations.py", "repo_id": "promptflow", "token_count": 11768 }
21
# coding=utf-8 # -------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.2, generator: @autorest/python@5.12.2) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # ------------------------------...
promptflow/src/promptflow/promptflow/azure/_restclient/flow/operations/_flow_runs_admin_operations.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/azure/_restclient/flow/operations/_flow_runs_admin_operations.py", "repo_id": "promptflow", "token_count": 18701 }
22
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import re class BulkRunURL: """Parser for a flow run URL.""" REGEX_PATTERN = ".*prompts/flow/([^/]+)/([^/]+)/bulktest/([^/]+).*" ...
promptflow/src/promptflow/promptflow/azure/_utils/_url_utils.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/azure/_utils/_url_utils.py", "repo_id": "promptflow", "token_count": 1057 }
23
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from pathlib import Path from typing import Any, List, Mapping, Optional from promptflow.batch._base_executor_proxy import APIBasedExecutor...
promptflow/src/promptflow/promptflow/batch/_csharp_base_executor_proxy.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/batch/_csharp_base_executor_proxy.py", "repo_id": "promptflow", "token_count": 781 }
24
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- # isort: skip_file # skip to avoid circular import __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore from p...
promptflow/src/promptflow/promptflow/entities/__init__.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/entities/__init__.py", "repo_id": "promptflow", "token_count": 384 }
25
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from dataclasses import dataclass from datetime import datetime from promptflow.contracts.run_info import RunInfo @dataclass class Cache...
promptflow/src/promptflow/promptflow/storage/_cache_storage.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/storage/_cache_storage.py", "repo_id": "promptflow", "token_count": 189 }
26
FROM python:3.9-slim-bullseye AS base RUN set -x RUN apt-get update \ && apt-get -y install curl \ && apt-get -y install net-tools \ && apt-get -y install procps \ && apt-get -y install build-essential \ && apt-get -y install docker.io RUN pip install ipython ipykernel RUN ipython kernel install ...
promptflow/.devcontainer/Dockerfile/0
{ "file_path": "promptflow/.devcontainer/Dockerfile", "repo_id": "promptflow", "token_count": 166 }
0
# Support ## How to file issues and get help This project uses GitHub Issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new Issue. ## Microsoft Support Policy Support for this **PROJECT or...
promptflow/SUPPORT.md/0
{ "file_path": "promptflow/SUPPORT.md", "repo_id": "promptflow", "token_count": 84 }
1
# Concepts In this section, you will learn the basic concepts of prompt flow. ```{toctree} :maxdepth: 1 concept-flows concept-tools concept-connections concept-variants design-principles ```
promptflow/docs/concepts/index.md/0
{ "file_path": "promptflow/docs/concepts/index.md", "repo_id": "promptflow", "token_count": 61 }
2
# Adding Category and Tags for Tool This document is dedicated to guiding you through the process of categorizing and tagging your tools for optimal organization and efficiency. Categories help you organize your tools into specific folders, making it much easier to find what you need. Tags, on the other hand, work lik...
promptflow/docs/how-to-guides/develop-a-tool/add-category-and-tags-for-tool.md/0
{ "file_path": "promptflow/docs/how-to-guides/develop-a-tool/add-category-and-tags-for-tool.md", "repo_id": "promptflow", "token_count": 1073 }
3
# Quick Start This guide will walk you through the fist step using of prompt flow code-first experience. **Prerequisite** - To make the most of this tutorial, you'll need: - Know how to program with Python :) - A basic understanding of Machine Learning can be beneficial, but it's not mandatory. **Learning Objectiv...
promptflow/docs/how-to-guides/quick-start.md/0
{ "file_path": "promptflow/docs/how-to-guides/quick-start.md", "repo_id": "promptflow", "token_count": 3766 }
4
# Content Safety (Text) Azure Content Safety is a content moderation service developed by Microsoft that help users detect harmful content from different modalities and languages. This tool is a wrapper for the Azure Content Safety Text API, which allows you to detect text content and get moderation results. See the [...
promptflow/docs/reference/tools-reference/contentsafety_text_tool.md/0
{ "file_path": "promptflow/docs/reference/tools-reference/contentsafety_text_tool.md", "repo_id": "promptflow", "token_count": 917 }
5
promptflow.tools.azure_content_safety.analyze_text: module: promptflow.tools.azure_content_safety function: analyze_text inputs: connection: type: - AzureContentSafetyConnection hate_category: default: medium_sensitivity enum: - disable - low_sensitivity - medium_...
promptflow/src/promptflow-tools/promptflow/tools/yamls/azure_content_safety.yaml/0
{ "file_path": "promptflow/src/promptflow-tools/promptflow/tools/yamls/azure_content_safety.yaml", "repo_id": "promptflow", "token_count": 492 }
6
@echo off setlocal SET PF_INSTALLER=PIP IF EXIST "%~dp0\python.exe" ( "%~dp0\python.exe" -m promptflow._cli._pf.entry %* ) ELSE ( python -m promptflow._cli._pf.entry %* )
promptflow/src/promptflow/pf.bat/0
{ "file_path": "promptflow/src/promptflow/pf.bat", "repo_id": "promptflow", "token_count": 80 }
7
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from pathlib import Path from dotenv import dotenv_values from promptflow._cli._params import add_param_connection_name, add_param_env, b...
promptflow/src/promptflow/promptflow/_cli/_pf_azure/_connection.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_cli/_pf_azure/_connection.py", "repo_id": "promptflow", "token_count": 1313 }
8
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from promptflow import tool # The inputs section will change based on the arguments of the tool function, after you save the code # Adding...
promptflow/src/promptflow/promptflow/_cli/data/standard_flow/hello.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_cli/data/standard_flow/hello.py", "repo_id": "promptflow", "token_count": 114 }
9
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import inspect import logging from abc import ABC from dataclasses import InitVar, asdict, dataclass, field from enum import Enum from typi...
promptflow/src/promptflow/promptflow/_core/tool.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_core/tool.py", "repo_id": "promptflow", "token_count": 3844 }
10
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import time from functools import partial, wraps from typing import Tuple, Union from sqlalchemy.exc import OperationalError def retry(e...
promptflow/src/promptflow/promptflow/_sdk/_orm/retry.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/_orm/retry.py", "repo_id": "promptflow", "token_count": 868 }
11
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import logging from logging.handlers import RotatingFileHandler from flask import Blueprint, Flask, jsonify from werkzeug.exceptions import...
promptflow/src/promptflow/promptflow/_sdk/_service/app.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/_service/app.py", "repo_id": "promptflow", "token_count": 1233 }
12
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import json import os from abc import ABC, abstractmethod from pathlib import Path from promptflow._constants import DEFAULT_ENCODING from...
promptflow/src/promptflow/promptflow/_sdk/_serving/extension/default_extension.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/_serving/extension/default_extension.py", "repo_id": "promptflow", "token_count": 1992 }
13
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- # this file is a middle layer between the local SDK and executor, it'll have some similar logic with cloud PFS. import datetime from pathli...
promptflow/src/promptflow/promptflow/_sdk/_submitter/run_submitter.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/_submitter/run_submitter.py", "repo_id": "promptflow", "token_count": 4087 }
14
#!/bin/bash echo "$(date -uIns) - promptflow-serve/finish $@" # stop all gunicorn processes echo "$(date -uIns) - Stopping all Gunicorn processes" pkill gunicorn while pgrep gunicorn >/dev/null; do echo "$(date -uIns) - Gunicorn process is still running, waiting for 1s" sleep 1 done echo "$(date -uIns) - Stopped...
promptflow/src/promptflow/promptflow/_sdk/data/docker/runit/promptflow-serve/finish.jinja2/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/data/docker/runit/promptflow-serve/finish.jinja2", "repo_id": "promptflow", "token_count": 123 }
15
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Run Details</title> </head> <body> <div id="root"></div> <script> window.bulk_test_details_data = {{ data }} </script> <script src="{{ js_p...
promptflow/src/promptflow/promptflow/_sdk/data/visualize.j2/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/data/visualize.j2", "repo_id": "promptflow", "token_count": 154 }
16
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from functools import lru_cache from os import PathLike from pathlib import Path from typing import Dict from promptflow._sdk._constants im...
promptflow/src/promptflow/promptflow/_sdk/operations/_flow_context_resolver.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/operations/_flow_context_resolver.py", "repo_id": "promptflow", "token_count": 1775 }
17
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # ---------------------------------------------------------
promptflow/src/promptflow/promptflow/_utils/__init__.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_utils/__init__.py", "repo_id": "promptflow", "token_count": 23 }
18
import tiktoken from importlib.metadata import version from promptflow.exceptions import UserErrorException IS_LEGACY_OPENAI = version("openai").startswith("0.") class OpenAIMetricsCalculator: def __init__(self, logger=None) -> None: self._logger = logger def get_openai_metrics_from_api_call(self, ...
promptflow/src/promptflow/promptflow/_utils/openai_metrics_calculator.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_utils/openai_metrics_calculator.py", "repo_id": "promptflow", "token_count": 4132 }
19
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from os import PathLike from pathlib import Path from typing import IO, AnyStr, Optional, Union from ._utils import is_arm_id def load_fl...
promptflow/src/promptflow/promptflow/azure/_load_functions.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/azure/_load_functions.py", "repo_id": "promptflow", "token_count": 531 }
20
# coding=utf-8 # -------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.2, generator: @autorest/python@5.12.2) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # ------------------------------...
promptflow/src/promptflow/promptflow/azure/_restclient/flow/aio/operations/_connection_operations.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/azure/_restclient/flow/aio/operations/_connection_operations.py", "repo_id": "promptflow", "token_count": 6949 }
21
# coding=utf-8 # -------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.2, generator: @autorest/python@5.12.2) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # ------------------------------...
promptflow/src/promptflow/promptflow/azure/_restclient/flow/operations/_bulk_runs_operations.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/azure/_restclient/flow/operations/_bulk_runs_operations.py", "repo_id": "promptflow", "token_count": 13028 }
22
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import asyncio import json from datetime import datetime from json import JSONDecodeError from pathlib import Path from typing import Any, ...
promptflow/src/promptflow/promptflow/batch/_base_executor_proxy.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/batch/_base_executor_proxy.py", "repo_id": "promptflow", "token_count": 7144 }
23
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import json import logging from dataclasses import asdict, dataclass from enum import Enum from typing import Any, Dict, List, Optional, Ty...
promptflow/src/promptflow/promptflow/contracts/tool.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/contracts/tool.py", "repo_id": "promptflow", "token_count": 6397 }
24
import asyncio import importlib import inspect import uuid from pathlib import Path from typing import Any, Callable, Mapping, Optional from promptflow._constants import LINE_NUMBER_KEY from promptflow._core.run_tracker import RunTracker from promptflow._core.tool_meta_generator import PythonLoadError from promptflow....
promptflow/src/promptflow/promptflow/executor/_script_executor.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/executor/_script_executor.py", "repo_id": "promptflow", "token_count": 2198 }
25
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from enum import Enum from typing import Any, Dict, List, Optional, Union from langchain.callbacks.base import BaseCallbackHandler from la...
promptflow/src/promptflow/promptflow/integrations/langchain.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/integrations/langchain.py", "repo_id": "promptflow", "token_count": 3372 }
26
# Change log of default runtime image ## Runtime image In Azure Machine Learning prompt flow, runtime provides the environment to execute flows. The default runtime includes a pre-built Docker image, which contains all necessary dependent packages. ### Pull image The image can be pulled by specifying a runtime version...
promptflow/docs/cloud/azureai/runtime-change-log.md/0
{ "file_path": "promptflow/docs/cloud/azureai/runtime-change-log.md", "repo_id": "promptflow", "token_count": 342 }
0
# Distribute flow as executable app :::{admonition} Experimental feature This is an experimental feature, and may change at any time. Learn [more](../faq.md#stable-vs-experimental). ::: We are going to use the [web-classification](https://github.com/microsoft/promptflow/tree/main/examples/flows/standard/web-classifica...
promptflow/docs/how-to-guides/deploy-a-flow/distribute-flow-as-executable-app.md/0
{ "file_path": "promptflow/docs/how-to-guides/deploy-a-flow/distribute-flow-as-executable-app.md", "repo_id": "promptflow", "token_count": 2459 }
1
# Use streaming endpoints deployed from prompt flow In prompt flow, you can [deploy flow as REST endpoint](./deploy-a-flow/index.md) for real-time inference. When consuming the endpoint by sending a request, the default behavior is that the online endpoint will keep waiting until the whole response is ready, and then...
promptflow/docs/how-to-guides/enable-streaming-mode.md/0
{ "file_path": "promptflow/docs/how-to-guides/enable-streaming-mode.md", "repo_id": "promptflow", "token_count": 4715 }
2
# Azure AI Language Azure AI Language enables users with task-oriented and optimized pre-trained language models to effectively understand documents and conversations. This Prompt flow tool is a wrapper for various Azure AI Language APIs. The current list of supported capabilities is as follows: | Name ...
promptflow/docs/integrations/tools/azure-ai-language-tool.md/0
{ "file_path": "promptflow/docs/integrations/tools/azure-ai-language-tool.md", "repo_id": "promptflow", "token_count": 4513 }
3
# SerpAPI ## Introduction The SerpAPI API is a Python tool that provides a wrapper to the [SerpAPI Google Search Engine Results API](https://serpapi.com/search-api) and [SerpApi Bing Search Engine Results API ](https://serpapi.com/bing-search-api). We could use the tool to retrieve search results from a number of di...
promptflow/docs/reference/tools-reference/serp-api-tool.md/0
{ "file_path": "promptflow/docs/reference/tools-reference/serp-api-tool.md", "repo_id": "promptflow", "token_count": 683 }
4
from openai import OpenAIError from promptflow.exceptions import ErrorTarget, SystemErrorException, UserErrorException openai_error_code_ref_message = "Error reference: https://platform.openai.com/docs/guides/error-codes/api-errors" def to_openai_error_message(e: Exception) -> str: ex_type = type(e).__name__ ...
promptflow/src/promptflow-tools/promptflow/tools/exception.py/0
{ "file_path": "promptflow/src/promptflow-tools/promptflow/tools/exception.py", "repo_id": "promptflow", "token_count": 3068 }
5
DEFAULT_SUBSCRIPTION_ID="your-subscription-id" DEFAULT_RESOURCE_GROUP_NAME="your-resource-group-name" DEFAULT_WORKSPACE_NAME="your-workspace-name" DEFAULT_RUNTIME_NAME="test-runtime-ci" PROMPT_FLOW_TEST_MODE="replay"
promptflow/src/promptflow/.env.example/0
{ "file_path": "promptflow/src/promptflow/.env.example", "repo_id": "promptflow", "token_count": 85 }
6
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import argparse import importlib import json import os import shutil import subprocess import sys import tempfile import webbrowser from pa...
promptflow/src/promptflow/promptflow/_cli/_pf/_flow.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_cli/_pf/_flow.py", "repo_id": "promptflow", "token_count": 9285 }
7
# Chat flow Chat flow is designed for conversational application development, building upon the capabilities of standard flow and providing enhanced support for chat inputs/outputs and chat history management. With chat flow, you can easily create a chatbot that handles chat input and output. ## Create connection for ...
promptflow/src/promptflow/promptflow/_cli/data/chat_flow/flow_files/README.md/0
{ "file_path": "promptflow/src/promptflow/promptflow/_cli/data/chat_flow/flow_files/README.md", "repo_id": "promptflow", "token_count": 1766 }
8
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- class GeneratorProxy: """A proxy for generator that can record all items that have been yielded from the generator.""" def __init...
promptflow/src/promptflow/promptflow/_core/generator_proxy.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_core/generator_proxy.py", "repo_id": "promptflow", "token_count": 215 }
9
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from promptflow._sdk._constants import BULK_RUN_ERRORS from promptflow.exceptions import ErrorTarget, SystemErrorException, UserErrorExcepti...
promptflow/src/promptflow/promptflow/_sdk/_errors.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/_errors.py", "repo_id": "promptflow", "token_count": 1507 }
10
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- __path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore from flask_restx import Api, Namespace, Resource, fields ...
promptflow/src/promptflow/promptflow/_sdk/_service/__init__.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/_service/__init__.py", "repo_id": "promptflow", "token_count": 117 }
11
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from promptflow._sdk._serving.utils import get_cost_up_to_now from promptflow._sdk._serving.monitor.metrics import ResponseType class Str...
promptflow/src/promptflow/promptflow/_sdk/_serving/monitor/streaming_monitor.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/_serving/monitor/streaming_monitor.py", "repo_id": "promptflow", "token_count": 960 }
12
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import collections import datetime import hashlib import json import multiprocessing import os import platform import re import shutil impor...
promptflow/src/promptflow/promptflow/_sdk/_utils.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/_utils.py", "repo_id": "promptflow", "token_count": 18463 }
13
Exported entry file & its dependencies are located in the same folder. The structure is as below: - flow: the folder contains all the flow files - connections: the folder contains yaml files to create all related connections - app.py: the entry file is included as the entry point for the bundled application. - app.spec...
promptflow/src/promptflow/promptflow/_sdk/data/executable/README.md/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/data/executable/README.md", "repo_id": "promptflow", "token_count": 223 }
14
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import copy import datetime import json import typing from dataclasses import dataclass from google.protobuf.json_format import MessageToJ...
promptflow/src/promptflow/promptflow/_sdk/entities/_trace.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/entities/_trace.py", "repo_id": "promptflow", "token_count": 4866 }
15
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- # pylint: disable=unused-argument,no-self-use import copy from pathlib import Path from typing import Optional from marshmallow import RA...
promptflow/src/promptflow/promptflow/_sdk/schemas/_base.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/schemas/_base.py", "repo_id": "promptflow", "token_count": 2701 }
16
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from typing import AbstractSet, Any, Dict, List, Mapping from promptflow._utils.logger_utils import logger from promptflow.contracts.flow i...
promptflow/src/promptflow/promptflow/_utils/execution_utils.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_utils/execution_utils.py", "repo_id": "promptflow", "token_count": 923 }
17
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- # coding=utf-8 # -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All ri...
promptflow/src/promptflow/promptflow/azure/_restclient/flow/_patch.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/azure/_restclient/flow/_patch.py", "repo_id": "promptflow", "token_count": 415 }
18
# coding=utf-8 # -------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.2, generator: @autorest/python@5.12.2) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # ------------------------------...
promptflow/src/promptflow/promptflow/azure/_restclient/flow/aio/operations/_flows_provider_operations.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/azure/_restclient/flow/aio/operations/_flows_provider_operations.py", "repo_id": "promptflow", "token_count": 2881 }
19
# coding=utf-8 # -------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.2, generator: @autorest/python@5.12.2) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # ------------------------------...
promptflow/src/promptflow/promptflow/azure/_restclient/flow/operations/_flows_operations.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/azure/_restclient/flow/operations/_flows_operations.py", "repo_id": "promptflow", "token_count": 54883 }
20
import asyncio import contextvars import functools import json from pathlib import Path from typing import Optional, Union import httpx from azure.core.exceptions import HttpResponseError from azure.storage.blob.aio import BlobServiceClient from promptflow._sdk._constants import DEFAULT_ENCODING, DownloadedRun from p...
promptflow/src/promptflow/promptflow/azure/operations/_async_run_downloader.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/azure/operations/_async_run_downloader.py", "repo_id": "promptflow", "token_count": 6052 }
21
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from dataclasses import dataclass, is_dataclass from promptflow._core.tools_manager import register_connections from promptflow._sdk.entiti...
promptflow/src/promptflow/promptflow/connections/__init__.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/connections/__init__.py", "repo_id": "promptflow", "token_count": 399 }
22
import inspect from typing import Any, Callable, Dict, List, Mapping from promptflow._utils.logger_utils import flow_logger from promptflow.contracts.flow import InputAssignment, InputValueType, Node from promptflow.executor import _input_assignment_parser class DAGManager: def __init__(self, nodes: List[Node], ...
promptflow/src/promptflow/promptflow/executor/_dag_manager.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/executor/_dag_manager.py", "repo_id": "promptflow", "token_count": 3269 }
23
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from pathlib import Path from typing import Any, Mapping from pydantic import BaseModel from promptflow.contracts.run_mode import RunMode...
promptflow/src/promptflow/promptflow/executor/_service/contracts/execution_request.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/executor/_service/contracts/execution_request.py", "repo_id": "promptflow", "token_count": 528 }
24
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import os import re from pathlib import Path from typing import Any, Match, cast from setuptools import find_packages, setup PACKAGE_NAME...
promptflow/src/promptflow/setup.py/0
{ "file_path": "promptflow/src/promptflow/setup.py", "repo_id": "promptflow", "token_count": 2281 }
25
# Create run with automatic runtime A prompt flow runtime provides computing resources that are required for the application to run, including a Docker image that contains all necessary dependency packages. This reliable and scalable runtime environment enables prompt flow to efficiently execute its tasks and function...
promptflow/docs/cloud/azureai/quick-start/create-run-with-automatic-runtime.md/0
{ "file_path": "promptflow/docs/cloud/azureai/quick-start/create-run-with-automatic-runtime.md", "repo_id": "promptflow", "token_count": 990 }
0
# Deploy a flow using Docker :::{admonition} Experimental feature This is an experimental feature, and may change at any time. Learn [more](../faq.md#stable-vs-experimental). ::: There are two steps to deploy a flow using docker: 1. Build the flow as docker format. 2. Build and run the docker image. ## Build a flow ...
promptflow/docs/how-to-guides/deploy-a-flow/deploy-using-docker.md/0
{ "file_path": "promptflow/docs/how-to-guides/deploy-a-flow/deploy-using-docker.md", "repo_id": "promptflow", "token_count": 1143 }
1
# Develop a tool We provide guides on how to develop a tool and use it. ```{toctree} :maxdepth: 1 :hidden: create-and-use-tool-package add-a-tool-icon add-category-and-tags-for-tool use-file-path-as-tool-input customize_an_llm_tool create-cascading-tool-inputs create-your-own-custom-strong-type-connection create-dyna...
promptflow/docs/how-to-guides/develop-a-tool/index.md/0
{ "file_path": "promptflow/docs/how-to-guides/develop-a-tool/index.md", "repo_id": "promptflow", "token_count": 130 }
2
# Integrations The Integrations section contains documentation on custom extensions created by the community that expand prompt flow's capabilities. These include tools that enrich flows, as well as tutorials on innovative ways to use prompt flow. ```{toctree} :maxdepth: 1 tools/index llms/index ```
promptflow/docs/integrations/index.md/0
{ "file_path": "promptflow/docs/integrations/index.md", "repo_id": "promptflow", "token_count": 74 }
3
# Prompt ## Introduction The Prompt Tool in PromptFlow offers a collection of textual templates that serve as a starting point for creating prompts. These templates, based on the Jinja2 template engine, facilitate the definition of prompts. The tool proves useful when prompt tuning is required prior to feeding the p...
promptflow/docs/reference/tools-reference/prompt-tool.md/0
{ "file_path": "promptflow/docs/reference/tools-reference/prompt-tool.md", "repo_id": "promptflow", "token_count": 783 }
4
import functools import json import re import sys import time from typing import List, Mapping from jinja2 import Template from openai import APIConnectionError, APIStatusError, OpenAIError, RateLimitError, APITimeoutError from promptflow.tools.exception import ChatAPIInvalidRole, WrappedOpenAIError, LLMError, JinjaTe...
promptflow/src/promptflow-tools/promptflow/tools/common.py/0
{ "file_path": "promptflow/src/promptflow-tools/promptflow/tools/common.py", "repo_id": "promptflow", "token_count": 8205 }
5
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import argparse import json from functools import partial from promptflow._cli._params import ( add_param_all_results, add_param_m...
promptflow/src/promptflow/promptflow/_cli/_pf/_connection.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_cli/_pf/_connection.py", "repo_id": "promptflow", "token_count": 3450 }
6
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import argparse import contextlib import json import os import shutil import sys import traceback from collections import namedtuple from c...
promptflow/src/promptflow/promptflow/_cli/_utils.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_cli/_utils.py", "repo_id": "promptflow", "token_count": 7653 }
7
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from promptflow import tool @tool def line_process(groundtruth: str, prediction: str): """ This tool processes the prediction of ...
promptflow/src/promptflow/promptflow/_cli/data/evaluation_flow/line_process.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_cli/data/evaluation_flow/line_process.py", "repo_id": "promptflow", "token_count": 156 }
8
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import copy import json import os from dataclasses import fields, is_dataclass from pathlib import Path from typing import Any, Dict, List ...
promptflow/src/promptflow/promptflow/_core/connection_manager.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_core/connection_manager.py", "repo_id": "promptflow", "token_count": 2536 }
9
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import logging import os.path import uuid from itertools import product from os import PathLike from pathlib import Path from typing import ...
promptflow/src/promptflow/promptflow/_sdk/_configuration.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/_configuration.py", "repo_id": "promptflow", "token_count": 3940 }
10
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import time from promptflow._sdk._serving.monitor.data_collector import FlowDataCollector from promptflow._sdk._serving.monitor.streaming_m...
promptflow/src/promptflow/promptflow/_sdk/_serving/monitor/flow_monitor.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/_serving/monitor/flow_monitor.py", "repo_id": "promptflow", "token_count": 1895 }
11
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import logging from promptflow._sdk._configuration import Configuration PROMPTFLOW_LOGGER_NAMESPACE = "promptflow._sdk._telemetry" class...
promptflow/src/promptflow/promptflow/_sdk/_telemetry/telemetry.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/_telemetry/telemetry.py", "repo_id": "promptflow", "token_count": 1051 }
12
#! /bin/bash echo "start promptflow serving" cd /flow dotnet Promptflow.dll --port "8080" --yaml_path "flow.dag.yaml" --assembly_folder "." --connection_folder_path "../connections" --log_path "" --serving
promptflow/src/promptflow/promptflow/_sdk/data/docker_csharp/runit/promptflow-serve/run.jinja2/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/data/docker_csharp/runit/promptflow-serve/run.jinja2", "repo_id": "promptflow", "token_count": 71 }
13
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import datetime import functools import json import uuid from os import PathLike from pathlib import Path from typing import Any, Dict, Lis...
promptflow/src/promptflow/promptflow/_sdk/entities/_run.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/entities/_run.py", "repo_id": "promptflow", "token_count": 14053 }
14
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import copy import json import typing from promptflow._constants import SpanAttributeFieldName, SpanFieldName from promptflow._sdk._orm.tr...
promptflow/src/promptflow/promptflow/_sdk/operations/_trace_operations.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_sdk/operations/_trace_operations.py", "repo_id": "promptflow", "token_count": 1438 }
15
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from dataclasses import fields, is_dataclass from datetime import datetime from enum import Enum from typing import Any, Callable, Dict, Li...
promptflow/src/promptflow/promptflow/_utils/dataclass_serializer.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_utils/dataclass_serializer.py", "repo_id": "promptflow", "token_count": 2062 }
16
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import datetime import json import logging from promptflow._constants import ( LAST_HINT_TIME, LAST_CHECK_TIME, PF_VERSION_CHEC...
promptflow/src/promptflow/promptflow/_utils/version_hint_utils.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_utils/version_hint_utils.py", "repo_id": "promptflow", "token_count": 1617 }
17
# coding=utf-8 # -------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.2, generator: @autorest/python@5.12.2) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # ------------------------------...
promptflow/src/promptflow/promptflow/azure/_restclient/flow/_azure_machine_learning_designer_service_client.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/azure/_restclient/flow/_azure_machine_learning_designer_service_client.py", "repo_id": "promptflow", "token_count": 1997 }
18
# coding=utf-8 # -------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.2, generator: @autorest/python@5.12.2) # Changes may cause incorrect behavior and will be lost if the code is regenerated. # ------------------------------...
promptflow/src/promptflow/promptflow/azure/_restclient/flow/aio/operations/_flow_sessions_operations.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/azure/_restclient/flow/aio/operations/_flow_sessions_operations.py", "repo_id": "promptflow", "token_count": 7307 }
19
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- # coding=utf-8 # -------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code...
promptflow/src/promptflow/promptflow/azure/_restclient/flow/operations/_flow_sessions_admin_operations.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/azure/_restclient/flow/operations/_flow_sessions_admin_operations.py", "repo_id": "promptflow", "token_count": 2614 }
20
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from enum import Enum from typing import Any, Dict, Union import requests from azure.ai.ml._restclient.v2023_06_01_preview.models import Wo...
promptflow/src/promptflow/promptflow/azure/operations/_arm_connection_operations.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/azure/operations/_arm_connection_operations.py", "repo_id": "promptflow", "token_count": 5724 }
21
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from pathlib import Path from typing import Any, List, Mapping, Optional, Tuple from promptflow._core._errors import UnexpectedError from ...
promptflow/src/promptflow/promptflow/batch/_python_executor_proxy.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/batch/_python_executor_proxy.py", "repo_id": "promptflow", "token_count": 1635 }
22
import os from dataclasses import dataclass from functools import partial from pathlib import Path from typing import Callable, Dict, Optional from promptflow.contracts.flow import InputAssignment, Node, ToolSource from promptflow.contracts.tool import ToolType from promptflow.exceptions import ErrorTarget from prompt...
promptflow/src/promptflow/promptflow/executor/_assistant_tool_invoker.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/executor/_assistant_tool_invoker.py", "repo_id": "promptflow", "token_count": 1833 }
23
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from fastapi import FastAPI from fastapi.responses import JSONResponse from promptflow.executor._service.apis.common import router as comm...
promptflow/src/promptflow/promptflow/executor/_service/app.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/executor/_service/app.py", "repo_id": "promptflow", "token_count": 206 }
24
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import json from dataclasses import asdict, dataclass from datetime import datetime from promptflow._utils.dataclass_serializer import ser...
promptflow/src/promptflow/promptflow/storage/run_records.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/storage/run_records.py", "repo_id": "promptflow", "token_count": 1297 }
25
# Microsoft Open Source Code of Conduct This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). Resources: - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) - [Microsoft Code of Conduct FAQ](https://opensource.mic...
promptflow/CODE_OF_CONDUCT.md/0
{ "file_path": "promptflow/CODE_OF_CONDUCT.md", "repo_id": "promptflow", "token_count": 115 }
0
In prompt flow, you can utilize connections to securely manage credentials or secrets for external services. # Connections Connections are for storing information about how to access external services like LLMs: endpoint, api keys etc. - In your local development environment, the connections are persisted in your lo...
promptflow/docs/concepts/concept-connections.md/0
{ "file_path": "promptflow/docs/concepts/concept-connections.md", "repo_id": "promptflow", "token_count": 641 }
1
# Develop evaluation flow :::{admonition} Experimental feature This is an experimental feature, and may change at any time. Learn [more](../faq.md#stable-vs-experimental). ::: The evaluation flow is a flow to test/evaluate the quality of your LLM application (standard/chat flow). It usually runs on the outputs of sta...
promptflow/docs/how-to-guides/develop-a-flow/develop-evaluation-flow.md/0
{ "file_path": "promptflow/docs/how-to-guides/develop-a-flow/develop-evaluation-flow.md", "repo_id": "promptflow", "token_count": 1939 }
2
# How-to Guides Simple and short articles grouped by topics, each introduces a core feature of prompt flow and how you can use it to address your specific use cases. ```{toctree} :maxdepth: 1 develop-a-flow/index init-and-test-a-flow add-conditional-control-to-a-flow run-and-evaluate-a-flow/index tune-prompts-with-v...
promptflow/docs/how-to-guides/index.md/0
{ "file_path": "promptflow/docs/how-to-guides/index.md", "repo_id": "promptflow", "token_count": 174 }
3
# pf :::{admonition} Experimental feature This is an experimental feature, and may change at any time. Learn [more](../how-to-guides/faq.md#stable-vs-experimental). ::: Manage prompt flow resources with the prompt flow CLI. | Command | Description | |----------------------...
promptflow/docs/reference/pf-command-reference.md/0
{ "file_path": "promptflow/docs/reference/pf-command-reference.md", "repo_id": "promptflow", "token_count": 6270 }
4
[flake8] extend-ignore = E203, E266, W503, F403, F821 max-line-length = 120 enable-extensions = E123,E133,E241,E242,E704,W505 exclude = .git .tox .eggs __pycache__ tests/fixtures/* docs/* venv,.pytest_cache build src/promptflow/promptflow/azure/_restclient src/promptflow/tests/te...
promptflow/setup.cfg/0
{ "file_path": "promptflow/setup.cfg", "repo_id": "promptflow", "token_count": 494 }
5
from enum import Enum try: from openai import OpenAI as OpenAIClient except Exception: raise Exception( "Please upgrade your OpenAI package to version 1.0.0 or later using the command: pip install --upgrade openai.") from promptflow.tools.common import render_jinja_template, handle_openai_error, \ ...
promptflow/src/promptflow-tools/promptflow/tools/openai.py/0
{ "file_path": "promptflow/src/promptflow-tools/promptflow/tools/openai.py", "repo_id": "promptflow", "token_count": 3479 }
6
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import argparse import json import re import shutil from pathlib import Path from promptflow._cli._params import add_param_set_tool_extra_...
promptflow/src/promptflow/promptflow/_cli/_pf/_tool.py/0
{ "file_path": "promptflow/src/promptflow/promptflow/_cli/_pf/_tool.py", "repo_id": "promptflow", "token_count": 3192 }
7