text stringlengths 13 1.77M | id stringlengths 22 127 | metadata dict | __index_level_0__ int64 0 28 |
|---|---|---|---|
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/Flow.schema.json
inputs:
chat_history:
type: list
is_chat_history: true
default: []
question:
type: string
is_chat_input: true
outputs:
answer:
type: string
reference: ${chat.output}
is_chat_output: true
nodes:
- name:... | promptflow/src/promptflow/promptflow/_cli/data/chat_flow/template/flow.dag.yaml.jinja2/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_cli/data/chat_flow/template/flow.dag.yaml.jinja2",
"repo_id": "promptflow",
"token_count": 257
} | 8 |
import yaml
import logging
import tempfile
import hashlib
from pathlib import Path
logger = logging.getLogger(__name__)
package_name = "{{ package_name }}"
def list_package_tools(raise_error=False):
"""
List the meta of all tools in the package.
The key of meta dict is the module name of tools and value... | promptflow/src/promptflow/promptflow/_cli/data/package_tool/utils.py.jinja2/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_cli/data/package_tool/utils.py.jinja2",
"repo_id": "promptflow",
"token_count": 361
} | 9 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import asyncio
import functools
import importlib
import logging
import os
from importlib.metadata import version
import openai
from promp... | promptflow/src/promptflow/promptflow/_core/openai_injector.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_core/openai_injector.py",
"repo_id": "promptflow",
"token_count": 2929
} | 10 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
from promptflow._sdk._orm.run_info import RunInfo
from pr... | promptflow/src/promptflow/promptflow/_sdk/_orm/__init__.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_sdk/_orm/__init__.py",
"repo_id": "promptflow",
"token_count": 198
} | 11 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import inspect
from pathlib import Path
from flask import jsonify, request
import promptflow._sdk.schemas._connection as connection
from ... | promptflow/src/promptflow/promptflow/_sdk/_service/apis/connection.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_sdk/_service/apis/connection.py",
"repo_id": "promptflow",
"token_count": 3034
} | 12 |
# ---------------------------------------------------------
# Copyright (c) 2013-2022 Caleb P. Burns credits dahlia <https://github.com/dahlia>
# Licensed under the MPLv2 License. See License.txt in the project root for
# license information.
# ---------------------------------------------------------
"""
This file cod... | promptflow/src/promptflow/promptflow/_sdk/_vendor/_pathspec.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_sdk/_vendor/_pathspec.py",
"repo_id": "promptflow",
"token_count": 10455
} | 13 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
# pylint: disable=protected-access
import json
import typing
from marshmallow import Schema, ValidationError
from promptflow._utils.logg... | promptflow/src/promptflow/promptflow/_sdk/entities/_validation/schema.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_sdk/entities/_validation/schema.py",
"repo_id": "promptflow",
"token_count": 2108
} | 14 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import copy
import typing
from pathlib import Path
from marshmallow import fields
from marshmallow.exceptions import FieldInstanceResolutio... | promptflow/src/promptflow/promptflow/_sdk/schemas/_fields.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_sdk/schemas/_fields.py",
"repo_id": "promptflow",
"token_count": 4708
} | 15 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import re
from typing import Any, Dict, Mapping
from promptflow._constants import LINE_NUMBER_KEY
from promptflow._utils.logger_utils impor... | promptflow/src/promptflow/promptflow/_utils/inputs_mapping_utils.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/_utils/inputs_mapping_utils.py",
"repo_id": "promptflow",
"token_count": 1662
} | 16 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
from pathlib import Path
RESOURCE_FOLDER = Path(__file__).parent.parent / "resources"
COMMAND_COMPONENT_SPEC_TEMPLATE = RESOURCE_FOLDER / ... | promptflow/src/promptflow/promptflow/azure/_constants/_component.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/azure/_constants/_component.py",
"repo_id": "promptflow",
"token_count": 102
} | 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/aio/_azure_machine_learning_designer_service_client.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/azure/_restclient/flow/aio/_azure_machine_learning_designer_service_client.py",
"repo_id": "promptflow",
"token_count": 1941
} | 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/models/__init__.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/azure/_restclient/flow/models/__init__.py",
"repo_id": "promptflow",
"token_count": 33794
} | 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/_trace_sessions_operations.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/azure/_restclient/flow/operations/_trace_sessions_operations.py",
"repo_id": "promptflow",
"token_count": 4169
} | 20 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
# pylint: disable=protected-access
import copy
import json
import os
import re
from datetime import datetime
from functools import cached_pr... | promptflow/src/promptflow/promptflow/azure/operations/_flow_operations.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/azure/operations/_flow_operations.py",
"repo_id": "promptflow",
"token_count": 10428
} | 21 |
# ---------------------------------------------------------
# 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
} | 22 |
# ---------------------------------------------------------
# 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
} | 23 |
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
from promptflow._core.tool import ToolInvoker
class DefaultToolInvoker(ToolInvoker):
def invoke_tool(self, f, *args, **kwargs):
... | promptflow/src/promptflow/promptflow/executor/_tool_invoker.py/0 | {
"file_path": "promptflow/src/promptflow/promptflow/executor/_tool_invoker.py",
"repo_id": "promptflow",
"token_count": 89
} | 24 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.