ibm-watsonx-orchestrate 1.10.2__py3-none-any.whl → 1.11.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. ibm_watsonx_orchestrate/__init__.py +2 -1
  2. ibm_watsonx_orchestrate/agent_builder/agents/types.py +13 -0
  3. ibm_watsonx_orchestrate/agent_builder/connections/types.py +53 -6
  4. ibm_watsonx_orchestrate/agent_builder/knowledge_bases/types.py +25 -10
  5. ibm_watsonx_orchestrate/cli/commands/agents/agents_command.py +10 -2
  6. ibm_watsonx_orchestrate/cli/commands/agents/agents_controller.py +404 -173
  7. ibm_watsonx_orchestrate/cli/commands/connections/connections_command.py +33 -4
  8. ibm_watsonx_orchestrate/cli/commands/connections/connections_controller.py +62 -6
  9. ibm_watsonx_orchestrate/cli/commands/copilot/copilot_controller.py +6 -2
  10. ibm_watsonx_orchestrate/cli/commands/environment/environment_command.py +1 -1
  11. ibm_watsonx_orchestrate/cli/commands/evaluations/evaluations_command.py +174 -2
  12. ibm_watsonx_orchestrate/cli/commands/evaluations/evaluations_controller.py +93 -9
  13. ibm_watsonx_orchestrate/cli/commands/server/server_command.py +0 -3
  14. ibm_watsonx_orchestrate/cli/commands/server/types.py +15 -7
  15. ibm_watsonx_orchestrate/client/base_api_client.py +31 -10
  16. ibm_watsonx_orchestrate/client/connections/connections_client.py +14 -0
  17. ibm_watsonx_orchestrate/client/service_instance.py +19 -34
  18. ibm_watsonx_orchestrate/client/utils.py +3 -1
  19. ibm_watsonx_orchestrate/docker/compose-lite.yml +16 -11
  20. ibm_watsonx_orchestrate/docker/default.env +15 -13
  21. ibm_watsonx_orchestrate/flow_builder/data_map.py +4 -1
  22. ibm_watsonx_orchestrate/flow_builder/flows/flow.py +117 -7
  23. ibm_watsonx_orchestrate/flow_builder/node.py +76 -5
  24. ibm_watsonx_orchestrate/flow_builder/types.py +344 -10
  25. {ibm_watsonx_orchestrate-1.10.2.dist-info → ibm_watsonx_orchestrate-1.11.0.dist-info}/METADATA +2 -2
  26. {ibm_watsonx_orchestrate-1.10.2.dist-info → ibm_watsonx_orchestrate-1.11.0.dist-info}/RECORD +29 -29
  27. {ibm_watsonx_orchestrate-1.10.2.dist-info → ibm_watsonx_orchestrate-1.11.0.dist-info}/WHEEL +0 -0
  28. {ibm_watsonx_orchestrate-1.10.2.dist-info → ibm_watsonx_orchestrate-1.11.0.dist-info}/entry_points.txt +0 -0
  29. {ibm_watsonx_orchestrate-1.10.2.dist-info → ibm_watsonx_orchestrate-1.11.0.dist-info}/licenses/LICENSE +0 -0
@@ -6,14 +6,14 @@ import yaml
6
6
  from pydantic import BaseModel, Field, SerializeAsAny, create_model
7
7
  from enum import Enum
8
8
 
9
- from .types import DocExtConfigField, EndNodeSpec, NodeSpec, AgentNodeSpec, PromptNodeSpec, TimerNodeSpec, StartNodeSpec, ToolNodeSpec, UserFieldKind, UserFieldOption, UserNodeSpec, DocProcSpec, \
9
+ from .types import Assignment, DocExtConfigField, EndNodeSpec, NodeSpec, AgentNodeSpec, PromptNodeSpec, TimerNodeSpec, StartNodeSpec, ToolNodeSpec, UserFieldKind, UserFieldOption, UserNodeSpec, DocProcSpec, \
10
10
  DocExtSpec, DocExtConfig, DocClassifierSpec, DecisionsNodeSpec, DocClassifierConfig
11
11
 
12
12
  from .data_map import DataMap
13
13
 
14
14
  class Node(BaseModel):
15
15
  spec: SerializeAsAny[NodeSpec]
16
- input_map: DataMap | None = None
16
+ input_map: dict[str, DataMap] | None = None
17
17
 
18
18
  def __call__(self, **kwargs):
19
19
  pass
@@ -40,10 +40,77 @@ class Node(BaseModel):
40
40
  def to_json(self) -> dict[str, Any]:
41
41
  model_spec = {}
42
42
  model_spec["spec"] = self.spec.to_json()
