repo_id
stringlengths
15
132
file_path
stringlengths
34
176
content
stringlengths
2
3.52M
__index_level_0__
int64
0
0
promptflow_repo/promptflow/scripts/distributing
promptflow_repo/promptflow/scripts/distributing/configs/distribution_settings.json
{ "releases":{ "internal":{ "promptflow-tools-release":{ "index": "internal-index-release" }, "promptflow-tools-test":{ "index": "internal-index-test" } } }, "targets": { "internal-index-release": { "storage_account": "azuremlsdktestpypi", "packages_...
0
promptflow_repo/promptflow/scripts/distributing
promptflow_repo/promptflow/scripts/distributing/configs/promptflow-tools-release-env.yaml
name: release-env channels: - defaults - conda-forge dependencies: - python=3.8 - pip - pip: - setuptools - twine==4.0.0 - azure-storage-blob==12.16.0
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/check_enforcer/check_enforcer.py
# Enforce the check of pipelines. # This script will get the diff of the current branch and main branch, calculate the pipelines that should be triggered. # Then it will check if the triggered pipelines are successful. This script will loop for 30*loop-times seconds at most. # How many checks are triggered: # 1. sdk c...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/runtime_mgmt/update-runtime.py
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- import argparse import time from pathlib import Path import requests from azure.ai.ml import MLClient, load_environment from azure.identit...
0
promptflow_repo/promptflow/scripts/runtime_mgmt
promptflow_repo/promptflow/scripts/runtime_mgmt/runtime-env/env.yaml
$schema: https://azuremlschemas.azureedge.net/latest/environment.schema.json name: chat-with-pdf build: path: context inference_config: liveness_route: port: 8080 path: /health readiness_route: port: 8080 path: /health scoring_route: port: 8080 path: /score
0
promptflow_repo/promptflow/scripts/runtime_mgmt/runtime-env
promptflow_repo/promptflow/scripts/runtime_mgmt/runtime-env/context/Dockerfile
FROM mcr.microsoft.com/azureml/promptflow/promptflow-runtime:latest COPY ./requirements.txt ./ RUN pip install --no-cache-dir -r requirements.txt
0
promptflow_repo/promptflow/scripts/runtime_mgmt/runtime-env
promptflow_repo/promptflow/scripts/runtime_mgmt/runtime-env/context/requirements.txt
PyPDF2 faiss-cpu openai jinja2 python-dotenv tiktoken
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/compliance-check/user_exclusion.xml
<PoliCheckExclusions> <!-- All strings must be UPPER CASE --> <!--index-xxx.js is an auto-generated javascript file - skipped given it's not expected to be readable --> <Exclusion Type="FileName">SRC\PROMPTFLOW\PROMPTFLOW\_SDK\_SERVING\STATIC\INDEX.JS</Exclusion> </PoliCheckExclusions>
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/compliance-check/Check-PolicheckScan.ps1
# Copyright (C) Microsoft Corporation. All rights reserved. <# .SYNOPSIS Check Policheck Scan result. .DESCRIPTION Helper script to check the Policheck result. If there is policheck failure, show the error and throw exception. #> [CmdLetbinding()] param ( [string]$policheckResult, [st...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/release/promptflow-release-note.md
We are pleased to announce the release of promptflow {{VERSION}}. This release includes some new features, bug fixes, and improvements. We recommend that all users upgrade to this version. See the [CHANGELOG](https://github.com/microsoft/promptflow/blob/release/promptflow/{{VERSION}}/src/promptflow/CHANGELOG.md) for ...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/tool/generate_tool_package_template.py
import argparse import os import re from jinja2 import Environment, FileSystemLoader def make_pythonic_variable_name(input_string): variable_name = input_string.strip() variable_name = re.sub(r'\W|^(?=\d)', '_', variable_name) if not variable_name[0].isalpha() and variable_name[0] != '_': variable...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/tool/generate_package_tool_meta.py
import argparse import ast import importlib import json import os import sys from ruamel.yaml import YAML sys.path.append("src/promptflow-tools") sys.path.append(os.getcwd()) from utils.generate_tool_meta_utils import generate_custom_llm_tools_in_module_as_dict, generate_python_tools_in_module_as_dict # noqa: E402,...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/tool/convert_image_to_data_url.py
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 ...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/tool/deploy_endpoint.py
import argparse from utils.repo_utils import create_remote_branch_in_ADO_with_new_tool_pkg_version, deploy_test_endpoint if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--tool_pkg_version", type=str, required=True) parser.add_argument("--ado_pat", type=str, required=True...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/tool/validate_tool_secret.py
import argparse from utils.secret_manager import ( get_secret_client, init_used_secret_names, validate_secret_name, ) if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "--tenant_id", type=str, required=True, help="The tenant id of the...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/tool/generate_connection_config.py
import argparse import json from pathlib import Path from utils.secret_manager import get_secret, get_secret_client, list_secret_names CONNECTION_FILE_NAME = "connections.json" PROMPTFLOW_TOOLS_ROOT = Path(__file__) / "../../../src/promptflow-tools" CONNECTION_TPL_FILE_PATH = PROMPTFLOW_TOOLS_ROOT / "connections.json...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/tool/upload_tool_secret.py
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...
0
promptflow_repo/promptflow/scripts/tool
promptflow_repo/promptflow/scripts/tool/exceptions/__init__.py
from .secret_exceptions import SecretNameAlreadyExistsException, SecretNameInvalidException, SecretNoSetPermissionException # noqa: F401, E501
0
promptflow_repo/promptflow/scripts/tool
promptflow_repo/promptflow/scripts/tool/exceptions/secret_exceptions.py
class SecretNameAlreadyExistsException(Exception): pass class SecretNameInvalidException(Exception): pass class SecretNoSetPermissionException(Exception): pass
0
promptflow_repo/promptflow/scripts/tool
promptflow_repo/promptflow/scripts/tool/utils/generate_tool_meta_utils.py
""" This file can generate a meta file for the given prompt template or a python file. """ import inspect import types from dataclasses import asdict from utils.tool_utils import function_to_interface from promptflow.contracts.tool import Tool, ToolType # Avoid circular dependencies: Use import 'from promptflow._inte...
0
promptflow_repo/promptflow/scripts/tool
promptflow_repo/promptflow/scripts/tool/utils/tool_utils.py
import inspect from enum import Enum, EnumMeta from typing import Callable, Union, get_args, get_origin from promptflow.contracts.tool import ConnectionType, InputDefinition, ValueType, ToolType from promptflow.contracts.types import PromptTemplate def value_to_str(val): if val is inspect.Parameter.empty: ...
0
promptflow_repo/promptflow/scripts/tool
promptflow_repo/promptflow/scripts/tool/utils/repo_utils.py
import json import os import shutil import subprocess from datetime import datetime from pathlib import Path import requests scripts_dir = os.path.join(os.getcwd(), "scripts") index_url = "https://azuremlsdktestpypi.azureedge.net/test-promptflow/promptflow-tools" ado_promptflow_repo_url_format = "https://{0}@dev.azur...
0
promptflow_repo/promptflow/scripts/tool
promptflow_repo/promptflow/scripts/tool/utils/secret_manager.py
import re from azure.core.exceptions import HttpResponseError, ResourceExistsError from azure.identity import ClientSecretCredential from azure.keyvault.secrets import SecretClient from exceptions import ( SecretNameAlreadyExistsException, SecretNameInvalidException, SecretNoSetPermissionException, ) key_...
0
promptflow_repo/promptflow/scripts/tool/utils
promptflow_repo/promptflow/scripts/tool/utils/configs/promptflow-gallery-tool-test.yaml
storage: storage_account: promptflowgall5817910653 deployment: subscription_id: 96aede12-2f73-41cb-b983-6d11a904839b resource_group: promptflow workspace_name: promptflow-gallery endpoint_name: tool-test638236049123389546 deployment_name: blue mt_service_endpoint: https://eastus2euap.api.azureml.ms
0
promptflow_repo/promptflow/scripts/tool/utils
promptflow_repo/promptflow/scripts/tool/utils/configs/deploy-endpoint-request-body.json
{ "stagesToSkip": [], "resources": { "repositories": { "self": { "refName": "refs/heads/dev-branch" } } }, "templateParameters": { "deployEndpoint": "True" }, "variables": { "model-file": { "value": "promptflow-g...
0
promptflow_repo/promptflow/scripts/tool
promptflow_repo/promptflow/scripts/tool/templates/test_tool2.py.j2
import pytest import unittest from {{ package_name }}.tools.{{ tool_name }} import {{ class_name }} @pytest.fixture def my_url() -> str: my_url = "https://www.bing.com" return my_url @pytest.fixture def my_tool_provider(my_url) -> {{ class_name }}: my_tool_provider = {{ class_name }}(my_url) return...
0
promptflow_repo/promptflow/scripts/tool
promptflow_repo/promptflow/scripts/tool/templates/utils.py.j2
from ruamel.yaml import YAML from pathlib import Path def collect_tools_from_directory(base_dir) -> dict: tools = {} yaml = YAML() for f in Path(base_dir).glob("**/*.yaml"): with open(f, "r") as f: tools_in_file = yaml.load(f) for identifier, tool in tools_in_file.items(): ...
0
promptflow_repo/promptflow/scripts/tool
promptflow_repo/promptflow/scripts/tool/templates/tool.py.j2
from promptflow import tool from promptflow.connections import CustomConnection @tool def {{ function_name }}(connection: CustomConnection, input_text: str) -> str: # Replace with your tool code. # Usually connection contains configs to connect to an API. # Use CustomConnection is a dict. You can use it l...
0
promptflow_repo/promptflow/scripts/tool
promptflow_repo/promptflow/scripts/tool/templates/tool.yaml.j2
{{ 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...
0
promptflow_repo/promptflow/scripts/tool
promptflow_repo/promptflow/scripts/tool/templates/tool2.py.j2
from promptflow import ToolProvider, tool import urllib.request class {{ class_name }}(ToolProvider): def __init__(self, url: str): super().__init__() # Load content from url might be slow, so we do it in __init__ method to make sure it is loaded only once. self.content = urllib.request.u...
0
promptflow_repo/promptflow/scripts/tool
promptflow_repo/promptflow/scripts/tool/templates/MANIFEST.in.j2
include {{ package_name }}/yamls/*.yaml
0
promptflow_repo/promptflow/scripts/tool
promptflow_repo/promptflow/scripts/tool/templates/test_tool.py.j2
import pytest import unittest from promptflow.connections import CustomConnection from {{ package_name }}.tools.{{ tool_name }} import {{ function_name }} @pytest.fixture def my_custom_connection() -> CustomConnection: my_custom_connection = CustomConnection( { "api-key" : "my-api-key", ...
0
promptflow_repo/promptflow/scripts/tool
promptflow_repo/promptflow/scripts/tool/templates/setup.py.j2
from setuptools import find_packages, setup PACKAGE_NAME = "{{ package_name }}" setup( name=PACKAGE_NAME, version="0.0.1", description="This is my tools package", packages=find_packages(), entry_points={ "package_tools": ["{{ tool_name }} = {{ package_name }}.tools.utils:list_package_tools...
0
promptflow_repo/promptflow/scripts/tool
promptflow_repo/promptflow/scripts/tool/templates/tool2.yaml.j2
{{ package_name }}.tools.{{ tool_name }}.{{ class_name }}.{{ function_name }}: class_name: {{ class_name }} function: {{ function_name }} inputs: url: type: - string query: type: - string module: {{ package_name }}.tools.{{ tool_name }} name: Hello World Tool description: Thi...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/docs/doc_generation.ps1
<# .DESCRIPTION Script to build doc site .EXAMPLE PS> ./doc_generation.ps1 -SkipInstall # skip pip install PS> ./doc_generation.ps1 -BuildLinkCheck -WarningAsError:$true -SkipInstall #> [CmdletBinding()] param( [switch]$SkipInstall, [switch]$WarningAsError = $false, [switch]$BuildLinkCheck = $false, ...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/docs/promptflow.connections.rst
promptflow.connections package ============================== .. autoclass:: promptflow.connections.AzureContentSafetyConnection :members: :undoc-members: :show-inheritance: :noindex: .. autoclass:: promptflow.connections.AzureOpenAIConnection :members: :undoc-members: :show-inheritance: :noin...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/docs/conf.py
# -- Path setup -------------------------------------------------------------- import sys # -- Project information ----------------------------------------------------- project = 'Prompt flow' copyright = '2023, Microsoft' author = 'Microsoft' sys.path.append(".") from gallery_directive import GalleryDirective # no...
0
promptflow_repo/promptflow/scripts/docs
promptflow_repo/promptflow/scripts/docs/gallery_directive/__init__.py
"""A directive to generate a gallery of images from structured data. Generating a gallery of images that are all the same size is a common pattern in documentation, and this can be cumbersome if the gallery is generated programmatically. This directive wraps this particular use-case in a helper-directive to generate it...
0
promptflow_repo/promptflow/scripts/docs
promptflow_repo/promptflow/scripts/docs/_static/custom.css
.title { font-weight:700; } .sd-card-header { font-weight:700; font-size: 16px; } .bd-page-width { max-width: 100rem; } .bd-sidebar-primary { flex: 0 0 20%; } .bd-main .bd-content .bd-article-container { max-width: 70em; } html[data-theme="light"] { --header-announcement-color: #fff070...
0
promptflow_repo/promptflow/scripts/docs
promptflow_repo/promptflow/scripts/docs/_static/custom.js
// Get the head element let head = document.getElementsByTagName("head")[0]; // Create the script element let script = document.createElement("script"); script.async = true; script.src = "https://www.googletagmanager.com/gtag/js?id=G-KZXK5PFBZY"; // Create another script element for the gtag code let script2 = docume...
0
promptflow_repo/promptflow/scripts/docs
promptflow_repo/promptflow/scripts/docs/_static/logo.svg
<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...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/readme/readme_generator.py
import argparse from pathlib import Path from functools import reduce from ghactions_driver.readme_workflow_generate import write_readme_workflow from ghactions_driver.readme_step import ReadmeStepsManage, ReadmeSteps from ghactions_driver.readme_parse import readme_parser from ghactions_driver.telemetry_obj import T...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/readme/extract_steps_from_readme.py
import argparse from pathlib import Path from jinja2 import Environment, FileSystemLoader from ghactions_driver.readme_parse import readme_parser from ghactions_driver.readme_step import ReadmeStepsManage def write_readme_shell(readme_path: str, output_folder: str): full_text = readme_parser(readme_path) Pat...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/readme/schema_checker.py
from promptflow._sdk._load_functions import load_yaml from promptflow._sdk._pf_client import PFClient from ghactions_driver.readme_step import ReadmeStepsManage from pathlib import Path import os import subprocess import sys def install(filename): subprocess.check_call([sys.executable, "-m", "pip", "install", "-r...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/readme/README.md
# Readme Workflow Generator These tools is used to generate workflows from README.md and python notebook files in the [examples](../../examples/) folder. * Generated workflows will be placed in [.github/workflows/samples_*](../../.github/workflows/) folder. * The script will also generate a new explanation [README.md]...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/readme/workflow_generator.py
import os import glob import argparse from pathlib import Path import ntpath import re import hashlib import json from jinja2 import Environment, FileSystemLoader from ghactions_driver.readme_step import ReadmeStepsManage from ghactions_driver.resource_resolver import resolve_tutorial_resource from ghactions_driver.tel...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/readme/readme.py
# Generate Readme file for the examples folder import json from pathlib import Path import workflow_generator import readme_generator from jinja2 import Environment, FileSystemLoader from ghactions_driver.readme_step import ReadmeStepsManage from operator import itemgetter import argparse import sys import os import re...
0
promptflow_repo/promptflow/scripts/readme
promptflow_repo/promptflow/scripts/readme/ghactions_driver/telemetry_obj.py
class Telemetry(object): pass
0
promptflow_repo/promptflow/scripts/readme
promptflow_repo/promptflow/scripts/readme/ghactions_driver/readme_parse.py
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...
0
promptflow_repo/promptflow/scripts/readme
promptflow_repo/promptflow/scripts/readme/ghactions_driver/readme_step.py
import subprocess from pathlib import Path import hashlib from jinja2 import Environment, FileSystemLoader, Template from .telemetry_obj import Telemetry class Step: """ StepType in workflow """ Environment = None @staticmethod def init_jinja_loader() -> Environment: jinja_folder_pat...
0
promptflow_repo/promptflow/scripts/readme
promptflow_repo/promptflow/scripts/readme/ghactions_driver/resource_resolver.py
from pathlib import Path from typing import List import markdown import nbformat from .readme_step import ReadmeStepsManage RESOURCES_KEY_NAME = "resources" RESOURCES_KEY_ERROR_MESSAGE = ( "Please follow examples contributing guide to declare tutorial resources: " "https://github.com/microsoft/promptflow/blo...
0
promptflow_repo/promptflow/scripts/readme
promptflow_repo/promptflow/scripts/readme/ghactions_driver/readme_workflow_generate.py
from pathlib import Path from .readme_step import ReadmeStepsManage, ReadmeSteps from ghactions_driver.telemetry_obj import Telemetry def write_readme_workflow(readme_path, output_telemetry=Telemetry()): relative_path = Path(readme_path).relative_to( Path(ReadmeStepsManage.git_base_dir()) ) workf...
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/bash_script/bash_script.sh.jinja2
#!/usr/bin/env bash set -xe {{ command }}
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/readme_templates/README.md.jinja2
# Promptflow examples [![code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![license: MIT](https://img.shields.io/badge/License-MIT-purple.svg)](../LICENSE) ## Get started **Install dependencies** - Bootstrap your python environment. - e.g: create a new...
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/workflow_steps/step_extract_steps_and_run.yml.jinja2
- name: {{ step_name }} working-directory: ${{ '{{' }} github.workspace }} run: | python scripts/readme/extract_steps_from_readme.py -f {{ readme_name }} -o {{ working_dir }} - name: Cat script working-directory: {{ working_dir }} run: | cat bash_script.sh - name: Run scripts against canary workspace (s...
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/workflow_steps/step_create_env.yml.jinja2
- name: {{ step_name }} working-directory: {{ working_dir }} run: | AOAI_API_KEY=${{ '{{' }} secrets.AOAI_API_KEY_TEST }} AOAI_API_ENDPOINT=${{ '{{' }} secrets.AOAI_API_ENDPOINT_TEST }} AOAI_API_ENDPOINT=$(echo ${AOAI_API_ENDPOINT//\//\\/}) if [[ -e .env.example ]]; then echo "env replacement"...
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/workflow_steps/step_azure_login.yml.jinja2
- name: {{ step_name }} uses: azure/login@v1 with: creds: ${{ '{{' }} secrets.AZURE_CREDENTIALS }}
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/workflow_steps/step_yml_create_aoai.yml.jinja2
- name: {{ step_name }} working-directory: ${{ '{{' }} github.workspace }} run: pf connection create --file {{ yaml_name }} --set api_key=${{ '{{' }} secrets.AOAI_API_KEY_TEST }} api_base=${{ '{{' }} secrets.AOAI_API_ENDPOINT_TEST }}
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/workflow_steps/step_extract_steps_and_run_gpt4.yml.jinja2
- name: {{ step_name }} working-directory: ${{ '{{' }} github.workspace }} run: | python scripts/readme/extract_steps_from_readme.py -f {{ readme_name }} -o {{ working_dir }} - name: Cat script working-directory: {{ working_dir }} run: | cat bash_script.sh - name: Run scripts against canary workspace (s...
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/workflow_steps/step_install_dev_deps.yml.jinja2
- name: {{ step_name }} working-directory: examples run: | python -m pip install --upgrade pip pip install -r dev_requirements.txt
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/workflow_steps/step_install_deps.yml.jinja2
- name: {{ step_name }} working-directory: examples run: | if [[ -e requirements.txt ]]; then python -m pip install --upgrade pip pip install -r requirements.txt fi
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/workflow_steps/step_env_create_aoai.yml.jinja2
- name: {{ step_name }} working-directory: {{ working_dir }} run: | if [[ -e .env ]]; then pf connection create --file .env --name {{ connection_name }} fi if [[ -e azure_openai.yml ]]; then pf connection create --file azure_openai.yml --name {{ connection_name }} fi pf connection li...
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/workflow_steps/step_create_env_gpt4.yml.jinja2
- name: {{ step_name }} working-directory: {{ working_dir }} run: | AOAI_API_KEY=${{ '{{' }} secrets.AOAI_GPT_4V_KEY }} AOAI_API_ENDPOINT=${{ '{{' }} secrets.AOAI_GPT_4V_ENDPOINT }} AOAI_API_ENDPOINT=$(echo ${AOAI_API_ENDPOINT//\//\\/}) cp ../../../connections/azure_openai.yml ./azure_openai.yml ...
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/workflow_steps/step_create_run_yml.yml.jinja2
- name: {{ step_name }} working-directory: {{ working_dir }} run: | gpt_base=${{ '{{' }} secrets.AOAI_API_ENDPOINT_TEST }} gpt_base=$(echo ${gpt_base//\//\\/}) if [[ -e run.yml ]]; then sed -i -e "s/\${azure_open_ai_connection.api_key}/${{ '{{' }} secrets.AOAI_API_KEY_TEST }}/g" -e "s/\${azure_ope...
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/workflow_templates/flow_as_function.yml.jinja2
{% 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...
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/workflow_templates/workflow_skeleton.yml.jinja2
# This code is autogenerated. # Code is generated by running custom script: python3 readme.py # Any manual changes to this file may cause incorrect behavior. # Any manual changes will be overwritten if the code is regenerated. name: {{ workflow_name }} on: schedule: - cron: "{{ crontab }}" # {{ crontab_comment }...
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/workflow_templates/pdf_workflow.yml.jinja2
{% extends "workflow_skeleton.yml.jinja2" %} {% block steps %} runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Generate config.json for canary workspace (scheduled runs only) if: github.event_name == 'schedule' run: echo '${{ '{{' }} secrets.TEST_WORKSPACE_CON...
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/workflow_templates/workflow_config_json.yml.jinja2
{% extends "workflow_skeleton.yml.jinja2" %} {% block steps %} runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Generate config.json for canary workspace (scheduled runs only) if: github.event_name == 'schedule' run: echo '${{ '{{' }} secrets.TEST_WORKSPACE_CON...
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/workflow_templates/basic_workflow_replace.yml.jinja2
{% extends "workflow_skeleton.yml.jinja2" %} {% block steps %} runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup Python 3.9 environment uses: actions/setup-python@v4 with: python-version: "3.9" {%- filter indent(width=2) -%} {% for step in steps %} {...
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/workflow_templates/basic_workflow.yml.jinja2
{% 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...
0
promptflow_repo/promptflow/scripts/readme/ghactions_driver
promptflow_repo/promptflow/scripts/readme/ghactions_driver/workflow_templates/basic_workflow_replace_config_json.yml.jinja2
{% extends "workflow_skeleton.yml.jinja2" %} {% block steps %} runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup Python 3.9 environment uses: actions/setup-python@v4 with: python-version: "3.9" - name: Generate config.json for canary workspace (sch...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/json_schema/gen_json_schema.py
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- # flake8: noqa # This file is part of scripts\generate_json_schema.py in sdk-cli-v2, which is used to generate json schema # To use this sc...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/json_schema/EagerFlow.schema.json
{ "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "EagerFlowSchema": { "properties": { "additional_includes": { "title": "additional_includes", "type": "array", "items": { ...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/json_schema/Flow.schema.json
{ "type": "object", "oneOf": [ { "properties": { "additional_includes": { "title": "additional_includes", "type": "array", "items": { "title": "additional_includes", "t...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/building/release-env.yml
name: release-env channels: - defaults - conda-forge dependencies: - pip - pip: - setuptools - twine==4.0.0 - portalocker~=1.2 - setuptools_rust - pytest - pytest-xdist - pytest-sugar - pytest-timeout - azure-keyvault - azure-identity
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/building/dev_setup.py
import argparse from pathlib import Path from platform import system from utils import print_blue, run_command def setup_promptflow(extra_deps: list, command_args: dict) -> None: print_blue("- Setting up the promptflow SDK ") print_blue("- Installing promptflow Python SDK from local directory") package_l...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/building/utils.py
import logging import os import subprocess import sys import time import traceback module_logger = logging.getLogger(__name__) class Color: PURPLE = "\033[95m" CYAN = "\033[96m" DARKCYAN = "\033[36m" BLUE = "\033[94m" GREEN = "\033[92m" YELLOW = "\033[93m" RED = "\033[91m" BOLD = "\03...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/building/run_coverage_tests.py
import argparse import os import sys from pathlib import Path from utils import Color, run_command, print_red if __name__ == "__main__": parser = argparse.ArgumentParser(description=Color.RED + "Test Coverage for Promptflow!" + Color.END + "\n") parser.add_argument("-p", required=True, nargs="+", help="The p...
0
promptflow_repo/promptflow/scripts
promptflow_repo/promptflow/scripts/building/generate_connection_config.py
import argparse import json from pathlib import Path from azure.keyvault.secrets import SecretClient from azure.identity import ClientSecretCredential, DefaultAzureCredential CONNECTION_FILE_NAME = "connections.json" CONNECTION_TPL_FILE_PATH = Path(".") / "src/promptflow" / "dev-connections.json.example" def get_s...
0
promptflow_repo/promptflow/scripts/installer
promptflow_repo/promptflow/scripts/installer/curl_install_pypi/install.py
#!/usr/bin/env python # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ---------------------------------------------...
0
promptflow_repo/promptflow/scripts/installer
promptflow_repo/promptflow/scripts/installer/curl_install_pypi/install
#!/usr/bin/env bash #--------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. #------------------------------------------------...
0
promptflow_repo/promptflow/scripts/installer
promptflow_repo/promptflow/scripts/installer/curl_install_pypi/README.md
# Curl Install Script Information The scripts in this directory are used for installing through curl and they point to the packages on PyPI. ## Install or update promptflow curl https://promptflowartifact.blob.core.windows.net/linux-install-scripts/install | bash The script can also be downloaded and run locally. Y...
0
promptflow_repo/promptflow/scripts/installer
promptflow_repo/promptflow/scripts/installer/windows/product.wxs
<?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" ...
0
promptflow_repo/promptflow/scripts/installer
promptflow_repo/promptflow/scripts/installer/windows/install_from_msi.md
# Install prompt flow MSI installer on Windows Prompt flow is a suite of development tools designed to streamline the end-to-end development cycle of LLM-based AI applications, that can be installed locally on Windows computers. For Windows, the prompt flow is installed via an MSI, which gives you access to the CLI ...
0
promptflow_repo/promptflow/scripts/installer
promptflow_repo/promptflow/scripts/installer/windows/README.md
# Building the Windows MSI Installer This document provides instructions on creating the MSI installer. ## Option1: Building with Github Actions Trigger the [workflow](https://github.com/microsoft/promptflow/actions/workflows/build_msi_installer.yml) manually. ## Option2: Local Building ### Prerequisites 1. Turn o...
0
promptflow_repo/promptflow/scripts/installer
promptflow_repo/promptflow/scripts/installer/windows/promptflow.wixproj
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <!-- Project --> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">x86<...
0
promptflow_repo/promptflow/scripts/installer/windows
promptflow_repo/promptflow/scripts/installer/windows/scripts/promptflow.spec
# -*- mode: python ; coding: utf-8 -*- from PyInstaller.utils.hooks import collect_data_files from PyInstaller.utils.hooks import copy_metadata datas = [('../resources/CLI_LICENSE.rtf', '.'), ('../../../../src/promptflow/NOTICE.txt', '.'), ('../../../../src/promptflow/promptflow/_sdk/data/executable/', './promptflow/_...
0
promptflow_repo/promptflow/scripts/installer/windows
promptflow_repo/promptflow/scripts/installer/windows/scripts/pfs.bat
@echo off setlocal set MAIN_EXE=%~dp0.\pfcli.exe "%MAIN_EXE%" pfs %*
0
promptflow_repo/promptflow/scripts/installer/windows
promptflow_repo/promptflow/scripts/installer/windows/scripts/promptflow_service.vbs
DIM objshell set objshell = wscript.createobject("wscript.shell") iReturn = objshell.run("pfs.bat start --force", 0, true)
0
promptflow_repo/promptflow/scripts/installer/windows
promptflow_repo/promptflow/scripts/installer/windows/scripts/version_info.txt
# UTF-8 # # For more details about fixed file info 'ffi' see: # http://msdn.microsoft.com/en-us/library/ms646997.aspx VSVersionInfo( ffi=FixedFileInfo( # filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4) # Set not needed items to zero 0. filevers=($(env.FILE_VERSION)), prod...
0
promptflow_repo/promptflow/scripts/installer/windows
promptflow_repo/promptflow/scripts/installer/windows/scripts/pfcli.py
import sys import multiprocessing # use this file as the only entry point for the CLI to avoid packaging the same environment repeatedly if __name__ == "__main__": multiprocessing.freeze_support() command = sys.argv[1] if len(sys.argv) > 1 else None sys.argv = sys.argv[1:] if command == 'pf': ...
0
promptflow_repo/promptflow/scripts/installer/windows
promptflow_repo/promptflow/scripts/installer/windows/scripts/pfsvc.bat
@echo off setlocal set MAIN_EXE=%~dp0.\pfcli.exe "%MAIN_EXE%" pfsvc %*
0
promptflow_repo/promptflow/scripts/installer/windows
promptflow_repo/promptflow/scripts/installer/windows/scripts/pf.bat
@echo off setlocal SET PF_INSTALLER=MSI set MAIN_EXE=%~dp0.\pfcli.exe "%MAIN_EXE%" pf %*
0
promptflow_repo/promptflow/scripts/installer/windows
promptflow_repo/promptflow/scripts/installer/windows/scripts/pfazure.bat
@echo off setlocal set MAIN_EXE=%~dp0.\pfcli.exe "%MAIN_EXE%" pfazure %*
0
promptflow_repo/promptflow/scripts/installer/windows
promptflow_repo/promptflow/scripts/installer/windows/resources/CLI_LICENSE.rtf
{\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf820 {\fonttbl\f0\fnil\fcharset0 Tahoma;\f1\froman\fcharset0 TimesNewRomanPSMT;\f2\ftech\fcharset77 Symbol; } {\colortbl;\red255\green255\blue255;\red0\green0\blue255;} {\*\expandedcolortbl;;\csgenericrgb\c0\c0\c100000;} {\*\listtable{\list\listtemplateid1\listhybrid{\list...
0
promptflow_repo/promptflow/src
promptflow_repo/promptflow/src/promptflow/dev-connections.json.example
{ "azure_open_ai_connection": { "type": "AzureOpenAIConnection", "value": { "api_key": "aoai-api-key", "api_base": "aoai-api-endpoint", "api_type": "azure", "api_version": "2023-07-01-preview" }, "module": "promptflow.connections" }, "bing_config": { "type": "BingConnec...
0
promptflow_repo/promptflow/src
promptflow_repo/promptflow/src/promptflow/pyproject.toml
[tool.black] line-length = 120 [tool.pytest.ini_options] markers = [ "sdk_test", "cli_test", "unittest", "e2etest", "flaky", "endpointtest", "mt_endpointtest", ] [tool.coverage.run] omit = [ # omit anything in a _restclient directory anywhere "*/_restclient/*", ]
0
promptflow_repo/promptflow/src
promptflow_repo/promptflow/src/promptflow/pf
#!/usr/bin/env python import sys import os if os.environ.get('PF_INSTALLER') is None: os.environ['PF_INSTALLER'] = 'PIP' os.execl(sys.executable, sys.executable, '-m', 'promptflow._cli._pf.entry', *sys.argv[1:])
0
promptflow_repo/promptflow/src
promptflow_repo/promptflow/src/promptflow/dev_requirements.txt
azure-identity azure-keyvault beautifulsoup4==4.12.2 coverage keyrings.alt # this is possibly insecure, do not add this to setup.py mock nox portalocker~=1.2 pre-commit # promptflow-tools Comment this since it will take in unecessary dependencies pydash PyJWT==2.8.0 # parse token to get tenant id during sanitization ...
0
promptflow_repo/promptflow/src
promptflow_repo/promptflow/src/promptflow/MANIFEST.in
include promptflow/azure/resources/* include promptflow/_sdk/_serving/static/* recursive-include promptflow/_cli/data * recursive-include promptflow/_sdk/data *
0