promptflow.entities module#
- class promptflow.entities.AzureContentSafetyConnection(api_key: str, endpoint: str, api_version: str = '2023-10-01', api_type: str = 'Content Safety', **kwargs)#
Bases:
AzureContentSafetyConnection
,_StrongTypeConnection
Azure Content Safety connection.
- Parameters:
api_key (str) β The api key.
endpoint (str) β The api endpoint.
api_version (str) β The api version, default see:
AZURE_CONTENT_SAFETY
.api_type (str) β The api type, default βContent Safetyβ.
name (str) β Connection name.
- DATA_CLASS#
alias of
AzureContentSafetyConnection
- class promptflow.entities.AzureOpenAIConnection(api_base: str, api_key: Optional[str] = None, api_type: str = 'azure', api_version: str = '2024-02-01', auth_mode: str = 'key', resource_id: Optional[str] = None, **kwargs)#
Bases:
AzureOpenAIConnection
,_StrongTypeConnection
Azure OpenAI connection.
- Parameters:
api_key (str) β The api key.
api_base (str) β The api base.
api_type (str) β The api type, default βazureβ.
api_version (str) β The api version, default see:
AZURE_OPEN_AI
auth_mode (str) β The auth mode, supported values see:
ConnectionAuthMode
.resource_id (str) β Optional, the arm resource id.
name (str) β Connection name.
- DATA_CLASS#
alias of
AzureOpenAIConnection
- class promptflow.entities.CognitiveSearchConnection(api_base: str, api_key: Optional[str] = None, api_version: str = '2023-11-01', auth_mode: str = 'key', **kwargs)#
Bases:
CognitiveSearchConnection
,_StrongTypeConnection
Cognitive Search connection.
- Parameters:
api_key (str) β The api key.
api_base (str) β The api base.
api_version (str) β The api version, default β2023-11-01β.
auth_mode (str) β The auth mode, supported values see:
ConnectionAuthMode
.name (str) β Connection name.
- DATA_CLASS#
alias of
CognitiveSearchConnection
- class promptflow.entities.CustomConnection(secrets: Dict[str, str], configs: Optional[Dict[str, str]] = None, **kwargs)#
Bases:
CustomConnection
,_Connection
Custom connection.
- Parameters:
configs (Dict[str, str]) β The configs kv pairs.
secrets (Dict[str, str]) β The secrets kv pairs.
name (str) β Connection name
- DATA_CLASS#
alias of
CustomConnection
- class promptflow.entities.DynamicList(function: dataclasses.InitVar[Union[str, Callable]], input_mapping: dataclasses.InitVar[Dict] = None)#
Bases:
object
- func_kwargs: List#
- func_path: str#
- function: dataclasses.InitVar[Union[str, Callable]]#
The dynamic list function.
- input_mapping: dataclasses.InitVar[Dict] = None#
The mapping between dynamic list function inputs and tool inputs.
- class promptflow.entities.FlowContext(*, connections=None, variant=None, overrides=None, streaming=None)#
Bases:
object
Flow context entity. the settings on this context will be applied to the flow when executing.
- Parameters:
connections (Optional[Dict[str, Dict]]) β Connections for the flow.
variant (Optional[Dict[str, Dict]]) β Variant of the flow.
variant β Overrides of the flow.
streaming (Optional[bool]) β Whether the flowβs output need to be return in streaming mode.
- class promptflow.entities.FormRecognizerConnection(api_key: str, endpoint: str, api_version: str = '2023-07-31', api_type: str = 'Form Recognizer', **kwargs)#
Bases:
FormRecognizerConnection
,AzureContentSafetyConnection
Form Recognizer connection.
- Parameters:
api_key (str) β The api key.
endpoint (str) β The api endpoint.
api_version (str) β The api version, default see:
FORM_RECOGNIZER
.api_type (str) β The api type, default βForm Recognizerβ.
name (str) β Connection name.
- DATA_CLASS#
alias of
FormRecognizerConnection
- class promptflow.entities.InputSetting(**kwargs)#
Bases:
object
Settings of the tool input
- allow_manual_entry: bool = None#
Allow user to enter input value manually.
- dynamic_list: DynamicList = None#
Settings of dynamic list function.
- enabled_by: str = None#
The input field which must be an enum type, that controls the visibility of the dependent input field.
- enabled_by_value: List = None#
Defines the accepted enum values from the enabled_by field that will make this dependent input field visible.
- generated_by: GeneratedBy = None#
Settings of generated by function.
- is_multi_select: bool = None#
Allow user to select multiple values.
- class promptflow.entities.OpenAIConnection(api_key: str, organization: Optional[str] = None, base_url=None, **kwargs)#
Bases:
OpenAIConnection
,_StrongTypeConnection
OpenAI connection.
- Parameters:
api_key (str) β The api key.
organization (str) β Optional. The unique identifier for your organization which can be used in API requests.
base_url (str) β Optional. Specify when use customized api base, leave None to use OpenAI default api base.
name (str) β Connection name.
- DATA_CLASS#
alias of
OpenAIConnection
- class promptflow.entities.QdrantConnection(api_key: str, api_base: str, **kwargs)#
Bases:
QdrantConnection
,_StrongTypeConnection
Qdrant connection.
- Parameters:
api_key (str) β The api key.
api_base (str) β The api base.
name (str) β Connection name.
- DATA_CLASS#
alias of
QdrantConnection
- class promptflow.entities.Run(flow: Optional[Union[str, Path]] = None, name: Optional[str] = None, data: Optional[str] = None, variant: Optional[str] = None, run: Optional[Union[Run, str]] = None, column_mapping: Optional[dict] = None, display_name: Optional[str] = None, description: Optional[str] = None, tags: Optional[List[Dict[str, str]]] = None, *, created_on: Optional[datetime] = None, start_time: Optional[datetime] = None, end_time: Optional[datetime] = None, status: Optional[str] = None, environment_variables: Optional[Dict[str, str]] = None, connections: Optional[Dict[str, Dict]] = None, properties: Optional[Dict[str, Any]] = None, source: Optional[Union[str, Path]] = None, init: Optional[Dict[str, Any]] = None, **kwargs)#
Bases:
YAMLTranslatableMixin
Flow run entity.
- Parameters:
flow (Path) β Path of local flow entry or remote flow.
name (str) β Name of the run.
data (Optional[str]) β Input data for the run. Local path or remote uri(starts with azureml: or public URL) are supported. Note: remote uri is only supported for cloud run. # noqa: E501
variant (Optional[str]) β Variant of the run.
run (Optional[Union[Run, str]]) β Parent run or run ID.
column_mapping (Optional[dict]) β Column mapping for the run. Optional since itβs not stored in the database.
display_name (Optional[str]) β Display name of the run.
description (Optional[str]) β Description of the run.
tags (Optional[List[Dict[str, str]]]) β Tags of the run.
created_on (Optional[datetime.datetime]) β Date and time the run was created.
start_time (Optional[datetime.datetime]) β Date and time the run started.
end_time (Optional[datetime.datetime]) β Date and time the run ended.
status (Optional[str]) β Status of the run.
environment_variables (Optional[Dict[str, str]]) β Environment variables for the run.
connections (Optional[Dict[str, Dict]]) β Connections for the run.
properties (Optional[Dict[str, Any]]) β Properties of the run.
init (Optional[Dict[str, Any]]) β Class init arguments for callable class, only supported for flex flow.
kwargs (Optional[dict]) β Additional keyword arguments.
- property created_on: str#
- property init#
- property properties: Dict[str, str]#
- property status: str#
- class promptflow.entities.SerpConnection(api_key: str, **kwargs)#
Bases:
SerpConnection
,_StrongTypeConnection
Serp connection.
- Parameters:
api_key (str) β The api key.
name (str) β Connection name.
- DATA_CLASS#
alias of
SerpConnection