43
- if self.input_map is not None:
44
- model_spec['input_map'] = self.input_map.to_json()
43
+ if self.input_map is not None and "spec" in self.input_map:
44
+ model_spec['input_map'] = {
45
+ "spec": self.input_map["spec"].to_json()
46
+ }
45
47
 
46
48
  return model_spec
49
+
50
+ def map_node_input_with_variable(self, target_input_variable: str, variable: str, default_value: str = None) -> None:
51
+ if self.input_map and "spec" in self.input_map:
52
+ maps = self.input_map["spec"].maps or []
53
+ else:
54
+ maps = []
55
+
56
+ curr_map_metadata = {
57
+ "assignmentType": "variable"
58
+ }
59
+
60
+ target_variable = "self.input." + target_input_variable
61
+ value_expression = "flow." + variable
62
+
63
+ if default_value:
64
+ maps.append(Assignment(target_variable=target_variable, value_expression=value_expression, default_value=default_value, metadata=curr_map_metadata))
65
+ else:
66
+ maps.append(Assignment(target_variable=target_variable, value_expression=value_expression, metadata=curr_map_metadata))
67
+
68
+ node_input_map_spec = DataMap(maps=maps)
69
+ if self.input_map and "spec" in self.input_map:
70
+ self.input_map["spec"] = node_input_map_spec
71
+ else:
72
+ self.input_map = {"spec": node_input_map_spec}
73
+
74
+ def map_input(self, input_variable: str, expression: str, default_value: str = None) -> None:
75
+ if self.input_map and "spec" in self.input_map:
76
+ maps = self.input_map["spec"].maps or []
77
+ else:
78
+ maps = []
79
+
80
+ curr_map_metadata = {
81
+ "assignmentType": "pyExpression"
82
+ }
83
+
84
+ target_variable = "self.input." + input_variable
85
+ value_expression = expression
86
+
87
+ if default_value:
88
+ maps.append(Assignment(target_variable=target_variable, value_expression=value_expression, default_value=default_value, metadata=curr_map_metadata))
89
+ else:
90
+ maps.append(Assignment(target_variable=target_variable, value_expression=value_expression, metadata=curr_map_metadata))
91
+
92
+ node_input_map_spec = DataMap(maps=maps)
93
+ if self.input_map and "spec" in self.input_map:
94
+ self.input_map["spec"] = node_input_map_spec
95
+ else:
96
+ self.input_map = {"spec": node_input_map_spec}
97
+
98
+ def map_node_input_with_none(self, target_input_variable: str) -> None:
99
+ if self.input_map and "spec" in self.input_map:
100
+ maps = self.input_map["spec"].maps or []
101
+ else:
102
+ maps = []
103
+
104
+
105
+ target_variable = "self.input." + target_input_variable
106
+
107
+ maps.append(Assignment(target_variable=target_variable, value_expression=None))
108
+
109
+ node_input_map_spec = DataMap(maps=maps)
110
+ if self.input_map and "spec" in self.input_map:
111
+ self.input_map["spec"] = node_input_map_spec
112
+ else:
113
+ self.input_map = {"spec": node_input_map_spec}
47
114
 
48
115
  class StartNode(Node):
49
116
  def __repr__(self):
@@ -83,6 +150,8 @@ class UserNode(Node):
83
150
  option: UserFieldOption | None = None,
84
151
  min: Any | None = None,
85
152
  max: Any | None = None,
153
+ direction: str | None = None,
154
+ input_map: DataMap | None = None,
86
155
  is_list: bool = False,
87
156
  custom: dict[str, Any] | None = None,
88
157
  widget: str | None = None):
@@ -97,7 +166,9 @@ class UserNode(Node):
97
166
  max=max,
98
167
  is_list=is_list,
99
168
  custom=custom,
100
- widget=widget)
169
+ widget=widget,
170
+ direction=direction,
171
+ input_map=input_map)
101
172
 
102
173
  class AgentNode(Node):
103
174
  def __repr__(self):
@@ -28,6 +28,7 @@ from ibm_watsonx_orchestrate.agent_builder.tools.types import (
28
28
  )
29
29
  from .utils import get_valid_name
30
30
 
31
+
31
32
  logger = logging.getLogger(__name__)
32
33
 
33
34
  class JsonSchemaObjectRef(JsonSchemaObject):
@@ -337,13 +338,15 @@ class DocProcSpec(DocProcCommonNodeSpec):
337
338
  description="Optional list of key-value pair schemas to use for extraction.",
338
339
  default=None)
339
340
  plain_text_reading_order : PlainTextReadingOrder = Field(default=PlainTextReadingOrder.block_structure)
