promptflow.contracts.run_info module#

class promptflow.contracts.run_info.FlowRunInfo(run_id: str, status: Status, error: object, inputs: object, output: object, metrics: Dict[str, Any], request: object, parent_run_id: str, root_run_id: str, source_run_id: str, flow_id: str, start_time: datetime, end_time: datetime, index: Optional[int] = None, api_calls: Optional[List[Dict[str, Any]]] = None, name: str = '', description: str = '', tags: Optional[Mapping[str, str]] = None, system_metrics: Optional[Dict[str, Any]] = None, result: Optional[object] = None, upload_metrics: bool = False, otel_trace_id: Optional[str] = '', message_format: str = 'basic')#

Bases: object

A dataclass representing the run information.

Parameters:
  • run_id (str) – The id of the run, which equals flow_run_id:child_flow_run_id

  • status (Status) – Status of the flow run

  • error (Dict[str, Any]) – Errors occurred during the flow run

  • inputs (object) – Inputs for the flow run

  • output (object) – Output of the flow run

  • metrics (Dict[str, Any]) – Metrics of the flow run

  • request (object) – Request made for the flow run

  • parent_run_id (str) – Parent run id of the flow run

  • root_run_id (str) – Root run id of the flow run

  • source_run_id (str) – The run id of the run that triggered the flow run

  • flow_id (str) – Flow id of the flow run

  • start_time (datetime) – Start time of the flow run

  • end_time (datetime) – End time of the flow run

  • index (Optional[int]) – Index of the flow run (used for bulk test mode)

  • api_calls (Optional[List[Dict[str, Any]]]) – API calls made during the flow run

  • name (Optional[str]) – Name of the flow run

  • description (Optional[str]) – Description of the flow run

  • tags (Optional[Dict[str, str]]) – Tags of the flow run

  • system_metrics (Optional[Dict[str, Any]]) – System metrics of the flow run

  • result (Optional[object]) – Result of the flow run

  • upload_metrics (Optional[bool]) – Flag indicating whether to upload metrics for the flow run

  • message_format (str) – The message format type to represent different multimedia contracts.

api_calls: Optional[List[Dict[str, Any]]] = None#
static create_with_error(start_time, inputs, index, run_id, error)#
description: str = ''#
static deserialize(data: dict) FlowRunInfo#

Deserialize the FlowRunInfo from a dict.

end_time: datetime#
error: object#
flow_id: str#
index: Optional[int] = None#
inputs: object#
message_format: str = 'basic'#
metrics: Dict[str, Any]#
name: str = ''#
otel_trace_id: Optional[str] = ''#
output: object#
parent_run_id: str#
request: object#
result: object = None#
root_run_id: str#
run_id: str#
source_run_id: str#
start_time: datetime#
status: Status#
system_metrics: Dict[str, Any] = None#
tags: Optional[Mapping[str, str]] = None#
upload_metrics: bool = False#
class promptflow.contracts.run_info.RunInfo(node: str, flow_run_id: str, run_id: str, status: Status, inputs: Mapping[str, Any], output: object, metrics: Dict[str, Any], error: Dict[str, Any], parent_run_id: str, start_time: datetime, end_time: datetime, index: Optional[int] = None, api_calls: Optional[List[Dict[str, Any]]] = None, cached_run_id: Optional[str] = None, cached_flow_run_id: Optional[str] = None, logs: Optional[Dict[str, str]] = None, system_metrics: Optional[Dict[str, Any]] = None, result: Optional[object] = None, message_format: str = 'basic')#

Bases: object

A dataclass representing the run information.

Parameters:
  • node (str) – Node name

  • flow_run_id (str) – The id of the flow run

  • run_id (str) – The id of the run, which equals flow_run_id:step_run_id

  • status (Status) – Status of the run

  • inputs (list) – List of inputs for the run

  • output (object) – Output of the run

  • metrics (Dict[str, Any]) – Metrics of the run

  • error (Dict[str, Any]) – Errors occurred during the run

  • parent_run_id (str) – Parent run id

  • start_time (datetime) – Start time of the run

  • end_time (datetime) – End time of the run

  • index (Optional[int]) – Index of the run

  • api_calls (Optional[List[Dict[str, Any]]]) – API calls made during the run

  • cached_run_id (Optional[str]) – Cached run id

  • cached_flow_run_id (Optional[str]) – Cached flow run id

  • logs (Optional[Dict[str, str]]) – Logs of the run

  • system_metrics (Optional[Dict[str, Any]]) – System metrics of the run

  • result (Optional[object]) – Result of the run

  • message_format (str) – The message format type to represent different multimedia contracts.

api_calls: Optional[List[Dict[str, Any]]] = None#
cached_flow_run_id: str = None#
cached_run_id: str = None#
static deserialize(data: dict) RunInfo#

Deserialize the RunInfo from a dict.

end_time: datetime#
error: Dict[str, Any]#
flow_run_id: str#
index: Optional[int] = None#
inputs: Mapping[str, Any]#
logs: Optional[Dict[str, str]] = None#
message_format: str = 'basic'#
metrics: Dict[str, Any]#
node: str#
output: object#
parent_run_id: str#
result: object = None#
run_id: str#
start_time: datetime#
status: Status#
system_metrics: Dict[str, Any] = None#
class promptflow.contracts.run_info.Status(value)#

Bases: Enum

An enumeration class for different types of run status.

Bypassed = 'Bypassed'#
CancelRequested = 'CancelRequested'#
Canceled = 'Canceled'#
Completed = 'Completed'#
Failed = 'Failed'#
NotStarted = 'NotStarted'#
Preparing = 'Preparing'#
Running = 'Running'#
static is_terminated(status)#

Check if a given status is terminated.

Parameters:

status (str or Status) – The status to be checked

Returns:

True if the status is terminated, False otherwise

Return type:

bool