text stringlengths 8 1.72M | id stringlengths 22 143 | metadata dict | __index_level_0__ int64 0 104 |
|---|---|---|---|
# Conditional flow for switch scenario
This example is a conditional flow for switch scenario.
By following this example, you will learn how to create a conditional flow using the `activate config`.
## Flow description
In this flow, we set the background to the search function of a certain mall, use `activate confi... | promptflow/examples/flows/standard/conditional-flow-for-switch/README.md/0 | {
"file_path": "promptflow/examples/flows/standard/conditional-flow-for-switch/README.md",
"repo_id": "promptflow",
"token_count": 925
} | 17 |
import os
from promptflow import tool
from promptflow.connections import CustomConnection
from intent import extract_intent
@tool
def extract_intent_tool(chat_prompt, connection: CustomConnection) -> str:
# set environment variables
for key, value in dict(connection).items():
os.environ[key] = valu... | promptflow/examples/flows/standard/customer-intent-extraction/extract_intent_tool.py/0 | {
"file_path": "promptflow/examples/flows/standard/customer-intent-extraction/extract_intent_tool.py",
"repo_id": "promptflow",
"token_count": 134
} | 18 |
import logging
import re
from typing import List
class Settings:
divide_file = {
"py": r"(?<!.)(class|def)",
}
divide_func = {
"py": r"((\n {,6})|^)(class|def)\s+(\S+(?=\())\s*(\([^)]*\))?\s*(->[^:]*:|:) *"
}
class Divider:
language = 'py'
@classmethod
def divide_file(cl... | promptflow/examples/flows/standard/gen-docstring/divider.py/0 | {
"file_path": "promptflow/examples/flows/standard/gen-docstring/divider.py",
"repo_id": "promptflow",
"token_count": 2530
} | 19 |
from promptflow import tool
@tool
def prepare_example():
return [
{
"question": "What is 37593 * 67?",
"code": "{\n \"code\": \"print(37593 * 67)\"\n}",
"answer": "2512641",
},
{
"question": "What is the value of x in the equation 2x + 3 = 11?",
"code":... | promptflow/examples/flows/standard/maths-to-code/math_example.py/0 | {
"file_path": "promptflow/examples/flows/standard/maths-to-code/math_example.py",
"repo_id": "promptflow",
"token_count": 907
} | 20 |
import json
from promptflow import tool
@tool
def convert_to_dict(input_str: str):
try:
return json.loads(input_str)
except Exception as e:
print("The input is not valid, error: {}".format(e))
return {"category": "None", "evidence": "None"}
| promptflow/examples/flows/standard/web-classification/convert_to_dict.py/0 | {
"file_path": "promptflow/examples/flows/standard/web-classification/convert_to_dict.py",
"repo_id": "promptflow",
"token_count": 105
} | 21 |
my_tool_package.tools.tool_with_dynamic_list_input.my_tool:
function: my_tool
inputs:
input_prefix:
type:
- string
input_text:
type:
- list
dynamic_list:
func_path: my_tool_package.tools.tool_with_dynamic_list_input.my_list_func
func_kwargs:
- name: pr... | promptflow/examples/tools/tool-package-quickstart/my_tool_package/yamls/tool_with_dynamic_list_input.yaml/0 | {
"file_path": "promptflow/examples/tools/tool-package-quickstart/my_tool_package/yamls/tool_with_dynamic_list_input.yaml",
"repo_id": "promptflow",
"token_count": 672
} | 22 |
---
resources: examples/tutorials/flow-deploy/create-service-with-flow
---
# Create service with flow
This example shows how to create a simple service with flow.
You can create your own service by utilize `flow-as-function`.
This folder contains a example on how to build a service with a flow.
Reference [here](./s... | promptflow/examples/tutorials/flow-deploy/create-service-with-flow/README.md/0 | {
"file_path": "promptflow/examples/tutorials/flow-deploy/create-service-with-flow/README.md",
"repo_id": "promptflow",
"token_count": 327
} | 23 |
<jupyter_start><jupyter_text>Use Flow as Component in Pipeline**Requirements** - In order to benefit from this tutorial, you will need:- A basic understanding of Machine Learning- An Azure account with an active subscription - [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F)- An Azure ... | promptflow/examples/tutorials/flow-in-pipeline/pipeline.ipynb/0 | {
"file_path": "promptflow/examples/tutorials/flow-in-pipeline/pipeline.ipynb",
"repo_id": "promptflow",
"token_count": 1361
} | 24 |
name: release-env
channels:
- defaults
- conda-forge
dependencies:
- python=3.8
- pip
- pip:
- setuptools
- twine==4.0.0
- azure-storage-blob==12.16.0
| promptflow/scripts/distributing/configs/promptflow-tools-release-env.yaml/0 | {
"file_path": "promptflow/scripts/distributing/configs/promptflow-tools-release-env.yaml",
"repo_id": "promptflow",
"token_count": 81
} | 25 |
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?define ProductVersion="$(env.CLI_VERSION)" ?>
<?define ProductName = "promptflow" ?>
<?define ProductDescription = "Command-line tools for prompt flow." ?>
<?define ProductAuthor = "Microsoft Corporation" ... | promptflow/scripts/installer/windows/product.wxs/0 | {
"file_path": "promptflow/scripts/installer/windows/product.wxs",
"repo_id": "promptflow",
"token_count": 3455
} | 26 |
FROM mcr.microsoft.com/azureml/promptflow/promptflow-runtime:latest
COPY ./requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
| promptflow/scripts/runtime_mgmt/runtime-env/context/Dockerfile/0 | {
"file_path": "promptflow/scripts/runtime_mgmt/runtime-env/context/Dockerfile",
"repo_id": "promptflow",
"token_count": 51
} | 27 |
{{ package_name }}.tools.{{ tool_name }}.{{ function_name }}:
function: {{ function_name }}
inputs:
connection:
type:
- CustomConnection
input_text:
type:
- string
module: {{ package_name }}.tools.{{ tool_name }}
name: Hello World Tool
description: This is hello world tool
ty... | promptflow/scripts/tool/templates/tool.yaml.j2/0 | {
"file_path": "promptflow/scripts/tool/templates/tool.yaml.j2",
"repo_id": "promptflow",
"token_count": 119
} | 28 |
# Avoid circular dependencies: Use import 'from promptflow._internal' instead of 'from promptflow'
# since the code here is in promptflow namespace as well
from promptflow._internal import tool
from promptflow.tools.common import render_jinja_template
@tool
def render_template_jinja2(template: str, **kwargs) -> str:
... | promptflow/src/promptflow-tools/promptflow/tools/template_rendering.py/0 | {
"file_path": "promptflow/src/promptflow-tools/promptflow/tools/template_rendering.py",
"repo_id": "promptflow",
"token_count": 117
} | 29 |
import pytest
from promptflow.contracts.multimedia import Image
from promptflow.tools.common import ChatAPIInvalidFunctions, validate_functions, process_function_call, \
parse_chat, find_referenced_image_set, preprocess_template_string, convert_to_chat_list, ChatInputList
class TestCommon:
@pytest.mark.param... | promptflow/src/promptflow-tools/tests/test_common.py/0 | {
"file_path": "promptflow/src/promptflow-tools/tests/test_common.py",
"repo_id": "promptflow",
"token_count": 3626
} | 30 |
include promptflow/azure/resources/*
include promptflow/_sdk/_serving/static/*
recursive-include promptflow/_cli/data *
recursive-include promptflow/_sdk/data *
| promptflow/src/promptflow/MANIFEST.in/0 | {
"file_path": "promptflow/src/promptflow/MANIFEST.in",
"repo_id": "promptflow",
"token_count": 47
} | 31 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import argparse
import json
from typing import Callable, Dict, List, Optional, Tuple
from promptflow._cli._params import (
add_param_a... | promptflow/src/promptflow/promptflow/_cli/_pf/_run.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_cli/_pf/_run.py",
"repo_id": "promptflow",
"token_count": 8431
} | 32 |
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/AzureOpenAIConnection.schema.json
name: {{ connection }}
type: azure_open_ai
api_key: "<user-input>"
api_base: "<user-input>"
api_type: "azure"
| promptflow/src/promptflow/promptflow/_cli/data/chat_flow/template/azure_openai.yaml.jinja2/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_cli/data/chat_flow/template/azure_openai.yaml.jinja2",
"repo_id": "promptflow",
"token_count": 83
} | 33 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import inspect
from typing import Callable
class MetricLoggerManager:
_instance = None
def __init__(self):
self._metric... | promptflow/src/promptflow/promptflow/_core/metric_logger.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_core/metric_logger.py",
"repo_id": "promptflow",
"token_count": 838
} | 34 |
# flake8: noqa
"""Put some imports here for mlflow promptflow flavor usage.
DO NOT change the module names in "all" list. If the interface has changed in source code, wrap it here and keep
original function/module names the same as before, otherwise mldesigner will be broken by this change.
"""
from promptflow._sdk._... | promptflow/src/promptflow/promptflow/_sdk/_mlflow.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_sdk/_mlflow.py",
"repo_id": "promptflow",
"token_count": 236
} | 35 |
# ---------------------------------------------------------
# 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": 1100
} | 36 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
from enum import Enum
from promptflow._sdk._serving.extension.default_extension import AppExtension
class ExtensionType(Enum):
"""Ext... | promptflow/src/promptflow/promptflow/_sdk/_serving/extension/extension_factory.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_sdk/_serving/extension/extension_factory.py",
"repo_id": "promptflow",
"token_count": 424
} | 37 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
# this file is a middle layer between the local SDK and executor.
import contextlib
import logging
from pathlib import Path
from types impor... | promptflow/src/promptflow/promptflow/_sdk/_submitter/test_submitter.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_sdk/_submitter/test_submitter.py",
"repo_id": "promptflow",
"token_count": 9673
} | 38 |
#! /bin/bash
CONDA_ENV_PATH="$(conda info --base)/envs/{{env.conda_env_name}}"
export PATH="$CONDA_ENV_PATH/bin:$PATH"
{% if connection_yaml_paths %}
{% if show_comment %}
# hack: for some unknown reason, without this ls, the connection creation will be failed
{% endif %}
ls
ls /connections
{% endif %}
{% for connect... | promptflow/src/promptflow/promptflow/_sdk/data/docker/runit/promptflow-serve/run.jinja2/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_sdk/data/docker/runit/promptflow-serve/run.jinja2",
"repo_id": "promptflow",
"token_count": 230
} | 39 |
# ---------------------------------------------------------
# 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 ._... | promptflow/src/promptflow/promptflow/_sdk/entities/__init__.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_sdk/entities/__init__.py",
"repo_id": "promptflow",
"token_count": 372
} | 40 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import re
from typing import List
from promptflow._sdk._constants import AZURE_WORKSPACE_REGEX_FORMAT, MAX_LIST_CLI_RESULTS
from promptflow... | promptflow/src/promptflow/promptflow/_sdk/operations/_local_azure_connection_operations.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_sdk/operations/_local_azure_connection_operations.py",
"repo_id": "promptflow",
"token_count": 2867
} | 41 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import re
class CredentialScrubber:
"""Scrub sensitive information in string."""
PLACE_HOLDER = "**data_scrubbed**"
LENGTH_T... | promptflow/src/promptflow/promptflow/_utils/credential_scrubber.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_utils/credential_scrubber.py",
"repo_id": "promptflow",
"token_count": 856
} | 42 |
from io import StringIO
from os import PathLike
from typing import IO, AnyStr, Dict, Optional, Union
from ruamel.yaml import YAML, YAMLError
from promptflow._constants import DEFAULT_ENCODING
from promptflow._utils._errors import YamlParseError
def load_yaml(source: Optional[Union[AnyStr, PathLike, IO]]) -> Dict:
... | promptflow/src/promptflow/promptflow/_utils/yaml_utils.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_utils/yaml_utils.py",
"repo_id": "promptflow",
"token_count": 1625
} | 43 |
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.8.0, 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/_configuration.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/azure/_restclient/flow/_configuration.py",
"repo_id": "promptflow",
"token_count": 812
} | 44 |
# coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.8.0, 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": 59142
} | 45 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
from typing import Dict
from azure.ai.ml._scope_dependent_operations import (
OperationConfig,
OperationsContainer,
OperationSc... | promptflow/src/promptflow/promptflow/azure/operations/_connection_operations.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/azure/operations/_connection_operations.py",
"repo_id": "promptflow",
"token_count": 1476
} | 46 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import json
from dataclasses import dataclass
from typing import Any, Dict, List, Optional
from promptflow._sdk._constants import VIS_JS_B... | promptflow/src/promptflow/promptflow/contracts/_run_management.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/contracts/_run_management.py",
"repo_id": "promptflow",
"token_count": 421
} | 47 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import asyncio
import contextvars
import inspect
import threading
from concurrent import futures
from concurrent.futures import Future, Thr... | promptflow/src/promptflow/promptflow/executor/_flow_nodes_scheduler.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/executor/_flow_nodes_scheduler.py",
"repo_id": "promptflow",
"token_count": 2820
} | 48 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
from functools import partial
from pathlib import Path
from typing import Union
from promptflow._utils.multimedia_utils import _process_re... | promptflow/src/promptflow/promptflow/storage/_run_storage.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/storage/_run_storage.py",
"repo_id": "promptflow",
"token_count": 2371
} | 49 |
import pytest
from promptflow.contracts.run_info import Status
from promptflow.executor import FlowExecutor
from ..utils import (
get_yaml_file,
)
SAMPLE_FLOW = "web_classification_no_variants"
SAMPLE_EVAL_FLOW = "classification_accuracy_evaluation"
SAMPLE_FLOW_WITH_PARTIAL_FAILURE = "python_tool_partial_failure... | promptflow/src/promptflow/tests/executor/e2etests/test_executor_execution_failures.py/0 | {
"file_path": "promptflow/src/promptflow/tests/executor/e2etests/test_executor_execution_failures.py",
"repo_id": "promptflow",
"token_count": 1879
} | 50 |
inputs:
text:
type: string
outputs:
output:
type: string
reference: ${custom_llm_tool_with_duplicated_inputs.output}
nodes:
- name: custom_llm_tool_with_duplicated_inputs
type: custom_llm
source:
type: package_with_prompt
tool: custom_llm_tool.TestCustomLLMTool.call
path: ./prompt_with_d... | promptflow/src/promptflow/tests/executor/package_tools/custom_llm_tool_with_duplicated_inputs/flow.dag.yaml/0 | {
"file_path": "promptflow/src/promptflow/tests/executor/package_tools/custom_llm_tool_with_duplicated_inputs/flow.dag.yaml",
"repo_id": "promptflow",
"token_count": 181
} | 51 |
import threading
import pytest
from promptflow._core.operation_context import OperationContext
from promptflow._version import VERSION
from promptflow.contracts.run_mode import RunMode
def set_run_mode(context: OperationContext, run_mode: RunMode):
"""This method simulates the runtime.execute_request()
It ... | promptflow/src/promptflow/tests/executor/unittests/_core/test_operation_context.py/0 | {
"file_path": "promptflow/src/promptflow/tests/executor/unittests/_core/test_operation_context.py",
"repo_id": "promptflow",
"token_count": 2081
} | 52 |
import re
import sys
import time
from io import StringIO
from logging import WARNING, Logger, StreamHandler
import pytest
from promptflow._utils.thread_utils import RepeatLogTimer
from promptflow._utils.utils import generate_elapsed_time_messages
class DummyException(Exception):
pass
@pytest.mark.skipif(sys.p... | promptflow/src/promptflow/tests/executor/unittests/_utils/test_thread_utils.py/0 | {
"file_path": "promptflow/src/promptflow/tests/executor/unittests/_utils/test_thread_utils.py",
"repo_id": "promptflow",
"token_count": 561
} | 53 |
import pytest
from promptflow.contracts.types import AssistantDefinition, Secret, PromptTemplate, FilePath
from promptflow.executor._assistant_tool_invoker import AssistantToolInvoker
@pytest.mark.unittest
def test_secret():
secret = Secret('my_secret')
secret.set_secret_name('secret_name')
assert secret.... | promptflow/src/promptflow/tests/executor/unittests/contracts/test_types.py/0 | {
"file_path": "promptflow/src/promptflow/tests/executor/unittests/contracts/test_types.py",
"repo_id": "promptflow",
"token_count": 382
} | 54 |
import json
from datetime import datetime
import pytest
from promptflow._utils.dataclass_serializer import serialize
from promptflow.contracts.run_info import FlowRunInfo, RunInfo, Status
from promptflow.storage.run_records import LineRunRecord, NodeRunRecord
@pytest.mark.unittest
def test_line_record():
start_... | promptflow/src/promptflow/tests/executor/unittests/storage/test_run_records.py/0 | {
"file_path": "promptflow/src/promptflow/tests/executor/unittests/storage/test_run_records.py",
"repo_id": "promptflow",
"token_count": 1479
} | 55 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import contextlib
import os
import shutil
import sys
import tempfile
import uuid
from logging import Logger
from pathlib import Path
from ty... | promptflow/src/promptflow/tests/sdk_cli_azure_test/e2etests/test_telemetry.py/0 | {
"file_path": "promptflow/src/promptflow/tests/sdk_cli_azure_test/e2etests/test_telemetry.py",
"repo_id": "promptflow",
"token_count": 6615
} | 56 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import shutil
from pathlib import Path
from tempfile import TemporaryDirectory
from unittest.mock import Mock
import pytest
from promptflo... | promptflow/src/promptflow/tests/sdk_cli_azure_test/unittests/test_run_entity.py/0 | {
"file_path": "promptflow/src/promptflow/tests/sdk_cli_azure_test/unittests/test_run_entity.py",
"repo_id": "promptflow",
"token_count": 1208
} | 57 |
from pathlib import Path
import pytest
from ruamel.yaml import YAML
from promptflow import PFClient
from promptflow._sdk._constants import ExperimentStatus, RunStatus
from promptflow._sdk._load_functions import load_common
from promptflow._sdk.entities._experiment import (
CommandNode,
Experiment,
Experim... | promptflow/src/promptflow/tests/sdk_cli_test/e2etests/test_experiment.py/0 | {
"file_path": "promptflow/src/promptflow/tests/sdk_cli_test/e2etests/test_experiment.py",
"repo_id": "promptflow",
"token_count": 2569
} | 58 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
from pathlib import Path
from unittest.mock import patch
import pytest
from promptflow._cli._pf._connection import validate_and_interactiv... | promptflow/src/promptflow/tests/sdk_cli_test/unittests/test_connection.py/0 | {
"file_path": "promptflow/src/promptflow/tests/sdk_cli_test/unittests/test_connection.py",
"repo_id": "promptflow",
"token_count": 7157
} | 59 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import subprocess
import sys
from time import sleep
import pytest
import requests
from promptflow._sdk._service.entry import main
from pr... | promptflow/src/promptflow/tests/sdk_pfs_test/e2etests/test_cli.py/0 | {
"file_path": "promptflow/src/promptflow/tests/sdk_pfs_test/e2etests/test_cli.py",
"repo_id": "promptflow",
"token_count": 1061
} | 60 |
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/FormRecognizerConnection.schema.json
name: my_form_recognizer_connection
type: form_recognizer
api_key: "<to-be-replaced>"
endpoint: "endpoint"
api_version: "2023-07-31"
api_type: Form Recognizer
| promptflow/src/promptflow/tests/test_configs/connections/form_recognizer_connection.yaml/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/connections/form_recognizer_connection.yaml",
"repo_id": "promptflow",
"token_count": 96
} | 61 |
{"text":"data_0000"}
{"text":"data_0001"}
{"text":"data_0002"}
{"text":"data_0003"}
{"text":"data_0004"}
{"text":"data_0005"}
{"text":"data_0006"}
{"text":"data_0007"}
{"text":"data_0008"}
{"text":"data_0009"}
{"text":"data_0010"}
{"text":"data_0011"}
{"text":"data_0012"}
{"text":"data_0013"}
{"text":"data_0014"}
{"tex... | promptflow/src/promptflow/tests/test_configs/datas/load_data_cases/10k/5k.1.jsonl/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/datas/load_data_cases/10k/5k.1.jsonl",
"repo_id": "promptflow",
"token_count": 44913
} | 62 |
[
{
"expected_node_count": 3,
"expected_outputs": {
"output": "Node A not executed. Node B not executed."
},
"expected_bypassed_nodes": [
"nodeA",
"nodeB"
]
}
] | promptflow/src/promptflow/tests/test_configs/flows/activate_condition_always_met/expected_result.json/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/flows/activate_condition_always_met/expected_result.json",
"repo_id": "promptflow",
"token_count": 140
} | 63 |
from promptflow import tool
@tool
def line_process(groundtruth: str, prediction: str):
processed_result = groundtruth + prediction
return processed_result
| promptflow/src/promptflow/tests/test_configs/flows/aggregation_node_failed/line_process.py/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/flows/aggregation_node_failed/line_process.py",
"repo_id": "promptflow",
"token_count": 45
} | 64 |
# Chat with Calorie Assistant
This sample demonstrates how to chat with the PromptFlow Assistant tool facilitates calorie calculations by considering your location, the duration of your exercise, and the type of sport. Currently, it supports two types of sports: jogging and swimming.
Tools used in this flow:
- `add_m... | promptflow/src/promptflow/tests/test_configs/flows/chat-with-assistant-no-file/README.md/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/flows/chat-with-assistant-no-file/README.md",
"repo_id": "promptflow",
"token_count": 663
} | 65 |
[
{
"expected_node_count": 9,
"expected_outputs":{
"investigation_method": {
"first": "Skip job info extractor",
"second": "Execute incident info extractor"
}
},
"expected_bypassed_nodes":["job_info_extractor", "icm_retriever"]
... | promptflow/src/promptflow/tests/test_configs/flows/conditional_flow_with_activate/expected_result.json/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/flows/conditional_flow_with_activate/expected_result.json",
"repo_id": "promptflow",
"token_count": 554
} | 66 |
[
{
"expected_node_count": 3,
"expected_outputs":{
"output":{
"double": 2,
"square": ""
}
},
"expected_bypassed_nodes":["square"]
},
{
"expected_node_count": 3,
"expected_outputs":{
"output":{... | promptflow/src/promptflow/tests/test_configs/flows/conditional_flow_with_aggregate_bypassed/expected_result.json/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/flows/conditional_flow_with_aggregate_bypassed/expected_result.json",
"repo_id": "promptflow",
"token_count": 567
} | 67 |
from promptflow import tool
from promptflow.connections import CustomConnection
@tool
def get_val(key, conn: CustomConnection):
# get from env var
print(key)
if not isinstance(key, dict):
raise TypeError(f"key must be a dict, got {type(key)}")
return {"value": f"{key}: {type(key)}"}
| promptflow/src/promptflow/tests/test_configs/flows/flow_with_dict_input_with_variant/print_val.py/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/flows/flow_with_dict_input_with_variant/print_val.py",
"repo_id": "promptflow",
"token_count": 109
} | 68 |
{
"data": "code_first_input.csv"
} | promptflow/src/promptflow/tests/test_configs/flows/flow_with_langchain_traces/data_inputs.json/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/flows/flow_with_langchain_traces/data_inputs.json",
"repo_id": "promptflow",
"token_count": 19
} | 69 |
import sys
from promptflow import tool
@tool
def get_val(key):
# get from env var
print(key)
print("user log")
print("error log", file=sys.stderr) | promptflow/src/promptflow/tests/test_configs/flows/flow_with_user_output/print_val.py/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/flows/flow_with_user_output/print_val.py",
"repo_id": "promptflow",
"token_count": 64
} | 70 |
$schema: https://azuremlschemas.azureedge.net/latest/flow.schema.json
name: classification_accuracy_eval
display_name: Classification Accuracy Evaluation
type: evaluate
path: azureml://datastores/workspaceworkingdirectory/paths/Users/wanhan/a/flow.dag.yaml
description: Measuring the performance of a classification syst... | promptflow/src/promptflow/tests/test_configs/flows/meta_files/remote_flow_short_path.meta.yaml/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/flows/meta_files/remote_flow_short_path.meta.yaml",
"repo_id": "promptflow",
"token_count": 150
} | 71 |
[{"idx": 5}, {"idx": 5}] | promptflow/src/promptflow/tests/test_configs/flows/one_line_of_bulktest_timeout/samples_all_timeout.json/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/flows/one_line_of_bulktest_timeout/samples_all_timeout.json",
"repo_id": "promptflow",
"token_count": 14
} | 72 |
inputs:
text:
type: string
outputs:
output_text:
type: string
reference: ${print_input.output}
nodes:
- name: print_input
type: python
source:
type: code
path: print_input.py
inputs:
text: ${inputs.text}
| promptflow/src/promptflow/tests/test_configs/flows/print_input_flow/flow.dag.yaml/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/flows/print_input_flow/flow.dag.yaml",
"repo_id": "promptflow",
"token_count": 99
} | 73 |
{"mod": 2, "mod_2": 5}
{"mod": 2, "mod_2": 5}
{"mod": 2, "mod_2": 5}
{"mod": 2, "mod_2": 5}
{"mod": 2, "mod_2": 5}
{"mod": 2, "mod_2": 5}
{"mod": 2, "mod_2": 5} | promptflow/src/promptflow/tests/test_configs/flows/python_tool_partial_failure/inputs/data.jsonl/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/flows/python_tool_partial_failure/inputs/data.jsonl",
"repo_id": "promptflow",
"token_count": 90
} | 74 |
from promptflow import tool
@tool
def passthrough(x: str):
return x
| promptflow/src/promptflow/tests/test_configs/flows/script_with_import/dummy_utils/util_tool.py/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/flows/script_with_import/dummy_utils/util_tool.py",
"repo_id": "promptflow",
"token_count": 26
} | 75 |
inputs:
num:
type: int
outputs:
content:
type: string
reference: ${divide_num.output}
aggregate_content:
type: string
reference: ${aggregate_num.output}
nodes:
- name: divide_num
type: python
source:
type: code
path: divide_num.py
inputs:
num: ${inputs.num}
- name: aggregate_... | promptflow/src/promptflow/tests/test_configs/flows/simple_flow_with_python_tool_and_aggregate/flow.dag.yaml/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/flows/simple_flow_with_python_tool_and_aggregate/flow.dag.yaml",
"repo_id": "promptflow",
"token_count": 183
} | 76 |
interactions:
- request:
body: null
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
User-Agent:
- promptflow-sdk/0.0.1 promptflow/0.0.1 azure-ai-ml/1.12.1 azsdk-python-mgmt-machinelearningservices/0.1.0
Python/... | promptflow/src/promptflow/tests/test_configs/recordings/test_arm_connection_operations_TestArmConnectionOperations_test_get_connection.yaml/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/recordings/test_arm_connection_operations_TestArmConnectionOperations_test_get_connection.yaml",
"repo_id": "promptflow",
"token_count": 3426
} | 77 |
interactions:
- request:
body: null
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
User-Agent:
- promptflow-sdk/0.0.1 azure-ai-ml/1.12.0 azsdk-python-mgmt-machinelearningservices/0.1.0
Python/3.11.5 (Windows-1... | promptflow/src/promptflow/tests/test_configs/recordings/test_run_operations_TestFlowRun_test_automatic_runtime.yaml/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/recordings/test_run_operations_TestFlowRun_test_automatic_runtime.yaml",
"repo_id": "promptflow",
"token_count": 12047
} | 78 |
interactions:
- request:
body: null
headers:
Accept:
- application/json
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
User-Agent:
- promptflow-sdk/0.0.1 promptflow/0.0.1 azure-ai-ml/1.12.1 azsdk-python-mgmt-machinelearningservices/0.1.0
Python/... | promptflow/src/promptflow/tests/test_configs/recordings/test_run_operations_TestFlowRun_test_list_runs.yaml/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/recordings/test_run_operations_TestFlowRun_test_list_runs.yaml",
"repo_id": "promptflow",
"token_count": 26972
} | 79 |
flow: ../flows/classification_accuracy_evaluation
column_mapping:
groundtruth: "${data.answer}"
prediction: "${run.outputs.category}"
run: flow_run_20230629_101205 # ./sample_bulk_run.yaml
# run config: env related
environment_variables: .env
# optional
connections:
node_1:
connection: test_llm_connect... | promptflow/src/promptflow/tests/test_configs/runs/illegal/missing_data.yaml/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/runs/illegal/missing_data.yaml",
"repo_id": "promptflow",
"token_count": 133
} | 80 |
from setuptools import find_packages, setup
PACKAGE_NAME = "tool_package"
setup(
name=PACKAGE_NAME,
version="0.0.1",
description="This is my tools package",
packages=find_packages(),
entry_points={
"package_tools": ["tool_func = tool_package.utils:list_package_tools"],
},
install_r... | promptflow/src/promptflow/tests/test_configs/tools/tool_package/setup.py/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/tools/tool_package/setup.py",
"repo_id": "promptflow",
"token_count": 159
} | 81 |
name: node_wrong_reference
inputs:
text:
type: string
outputs:
result:
type: string
reference: ${second_node}
nodes:
- name: first_node
type: python
source:
type: code
path: test.py
inputs:
text: ${inputs.text}
aggregation: true
- name: second_node
type: python
source:
type: ... | promptflow/src/promptflow/tests/test_configs/wrong_flows/wrong_node_reference/flow.dag.yaml/0 | {
"file_path": "promptflow/src/promptflow/tests/test_configs/wrong_flows/wrong_node_reference/flow.dag.yaml",
"repo_id": "promptflow",
"token_count": 158
} | 82 |
{
"version": "0.2",
"language": "en",
"languageId": "python",
"dictionaries": [
"powershell",
"python",
"go",
"css",
"html",
"bash",
"npm",
"softwareTerms",
"en_us",
"en-gb"
],
"ignorePaths": [
"**/*.js",
"**/*.pyc",
"**/*.log",
"**/*.jsonl",
"**/*... | promptflow/.cspell.json/0 | {
"file_path": "promptflow/.cspell.json",
"repo_id": "promptflow",
"token_count": 1564
} | 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 |
# Dev Setup
## Set up process
- First create a new [conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html) environment. Please specify python version as 3.9.
`conda create -n <env_name> python=3.9`.
- Activate the env you created.
- Set environment variable `PYTHONPATH` in your new conda ... | promptflow/docs/dev/dev_setup.md/0 | {
"file_path": "promptflow/docs/dev/dev_setup.md",
"repo_id": "promptflow",
"token_count": 1669
} | 2 |
# Create and Use Tool Package
In this document, we will guide you through the process of developing your own tool package, offering detailed steps and advice on how to utilize your creation.
The custom tool is the prompt flow tool developed by yourself. If you find it useful, you can follow this guidance to make it a ... | promptflow/docs/how-to-guides/develop-a-tool/create-and-use-tool-package.md/0 | {
"file_path": "promptflow/docs/how-to-guides/develop-a-tool/create-and-use-tool-package.md",
"repo_id": "promptflow",
"token_count": 3697
} | 3 |
# Run and evaluate a flow
:::{admonition} Experimental feature
This is an experimental feature, and may change at any time. Learn [more](../faq.md#stable-vs-experimental).
:::
After you have developed and tested the flow in [init and test a flow](../init-and-test-a-flow.md), this guide will help you learn how to run ... | promptflow/docs/how-to-guides/run-and-evaluate-a-flow/index.md/0 | {
"file_path": "promptflow/docs/how-to-guides/run-and-evaluate-a-flow/index.md",
"repo_id": "promptflow",
"token_count": 2884
} | 4 |
# Embedding
## Introduction
OpenAI's embedding models convert text into dense vector representations for various NLP tasks. See the [OpenAI Embeddings API](https://platform.openai.com/docs/api-reference/embeddings) for more information.
## Prerequisite
Create OpenAI resources:
- **OpenAI**
Sign up account [Open... | promptflow/docs/reference/tools-reference/embedding_tool.md/0 | {
"file_path": "promptflow/docs/reference/tools-reference/embedding_tool.md",
"repo_id": "promptflow",
"token_count": 851
} | 5 |
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/AzureOpenAIConnection.schema.json
name: open_ai_connection
type: azure_open_ai
api_key: "<user-input>"
api_base: "aoai-api-endpoint"
api_type: "azure"
| promptflow/examples/connections/azure_openai.yml/0 | {
"file_path": "promptflow/examples/connections/azure_openai.yml",
"repo_id": "promptflow",
"token_count": 89
} | 6 |
system:
You are an assistant to calculate the answer to the provided math problems.
Please return the final numerical answer only, without any accompanying reasoning or explanation.
{% for item in chat_history %}
user:
{{item.inputs.question}}
assistant:
{{item.outputs.answer}}
{% endfor %}
user:
{{question}}
| promptflow/examples/flows/chat/chat-math-variant/chat.jinja2/0 | {
"file_path": "promptflow/examples/flows/chat/chat-math-variant/chat.jinja2",
"repo_id": "promptflow",
"token_count": 87
} | 7 |
import os
from typing import Iterable, List, Optional
from dataclasses import dataclass
from faiss import Index
import faiss
import pickle
import numpy as np
from .oai import OAIEmbedding as Embedding
@dataclass
class SearchResultEntity:
text: str = None
vector: List[float] = None
score: float = None
... | promptflow/examples/flows/chat/chat-with-pdf/chat_with_pdf/utils/index.py/0 | {
"file_path": "promptflow/examples/flows/chat/chat-with-pdf/chat_with_pdf/utils/index.py",
"repo_id": "promptflow",
"token_count": 1014
} | 8 |
# All the values should be string type, please use "123" instead of 123 or "True" instead of True.
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/OpenAIConnection.schema.json
name: open_ai_connection
type: open_ai
api_key: "<open-ai-api-key>"
organization: ""
# Note:
# The connection information will... | promptflow/examples/flows/chat/chat-with-pdf/openai.yaml/0 | {
"file_path": "promptflow/examples/flows/chat/chat-with-pdf/openai.yaml",
"repo_id": "promptflow",
"token_count": 158
} | 9 |
import random
import time
from concurrent.futures import ThreadPoolExecutor
from functools import partial
import bs4
import requests
from promptflow import tool
session = requests.Session()
def decode_str(string):
return string.encode().decode("unicode-escape").encode("latin1").decode("utf-8")
def get_page_s... | promptflow/examples/flows/chat/chat-with-wikipedia/search_result_from_url.py/0 | {
"file_path": "promptflow/examples/flows/chat/chat-with-wikipedia/search_result_from_url.py",
"repo_id": "promptflow",
"token_count": 1117
} | 10 |
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/Flow.schema.json
inputs:
entities:
type: list
default:
- software engineer
- CEO
ground_truth:
type: string
default: '"CEO, Software Engineer, Finance Manager"'
outputs:
match_cnt:
type: object
reference: ${match.outpu... | promptflow/examples/flows/evaluation/eval-entity-match-rate/flow.dag.yaml/0 | {
"file_path": "promptflow/examples/flows/evaluation/eval-entity-match-rate/flow.dag.yaml",
"repo_id": "promptflow",
"token_count": 313
} | 11 |
user:
# Instructions
* There are many chatbots that can answer users questions based on the context given from different sources like search results, or snippets from books/papers. They try to understand users's question and then get context by either performing search from search engines, databases or books/papers fo... | promptflow/examples/flows/evaluation/eval-perceived-intelligence/gpt_perceived_intelligence.md/0 | {
"file_path": "promptflow/examples/flows/evaluation/eval-perceived-intelligence/gpt_perceived_intelligence.md",
"repo_id": "promptflow",
"token_count": 315
} | 12 |
from promptflow import tool
@tool
def select_metrics(metrics: str) -> str:
supported_metrics = ('gpt_coherence', 'gpt_similarity', 'gpt_fluency', 'gpt_relevance', 'gpt_groundedness',
'f1_score', 'ada_similarity')
user_selected_metrics = [metric.strip() for metric in metrics.split(',')... | promptflow/examples/flows/evaluation/eval-qna-non-rag/select_metrics.py/0 | {
"file_path": "promptflow/examples/flows/evaluation/eval-qna-non-rag/select_metrics.py",
"repo_id": "promptflow",
"token_count": 244
} | 13 |
# Integrations Folder
This folder contains flow examples contributed by various contributors. Each flow example should have a README.md file that provides a comprehensive introduction to the flow and includes contact information for the flow owner.
# Guideline for README.md of flows
To ensure consistency and clarit... | promptflow/examples/flows/integrations/README.md/0 | {
"file_path": "promptflow/examples/flows/integrations/README.md",
"repo_id": "promptflow",
"token_count": 747
} | 14 |
# Autonomous Agent
This is a flow showcasing how to construct a AutoGPT agent with promptflow to autonomously figures out how to apply the given functions
to solve the goal, which is film trivia that provides accurate and up-to-date information about movies, directors,
actors, and more in this sample.
It involves i... | promptflow/examples/flows/standard/autonomous-agent/README.md/0 | {
"file_path": "promptflow/examples/flows/standard/autonomous-agent/README.md",
"repo_id": "promptflow",
"token_count": 1005
} | 15 |
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/Flow.schema.json
inputs:
text:
type: string
default: Python Hello World!
outputs:
output:
type: string
reference: ${llm.output}
nodes:
- name: hello_prompt
type: prompt
inputs:
text: ${inputs.text}
source:
type: code
p... | promptflow/examples/flows/standard/basic-with-builtin-llm/flow.dag.yaml/0 | {
"file_path": "promptflow/examples/flows/standard/basic-with-builtin-llm/flow.dag.yaml",
"repo_id": "promptflow",
"token_count": 313
} | 16 |
{"query": "When will my order be shipped?"}
{"query": "Can you help me find information about this T-shirt?"}
{"query": "Can you recommend me a useful prompt tool?"} | promptflow/examples/flows/standard/conditional-flow-for-switch/data.jsonl/0 | {
"file_path": "promptflow/examples/flows/standard/conditional-flow-for-switch/data.jsonl",
"repo_id": "promptflow",
"token_count": 45
} | 17 |
# Flow with symlinks
User sometimes need to reference some common files or folders, this sample demos how to solve the problem using symlinks.
But it has the following limitations. It is recommended to use **additional include**.
Learn more: [flow-with-additional-includes](../flow-with-additional-includes/README.md)... | promptflow/examples/flows/standard/flow-with-symlinks/README.md/0 | {
"file_path": "promptflow/examples/flows/standard/flow-with-symlinks/README.md",
"repo_id": "promptflow",
"token_count": 870
} | 18 |
import ast
import asyncio
import logging
import os
import sys
from typing import Union, List
from promptflow import tool
from azure_open_ai import ChatLLM
from divider import Divider
from prompt import docstring_prompt, PromptLimitException
from promptflow.connections import AzureOpenAIConnection, OpenAIConnection
de... | promptflow/examples/flows/standard/gen-docstring/generate_docstring_tool.py/0 | {
"file_path": "promptflow/examples/flows/standard/gen-docstring/generate_docstring_tool.py",
"repo_id": "promptflow",
"token_count": 1511
} | 19 |
<jupyter_start><jupyter_code># Setup execution path and pf client
import os
import promptflow
root = os.path.join(os.getcwd(), "../")
flow_path = os.path.join(root, "named-entity-recognition")
data_path = os.path.join(flow_path, "data.jsonl")
eval_match_rate_flow_path = os.path.join(root, "../evaluation/eval-entity-m... | promptflow/examples/flows/standard/named-entity-recognition/NER-test.ipynb/0 | {
"file_path": "promptflow/examples/flows/standard/named-entity-recognition/NER-test.ipynb",
"repo_id": "promptflow",
"token_count": 494
} | 20 |
from promptflow import tool
@tool
def prepare_examples():
return [
{
"url": "https://play.google.com/store/apps/details?id=com.spotify.music",
"text_content": "Spotify is a free music and podcast streaming app with millions of songs, albums, and "
"original podcasts. It... | promptflow/examples/flows/standard/web-classification/prepare_examples.py/0 | {
"file_path": "promptflow/examples/flows/standard/web-classification/prepare_examples.py",
"repo_id": "promptflow",
"token_count": 899
} | 21 |
from enum import Enum
from promptflow import tool
class UserType(str, Enum):
STUDENT = "student"
TEACHER = "teacher"
@tool
def my_tool(user_type: Enum, student_id: str = "", teacher_id: str = "") -> str:
"""This is a dummy function to support cascading inputs.
:param user_type: user type, student ... | promptflow/examples/tools/tool-package-quickstart/my_tool_package/tools/tool_with_cascading_inputs.py/0 | {
"file_path": "promptflow/examples/tools/tool-package-quickstart/my_tool_package/tools/tool_with_cascading_inputs.py",
"repo_id": "promptflow",
"token_count": 267
} | 22 |
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/CustomStrongTypeConnection.schema.json
name: "my_custom_connection"
type: custom
custom_type: MyCustomConnection
module: my_tool_package.tools.tool_with_custom_strong_type_connection
package: my-tools-package
package_version: 0.0.5
configs:
api_base: "Th... | promptflow/examples/tools/use-cases/custom-strong-type-connection-package-tool-showcase/my_custom_connection.yml/0 | {
"file_path": "promptflow/examples/tools/use-cases/custom-strong-type-connection-package-tool-showcase/my_custom_connection.yml",
"repo_id": "promptflow",
"token_count": 171
} | 23 |
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/Flow.schema.json
inputs:
input:
type: string
default: Microsoft
outputs:
output:
type: string
reference: ${Tool_with_FilePath_Input.output}
nodes:
- name: Tool_with_FilePath_Input
type: python
source:
type: package
tool: my_... | promptflow/examples/tools/use-cases/filepath-input-tool-showcase/flow.dag.yaml/0 | {
"file_path": "promptflow/examples/tools/use-cases/filepath-input-tool-showcase/flow.dag.yaml",
"repo_id": "promptflow",
"token_count": 177
} | 24 |
---
resources: examples/connections/azure_openai.yml, examples/flows/standard/web-classification
---
# Distribute flow as executable app
This example demos how to package flow as a executable app.
We will use [web-classification](../../../flows/standard/web-classification/README.md) as example in this tutorial.
Pleas... | promptflow/examples/tutorials/flow-deploy/distribute-flow-as-executable-app/README.md/0 | {
"file_path": "promptflow/examples/tutorials/flow-deploy/distribute-flow-as-executable-app/README.md",
"repo_id": "promptflow",
"token_count": 2383
} | 25 |
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_699_15212)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M237 39.0408V461.693C237 469.397 228.655 474.208 221.988 470.346L151.918 429.764C130.306 417.247 117 394.164 117 369.19V148.892C117 1... | promptflow/scripts/docs/_static/logo.svg/0 | {
"file_path": "promptflow/scripts/docs/_static/logo.svg",
"repo_id": "promptflow",
"token_count": 1155
} | 26 |
@echo off
setlocal
SET PF_INSTALLER=MSI
set MAIN_EXE=%~dp0.\pfcli.exe
"%MAIN_EXE%" pf %* | promptflow/scripts/installer/windows/scripts/pf.bat/0 | {
"file_path": "promptflow/scripts/installer/windows/scripts/pf.bat",
"repo_id": "promptflow",
"token_count": 49
} | 27 |
import io
import re
from pathlib import Path
import panflute
import pypandoc
from .readme_step import ReadmeStepsManage
def strip_comments(code):
code = str(code)
code = re.sub(r"(?m)^ *#.*\n?", "", code) # remove comments
splits = [ll.rstrip() for ll in code.splitlines() if ll.strip()] # remove empty... | promptflow/scripts/readme/ghactions_driver/readme_parse.py/0 | {
"file_path": "promptflow/scripts/readme/ghactions_driver/readme_parse.py",
"repo_id": "promptflow",
"token_count": 609
} | 28 |
{% extends "workflow_skeleton.yml.jinja2" %}
{% block steps %}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ '{{' }} secrets.AZURE_CREDENTIALS }}
- name: Setup Python 3.9 environment
uses: actions... | promptflow/scripts/readme/ghactions_driver/workflow_templates/basic_workflow.yml.jinja2/0 | {
"file_path": "promptflow/scripts/readme/ghactions_driver/workflow_templates/basic_workflow.yml.jinja2",
"repo_id": "promptflow",
"token_count": 478
} | 29 |
import argparse
import base64
import os
import io
from PIL import Image
SUPPORT_IMAGE_TYPES = ["png", "jpg", "jpeg", "bmp"]
def get_image_size(image_path):
with Image.open(image_path) as img:
width, height = img.size
return width, height
def get_image_storage_size(image_path):
file_size_bytes ... | promptflow/scripts/tool/convert_image_to_data_url.py/0 | {
"file_path": "promptflow/scripts/tool/convert_image_to_data_url.py",
"repo_id": "promptflow",
"token_count": 895
} | 30 |
import argparse
from utils.secret_manager import get_secret_client, upload_secret
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--tenant_id",
type=str,
required=True,
help="The tenant id of the service principal",
)
parser.add_argum... | promptflow/scripts/tool/upload_tool_secret.py/0 | {
"file_path": "promptflow/scripts/tool/upload_tool_secret.py",
"repo_id": "promptflow",
"token_count": 448
} | 31 |
from .aoai import AzureOpenAI # noqa: F401
from .openai import OpenAI # noqa: F401
from .serpapi import SerpAPI # noqa: F401
| promptflow/src/promptflow-tools/promptflow/tools/__init__.py/0 | {
"file_path": "promptflow/src/promptflow-tools/promptflow/tools/__init__.py",
"repo_id": "promptflow",
"token_count": 48
} | 32 |
promptflow.tools.open_model_llm.OpenModelLLM.call:
name: Open Model LLM
description: Use an open model from the Azure Model catalog, deployed to an AzureML Online Endpoint for LLM Chat or Completion API calls.
icon: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACgElEQVR4nGWSz2vcVRTFP/e9NzOZ... | promptflow/src/promptflow-tools/promptflow/tools/yamls/open_model_llm.yaml/0 | {
"file_path": "promptflow/src/promptflow-tools/promptflow/tools/yamls/open_model_llm.yaml",
"repo_id": "promptflow",
"token_count": 1312
} | 33 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.