340
-
341
+ document_structure: bool = Field(default=False,description="Requests the entire document structure computed by WDU to be returned")
342
+
341
343
  def __init__(self, **data):
342
344
  super().__init__(**data)
343
345
  self.kind = "docproc"
344
346
 
345
347
  def to_json(self) -> dict[str, Any]:
346
348
  model_spec = super().to_json()
349
+ model_spec["document_structure"] = self.document_structure
347
350
  model_spec["task"] = self.task
348
351
  if self.plain_text_reading_order != PlainTextReadingOrder.block_structure:
349
352
  model_spec["plain_text_reading_order"] = self.plain_text_reading_order
@@ -360,7 +363,6 @@ class EndNodeSpec(NodeSpec):
360
363
  def __init__(self, **data):
361
364
  super().__init__(**data)
362
365
  self.kind = "end"
363
-
364
366
  class ToolNodeSpec(NodeSpec):
365
367
  tool: Union[str, ToolSpec] = Field(default = None, description="the tool to use")
366
368
 
@@ -421,9 +423,10 @@ class UserFieldKind(str, Enum):
421
423
  DateTime: str = "datetime"
422
424
  Time: str = "time"
423
425
  Number: str = "number"
424
- Document: str = "document"
426
+ File: str = "file"
425
427
  Boolean: str = "boolean"
426
428
  Object: str = "object"
429
+ Choice: str = "any"
427
430
 
428
431
  def convert_python_type_to_kind(python_type: type) -> "UserFieldKind":
429
432
  if inspect.isclass(python_type):
@@ -463,8 +466,8 @@ class UserFieldKind(str, Enum):
463
466
  model_spec["format"] = "number"
464
467
  elif kind == UserFieldKind.Boolean:
465
468
  model_spec["type"] = "boolean"
466
- elif kind == UserFieldKind.Document:
467
- model_spec["format"] = "uri"
469
+ elif kind == UserFieldKind.File:
470
+ model_spec["format"] = "wxo-file"
468
471
  elif kind == UserFieldKind.Object:
469
472
  raise ValueError("Object user fields are not supported.")
470
473
 
@@ -483,6 +486,8 @@ class UserField(BaseModel):
483
486
  text: str | None = Field(default=None, description="A descriptive text that can be used to ask user about this field.")
484
487
  display_name: str | None = None
485
488
  description: str | None = None
489
+ direction: str | None = None
490
+ input_map: Any | None = None,
486
491
  default: Any | None = None
487
492
  option: UserFieldOption | None = None
488
493
  min: Any | None = None,
@@ -497,6 +502,15 @@ class UserField(BaseModel):
497
502
  model_spec["name"] = self.name
498
503
  if self.kind:
499
504
  model_spec["kind"] = self.kind.value
505
+ if self.direction:
506
+ model_spec["direction"] = self.direction
507
+ if self.input_map:
508
+ # workaround for circular dependency related to Assigments in the Datamap module
509
+ from .data_map import DataMap
510
+ if self.input_map and not isinstance(self.input_map, DataMap):
511
+ raise TypeError("input_map must be an instance of DataMap")
512
+ #model_spec["input_map"] = self.input_map.to_json()
513
+ model_spec["input_map"] = {"spec": self.input_map.to_json()}
500
514
  if self.text:
501
515
  model_spec["text"] = self.text
502
516
  if self.display_name:
@@ -556,7 +570,15 @@ class UserNodeSpec(NodeSpec):
556
570
  max: Any | None = None,
557
571
  is_list: bool = False,
558
572
  custom: dict[str, Any] | None = None,
559
- widget: str | None = None):
573
+ widget: str | None = None,
574
+ input_map: Any | None = None,
575
+ direction: str | None = None):
576
+
577
+ # workaround for circular dependency related to Assigments in the Datamap module
578
+ from .data_map import DataMap
579
+ if input_map and not isinstance(input_map, DataMap):
580
+ raise TypeError("input_map must be an instance of DataMap")
581
+
560
582
  userfield = UserField(name=name,
561
583
  kind=kind,
562
584
  text=text,
@@ -568,7 +590,9 @@ class UserNodeSpec(NodeSpec):
568
590
  max=max,
569
591
  is_list=is_list,
570
592
  custom=custom,
571
- widget=widget)
593
+ widget=widget,
594
+ direction=direction,
595
+ input_map=input_map)
572
596
 
573
597
  # find the index of the field
574
598
  i = 0
@@ -660,11 +684,28 @@ class PromptLLMParameters(BaseModel):
660
684
  if self.stop_sequences:
661
685
  model_spec["stop_sequences"] = self.stop_sequences
662
686
  return model_spec
