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