687
+
688
+ class PromptExample(BaseModel):
689
+ input: Optional[str] = None
690
+ expected_output: Optional[str] = None
691
+ enabled: bool
692
+
693
+ def to_json(self) -> dict[str, Any]:
694
+ model_spec = {}
695
+ if self.input:
696
+ model_spec["input"] = self.input
697
+ if self.expected_output:
698
+ model_spec["expected_output"] = self.expected_output
699
+ if self.enabled:
700
+ model_spec["enabled"] = self.enabled
701
+ return model_spec
702
+
663
703
 
664
704
 
665
705
  class PromptNodeSpec(NodeSpec):
666
706
  system_prompt: str | list[str]
667
707
  user_prompt: str | list[str]
708
+ prompt_examples: Optional[list[PromptExample]]
668
709
  llm: Optional[str]
669
710
  llm_parameters: Optional[PromptLLMParameters]
670
711
 
@@ -682,7 +723,10 @@ class PromptNodeSpec(NodeSpec):
682
723
  model_spec["llm"] = self.llm
683
724
  if self.llm_parameters:
684
725
  model_spec["llm_parameters"] = self.llm_parameters.to_json()
685
-
726
+ if self.prompt_examples:
727
+ model_spec["prompt_examples"] = []
728
+ for example in self.prompt_examples:
729
+ model_spec["prompt_examples"].append(example.to_json())
686
730
  return model_spec
687
731
 
688
732
  class TimerNodeSpec(NodeSpec):
@@ -707,6 +751,47 @@ class Expression(BaseModel):
707
751
  model_spec["expression"] = self.expression;
708
752
  return model_spec
709
753
 
754
+ class NodeIdCondition(BaseModel):
755
+ '''One Condition contains an expression, a node_id that branch should go to when expression is true, and a default indicator. '''
756
+ expression: Optional[str] = Field(description="A python expression to be run by the flow engine", default=None)
757
+ node_id: str = Field(description="ID of the node in the flow that branch node should go to")
758
+ default: bool = Field(description="Boolean indicating if the condition is default case")
759
+
760
+ def to_json(self) -> dict[str, Any]:
761
+ model_spec = {}
762
+ if self.expression:
763
+ model_spec["expression"] = self.expression
764
+ model_spec["node_id"] = self.node_id
765
+ model_spec["default"] = self.default
766
+ return model_spec
767
+
768
+
769
+ class EdgeIdCondition(BaseModel):
770
+ '''One Condition contains an expression, an edge_id that branch should go to when expression is true, and a default indicator. '''
771
+ expression: Optional[str] = Field(description="A python expression to be run by the flow engine")
772
+ edge_id: str = Field(description="ID of the edge in the flow that branch node should go to")
773
+ default: bool = Field(description="Boolean indicating if the condition is default case")
774
+
775
+ def to_json(self) -> dict[str, Any]:
776
+ model_spec = {}
777
+ if self.expression:
778
+ model_spec["expression"] = self.expression
779
+ model_spec["edge_id"] = self.edge_id
780
+ model_spec["default"] = self.default
781
+ return model_spec
782
+
783
+ class Conditions(BaseModel):
784
+ '''One Conditions is an array represents the if-else conditions of a complex branch'''
785
+ conditions: list = List[Union[NodeIdCondition, EdgeIdCondition]]
786
+
787
+ def to_json(self) -> dict[str, Any]:
788
+ model_spec = {}
789
+ condition_list = []
790
+ for condition in self.conditions:
791
+ condition_list.append(NodeIdCondition.model_validate(condition).to_json())
792
+ model_spec["conditions"] = condition_list
793
+ return model_spec
794
+
710
795
  class MatchPolicy(Enum):
711
796
 
712
797
  FIRST_MATCH = 1
@@ -724,7 +809,7 @@ class BranchNodeSpec(FlowControlNodeSpec):
724
809
  cases (dict[str | bool, str]): A dictionary of labels to node names. The keys can be strings or booleans.
725
810
  match_policy (MatchPolicy): The policy to use when evaluating the expression.
726
811
  '''
727
- evaluator: Expression
812
+ evaluator: Expression | Conditions
728
813
  cases: dict[str | bool, str] = Field(default = {},
729
814
  description="A dictionary of labels to node names.")
730
815
  match_policy: MatchPolicy = Field(default = MatchPolicy.FIRST_MATCH)
@@ -808,7 +893,7 @@ class UserFlowSpec(FlowSpec):
808
893
 
809
894
  def __init__(self, **kwargs):
810
895
  super().__init__(**kwargs)
811
- self.kind = "userflow"
896
+ self.kind = "user_flow"
812
897
 
813
898
  def to_json(self) -> dict[str, Any]:
814
899
  model_spec = super().to_json()
@@ -917,6 +1002,255 @@ class Assignment(BaseModel):
917
1002
  default_value: Any | None = None
918
1003
  metadata: dict = Field(default_factory=dict[str, Any])
919
1004
 
1005
+ class Style(BaseModel):
1006
+ style_id: str = Field(default="", description="Style Identifier which will be used for reference in other objects")
1007
+ font_size: str = Field(default="", description="Font size")
1008
+ font_name: str = Field(default="", description="Font name")
1009
+ is_bold: str = Field(default="", description="Whether or not the the font is bold")
1010
+ is_italic: str = Field(default="", description="Whether or not the the font is italic")
1011
+
1012
+ class PageMetadata(BaseModel):
1013
+ page_number: Optional[int] = Field(default=None, description="Page number, starting from 1")
1014
+ page_image_width: Optional[int] = Field(default=None, description="Width of the page in pixels, assuming the page is an image with default 72 DPI")
1015
+ page_image_height: Optional[int] = Field(default=None, description="Height of the page in pixels, assuming the page is an image with default 72 DPI")
1016
+ dpi: Optional[int] = Field(default=None, description="The DPI to use for the page image, as specified in the input to the API")
1017
+ document_type: Optional[str] = Field(default="", description="Document type")
1018
+
1019
+ class Metadata(BaseModel):
1020
+ num_pages: int = Field(description="Total number of pages in the document")
1021
+ title: Optional[str] = Field(default=None, description="Document title as obtained from source document")
1022
+ language: Optional[str] = Field(default=None, description="Determined by the lang specifier in the <html> tag, or <meta> tag")
1023
+ url: Optional[str] = Field(default=None, description="URL of the document")
1024
+ keywords: Optional[str] = Field(default=None, description="Keywords associated with document")
1025
+ author: Optional[str] = Field(default=None, description="Author of the document")
1026
+ publication_date: Optional[str] = Field(default=None, description="Best effort bases for a publication date (may be the creation date)")
1027
+ subject: Optional[str] = Field(default=None, description="Subject as obtained from the source document")
1028
+ charset: str = Field(default="", description="Character set used for the output")
1029
+ output_tokens_flag: Optional[bool] = Field(default=None, description="Whether individual tokens are output, as specified in the input to the API")
1030
+ output_bounding_boxes_flag: Optional[bool] = Field(default=None, description="Whether bounding boxes are output, as requested in the input to the API")
1031
+ pages_metadata: Optional[List[PageMetadata]] = Field(default=[], description="List of page-level metadata objects")
1032
+
1033
+ class Section(BaseModel):
1034
+ id: str = Field(default="", description="Unique identifier for the section")
1035
+ parent_id: str = Field(default="", description="Unique identifier which denotes parent of this structure")
1036
+ children_ids: List[str] = Field(default="", description="Unique Ids of first level children structures under this structure in correct sequence")
1037
+ section_number: str = Field(default="", description="Section identifier identified in the document")
1038
+ section_level: str = Field(default="", description="Nesting level of section identified in the document")
1039
+ bbox_list: Optional[List[DocProcBoundingBox]] = Field(default=None, description="Cross-pages bounding boxes of that section")
1040
+
1041
+
1042
+ class SectionTitle(BaseModel):
1043
+ id: str = Field(default="", description="Unique identifier for the section")
1044
+ parent_id: str = Field(default="", description="Unique identifier which denotes parent of this structure")
1045
+ children_ids: Optional[List[str]] = Field(default=None, description="Unique Ids of first level children structures under this structure in correct sequence")
1046
+ text_alignment: Optional[str] = Field(default="", description="Text alignment of the section title")
1047
+ text: str = Field(default="", description="Text property added to all objects")
1048
+ bbox: Optional[DocProcBoundingBox] = Field(default=None, description="The bounding box of the section title")
1049
+
1050
+ class List_(BaseModel):
1051
+ id: str = Field(..., description="Unique identifier for the list")
1052
+ title: Optional[str] = Field(None, description="List title")
1053
+ parent_id: str = Field(..., description="Unique identifier which denotes parent of this structure")
1054
+ children_ids: List[str] = Field(..., description="Unique Ids of first level children structures under this structure in correct sequence")
1055
+ bbox_list: Optional[List[DocProcBoundingBox]] = Field(None, description="Cross-pages bounding boxes of that table")
1056
+
1057
+
1058
+ class ListItem(BaseModel):
1059
+ id: str = Field(..., description="Unique identifier for the list item")
1060
+ parent_id: str = Field(..., description="Unique identifier which denotes parent of this structure")
1061
+ children_ids: Optional[List[str]] = Field(None, description="Unique Ids of first level children structures under this structure in correct sequence")
1062
+ text: str = Field(..., description="Text property added to all objects")
1063
+ bbox: Optional[DocProcBoundingBox] = Field(None, description="The bounding box of the list item")
1064
+
1065
+
1066
+ class ListIdentifier(BaseModel):
1067
+ id: str = Field(..., description="Unique identifier for the list item")
1068
+ parent_id: str = Field(..., description="Unique identifier which denotes parent of this structure")
1069
+ children_ids: List[str] = Field(..., description="Unique Ids of first level children structures under this structure in correct sequence")
1070
+
1071
+ class Table(BaseModel):
1072
+ id: str = Field(..., description="Unique identifier for the table")
1073
+ parent_id: str = Field(..., description="Unique identifier which denotes parent of this structure")
1074
+ children_ids: List[str] = Field(..., description="Unique Ids of first level children structures under this structure in correct sequence, in this case, table rows")
1075
+ bbox_list: Optional[List[DocProcBoundingBox]] = Field(None, description="Cross-pages bounding boxes of that table")
1076
+
1077
+
1078
+ class TableRow(BaseModel):
1079
+ id: str = Field(..., description="Unique identifier for the table row")
1080
+ parent_id: str = Field(..., description="Unique identifier which denotes parent of this structure")
1081
+ children_ids: List[str] = Field(..., description="Unique Ids of first level children structures under this structure in correct sequence, in this case, table cells")
1082
+ bbox: Optional[DocProcBoundingBox] = Field(None, description="The bounding box of the table row")
1083
+
1084
+
1085
+ class TableCell(BaseModel):
1086
+ id: str = Field(..., description="Unique identifier for the table cell")
1087
+ parent_id: str = Field(..., description="Unique identifier which denotes parent of this structure")
1088
+ is_row_header: bool = Field(..., description="Whether the cell is part of row header or not")
1089
+ is_col_header: bool = Field(..., description="Whether the cell is part of column header or not")
1090
+ col_span: int = Field(..., description="Column span of the cell")
1091
+ row_span: int = Field(..., description="Row span of the cell")
1092
+ col_start: int = Field(..., description="Column start of the cell within the table")
1093
+ row_start: int = Field(..., description="Row start of the cell within the table")
1094
+ children_ids: Optional[List[str]] = Field(None, description="Children structures, e.g., paragraphs")
1095
+ text: str = Field(..., description="Text property added to all objects")
1096
+ bbox: Optional[DocProcBoundingBox] = Field(None, description="The bounding box of the table cell")
1097
+
1098
+ class Subscript(BaseModel):
1099
+ id: str = Field(..., description="Unique identifier for the subscript")
1100
+ parent_id: str = Field(..., description="Unique identifier which denotes parent of this structure")
1101
+ children_ids: List[str] = Field(default_factory=list, description="Unique Ids of first level children structures under this structure in correct sequence")
1102
+ token_id_ref: Optional[str] = Field(None, description="Id of the token to which the subscript belongs")
1103
+ text: str = Field(..., description="Text property added to all objects")
1104
+
1105
+
1106
+ class Superscript(BaseModel):
1107
+ id: str = Field(..., description="Unique identifier for the superscript")
1108
+ parent_id: str = Field(..., description="Unique identifier which denotes parent of this structure")
1109
+ footnote_ref: str = Field(..., description="Matching footnote id found on the page")
1110
+ token_id_ref: Optional[str] = Field(None, description="Id of the token to which the superscript belongs")
1111
+ children_ids: List[str] = Field(default_factory=list, description="Unique Ids of first level children structures under this structure in correct sequence")
1112
+ text: str = Field(..., description="Text property added to all objects")
1113
+
1114
+
1115
+ class Footnote(BaseModel):
1116
+ id: str = Field(..., description="Unique identifier for the footnote")
1117
+ parent_id: str = Field(..., description="Unique identifier which denotes parent of this structure")
1118
+ children_ids: List[str] = Field(default_factory=list, description="Unique Ids of first level children structures under this structure in correct sequence")
1119
+ text: str = Field(..., description="Text property added to all objects")
1120
+
1121
+
1122
+ class Paragraph(BaseModel):
1123
+ id: str = Field(..., description="Unique identifier for the paragraph")
1124
+ parent_id: str = Field(..., description="Unique identifier which denotes parent of this structure")
1125
+ children_ids: List[str] = Field(default_factory=list, description="Unique Ids of first level children structures under this structure in correct sequence, in this case, tokens")
1126
+ text_alignment: Optional[str] = Field(None, description="Text alignment of the paragraph")
1127
+ indentation: Optional[int] = Field(None, description="Paragraph indentation")
1128
+ text: str = Field(..., description="Text property added to all objects")
1129
+ bbox_list: Optional[DocProcBoundingBox] = Field(default=None, description="Cross-pages bounding boxes of that Paragraph")
1130
+
1131
+
1132
+ class CodeSnippet(BaseModel):
1133
+ id: str = Field(..., description="Unique identifier for the code snippet")
1134
+ parent_id: str = Field(..., description="Unique identifier which denotes parent of this structure")
1135
+ children_ids: List[str] = Field(default_factory=list, description="Unique Ids of first level children structures under this structure in correct sequence, in this case, tokens")
1136
+ text: str = Field(..., description="Text of the code snippet. It can contain multiple lines, including empty lines or lines with leading spaces.")
1137
+
1138
+
1139
+ class Picture(BaseModel):
1140
+ id: str = Field(..., description="Unique identifier for the picture")
1141
+ parent_id: str = Field(..., description="Unique identifier which denotes parent of this structure")
1142
+ children_ids: List[str] = Field(default_factory=list, description="Unique identifiers of the tokens extracted from this picture, if any")
1143
+ text: Optional[str] = Field(None, description="Text extracted from this picture")
1144
+ verbalization: Optional[str] = Field(None, description="Verbalization of this picture")
1145
+ path: Optional[str] = Field(None, description="Path in the output location where the picture itself was saved")
1146
+ picture_class: Optional[str] = Field(None, description="The classification result of the picture")
1147
+ bbox: Optional[DocProcBoundingBox] = Field(None, description="The bounding box of the picture in the context of the page, expressed as pixel coordinates with respect to pages_metadata.page_image_height and pages_metadata.page_image_width")
1148
+
1149
+
1150
+ class PageHeader(BaseModel):
1151
+ id: str = Field(..., description="Unique identifier for the page header")
1152
+ parent_id: str = Field(..., description="Unique identifier which denotes parent of this structure")
1153
+ text: Optional[str] = Field(None, description="The page header text")
1154
+ bbox: Optional[DocProcBoundingBox] = Field(None, description="The bounding box of the page header")
1155
+ children_ids: List[str] = Field(default_factory=list, description="Unique Ids of first level children structures under this structure in correct sequence, in this case, tokens")
1156
+
1157
+
1158
+ class PageFooter(BaseModel):
1159
+ id: str = Field(..., description="Unique identifier for the page footer")
1160
+ parent_id: str = Field(..., description="Unique identifier which denotes parent of this structure")
1161
+ text: Optional[str] = Field(None, description="The page footer text")
1162
+ bbox: Optional[DocProcBoundingBox] = Field(None, description="The bounding box of the page footer")
1163
+ children_ids: List[str] = Field(default_factory=list, description="Unique Ids of first level children structures under this structure in correct sequence, in this case, tokens")
1164
+
1165
+
1166
+ class BarCode(BaseModel):
1167
+ id: str = Field(..., description="Unique identifier for the bar code")
1168
+ parent_id: str = Field(..., description="Unique identifier which denotes parent of this structure")
1169
+ text: Optional[str] = Field(None, description="The value of the bar code")
1170
+ format: Optional[str] = Field(None, description="The format of the bar code")
1171
+ path: Optional[str] = Field(None, description="Path in the output location where the var code picture is saved")
1172
+ bbox: Optional[DocProcBoundingBox] = Field(None, description="The bounding box of the bar code in the context of the page, expressed as pixel coordinates with respect to pages_metadata.page_image_height and pages_metadata.page_image_width")
1173
+
1174
+
1175
+ class QRCode(BaseModel):
1176
+ id: str = Field(..., description="Unique identifier for the QR code")
1177
+ parent_id: str = Field(..., description="Unique identifier which denotes parent of this structure")
1178
+ text: Optional[str] = Field(None, description="The value of the QR code")
1179
+ path: Optional[str] = Field(None, description="Path in the output location where the var code picture is saved")
1180
+ bbox: Optional[DocProcBoundingBox] = Field(None, description="The bounding box of the bar code in the context of the page, expressed as pixel coordinates with respect to pages_metadata.page_image_height and pages_metadata.page_image_width")
1181
+
1182
+
1183
+ class Token(BaseModel):
1184
+ id: str = Field(..., description="Unique identifier for the list identifier")
1185
+ parent_id: Optional[str] = Field(None, description="Unique identifier which denotes parent of this structure")
1186
+ style_id: Optional[str] = Field(None, description="Identifier of the style object associated with this token")
1187
+ text: str = Field(..., description="Actual text of the token")
1188
+ bbox: Optional[DocProcBoundingBox] = Field(None, description="The bounding box of the token in the context of the page, expressed as pixel coordinates with respect to pages_metadata.page_image_height and pages_metadata.page_image_width")
1189
+ confidence: Optional[float] = Field(None, description="Confidence score for the token")
1190
+
1191
+ class Structures(BaseModel):
1192
+ sections: Optional[List[Section]] = Field(
1193
+ default=None, description="All Section objects found in the document"
1194
+ )
1195
+ section_titles: Optional[List[SectionTitle]] = Field(
1196
+ default=None, description="All SectionTitle objects found in the document"
1197
+ )
1198
+ lists: Optional[List[List_]] = Field(
1199
+ default=None, description="All List objects found in the document"
1200
+ )
1201
+ list_items: Optional[List[ListItem]] = Field(
1202
+ default=None, description="All ListItem objects found in the document"
1203
+ )
1204
+ list_identifiers: Optional[List[ListIdentifier]] = Field(
1205
+ default=None, description="All ListIdentifier objects found in the document"
1206
+ )
1207
+ tables: Optional[List[Table]] = Field(
1208
+ default=None, description="All Table objects found in the document"
1209
+ )
1210
+ table_rows: Optional[List[TableRow]] = Field(
1211
+ default=None, description="All TableRow objects found in the document"
1212
+ )
1213
+ table_cells: Optional[List[TableCell]] = Field(
1214
+ default=None, description="All TableCell objects found in the document"
1215
+ )
1216
+ subscripts: Optional[List[Subscript]] = Field(
1217
+ default=None, description="All Subscript objects found in the document"
1218
+ )
1219
+ superscripts: Optional[List[Superscript]] = Field(
1220
+ default=None, description="All Superscript objects found in the document"
1221
+ )
1222
+ footnotes: Optional[List[Footnote]] = Field(
1223
+ default=None, description="All Footnote objects found in the document"
1224
+ )
1225
+ paragraphs: Optional[List[Paragraph]] = Field(
1226
+ default=None, description="All Paragraph objects found in the document"
1227
+ )
1228
+ code_snippets: Optional[List[CodeSnippet]] = Field(
1229
+ default=None, description="All CodeSnippet objects found in the document"
1230
+ )
1231
+ pictures: Optional[List[Picture]] = Field(
1232
+ default=None, description="All Picture objects found in the document"
1233
+ )
1234
+ page_headers: Optional[List[PageHeader]] = Field(
1235
+ default=None, description="All PageHeader objects found in the document"
1236
+ )
1237
+ page_footers: Optional[List[PageFooter]] = Field(
1238
+ default=None, description="All PageFooter objects found in the document"
1239
+ )
1240
+ bar_codes: Optional[List[BarCode]] = Field(
1241
+ default=None, description="All BarCode objects found in the document"
1242
+ )
1243
+ tokens: Optional[List[Token]] = Field(
1244
+ default=None, description="All Token objects found in the document"
1245
+ )
1246
+
1247
+ class AssemblyJsonOutput(BaseModel):
1248
+ metadata: Metadata = Field(description="Metadata about this document")
1249
+ styles: Optional[List[Style]] = Field(description="Font styles used in this document")
1250
+ kvps: Optional[DocProcKVP] = Field(description="Key value pairs found in the document")
1251
+ top_level_structures: List[str] = Field(default=[], description="Array of ids of the top level structures which belong directly under the document")
1252
+ all_structures: Structures = Field(default=None, description="An object containing of all flattened structures identified in the document")
1253
+
920
1254
  class LanguageCode(StrEnum):
921
1255
  '''
922
1256
  The ISO-639 language codes understood by Document Processing functions.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ibm-watsonx-orchestrate
3
- Version: 1.10.2
3
+ Version: 1.11.0
4
4
  Summary: IBM watsonx.orchestrate SDK
5
5
  Author-email: IBM <support@ibm.com>
6
6
  License: MIT License
@@ -11,7 +11,7 @@ Requires-Dist: click<8.2.0,>=8.0.0
11
11
  Requires-Dist: docstring-parser<1.0,>=0.16
12
12
  Requires-Dist: httpx<1.0.0,>=0.28.1
13
13
  Requires-Dist: ibm-cloud-sdk-core>=3.24.2
14
- Requires-Dist: ibm-watsonx-orchestrate-evaluation-framework==1.0.8
14
+ Requires-Dist: ibm-watsonx-orchestrate-evaluation-framework==1.1.1
15
15
  Requires-Dist: jsonref==1.1.0
16
16
  Requires-Dist: langchain-core<=0.3.63
17
17
  Requires-Dist: langsmith<=0.3.45