ibm-watsonx-orchestrate 1.8.0b0__py3-none-any.whl → 1.8.1__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 (34) hide show
  1. ibm_watsonx_orchestrate/__init__.py +2 -1
  2. ibm_watsonx_orchestrate/agent_builder/agents/types.py +12 -0
  3. ibm_watsonx_orchestrate/agent_builder/connections/types.py +14 -2
  4. ibm_watsonx_orchestrate/agent_builder/tools/openapi_tool.py +61 -11
  5. ibm_watsonx_orchestrate/agent_builder/tools/types.py +7 -2
  6. ibm_watsonx_orchestrate/cli/commands/agents/agents_controller.py +3 -3
  7. ibm_watsonx_orchestrate/cli/commands/channels/types.py +15 -2
  8. ibm_watsonx_orchestrate/cli/commands/channels/webchat/channels_webchat_controller.py +7 -7
  9. ibm_watsonx_orchestrate/cli/commands/connections/connections_command.py +14 -6
  10. ibm_watsonx_orchestrate/cli/commands/connections/connections_controller.py +6 -8
  11. ibm_watsonx_orchestrate/cli/commands/copilot/copilot_controller.py +111 -36
  12. ibm_watsonx_orchestrate/cli/commands/copilot/copilot_server_controller.py +23 -7
  13. ibm_watsonx_orchestrate/cli/commands/environment/types.py +1 -1
  14. ibm_watsonx_orchestrate/cli/commands/evaluations/evaluations_command.py +102 -37
  15. ibm_watsonx_orchestrate/cli/commands/evaluations/evaluations_controller.py +20 -2
  16. ibm_watsonx_orchestrate/cli/commands/knowledge_bases/knowledge_bases_controller.py +10 -8
  17. ibm_watsonx_orchestrate/cli/commands/models/models_controller.py +5 -8
  18. ibm_watsonx_orchestrate/cli/commands/server/server_command.py +2 -10
  19. ibm_watsonx_orchestrate/client/connections/connections_client.py +5 -30
  20. ibm_watsonx_orchestrate/client/copilot/cpe/copilot_cpe_client.py +2 -1
  21. ibm_watsonx_orchestrate/client/utils.py +22 -20
  22. ibm_watsonx_orchestrate/docker/compose-lite.yml +12 -5
  23. ibm_watsonx_orchestrate/docker/default.env +13 -12
  24. ibm_watsonx_orchestrate/flow_builder/flows/__init__.py +8 -5
  25. ibm_watsonx_orchestrate/flow_builder/flows/flow.py +47 -7
  26. ibm_watsonx_orchestrate/flow_builder/node.py +7 -1
  27. ibm_watsonx_orchestrate/flow_builder/types.py +168 -66
  28. ibm_watsonx_orchestrate/flow_builder/utils.py +0 -1
  29. {ibm_watsonx_orchestrate-1.8.0b0.dist-info → ibm_watsonx_orchestrate-1.8.1.dist-info}/METADATA +2 -4
  30. {ibm_watsonx_orchestrate-1.8.0b0.dist-info → ibm_watsonx_orchestrate-1.8.1.dist-info}/RECORD +33 -34
  31. ibm_watsonx_orchestrate/agent_builder/utils/pydantic_utils.py +0 -149
  32. {ibm_watsonx_orchestrate-1.8.0b0.dist-info → ibm_watsonx_orchestrate-1.8.1.dist-info}/WHEEL +0 -0
  33. {ibm_watsonx_orchestrate-1.8.0b0.dist-info → ibm_watsonx_orchestrate-1.8.1.dist-info}/entry_points.txt +0 -0
  34. {ibm_watsonx_orchestrate-1.8.0b0.dist-info → ibm_watsonx_orchestrate-1.8.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,5 +1,7 @@
1
1
  from dataclasses import dataclass
2
2
  from enum import Enum, StrEnum, auto
3
+ from datetime import date
4
+ import numbers
3
5
  import inspect
4
6
  import logging
5
7
  from typing import (
@@ -7,7 +9,6 @@ from typing import (
7
9
  )
8
10
 
9
11
  import docstring_parser
10
- from munch import Munch
11
12
  from pydantic import BaseModel, Field
12
13
 
13
14
  from langchain_core.tools.base import create_schema_from_function
@@ -167,8 +168,6 @@ class DocProcTask(StrEnum):
167
168
  Possible names for the Document processing task parameter
168
169
  '''
169
170
  text_extraction = auto()
170
- kvp_invoices_extraction = auto()
171
- kvp_utility_bills_extraction = auto()
172
171
 
173
172
  class DocProcSpec(NodeSpec):
174
173
  task: DocProcTask = Field(description='The document processing operation name', default=DocProcTask.text_extraction)
@@ -515,6 +514,7 @@ class PromptNodeSpec(NodeSpec):
515
514
  model_spec["llm_parameters"] = self.llm_parameters.to_json()
516
515
 
517
516
  return model_spec
517
+
518
518
 
519
519
  class Expression(BaseModel):
520
520
  '''An expression could return a boolean or a value'''
@@ -743,7 +743,7 @@ class LanguageCode(StrEnum):
743
743
  fr = auto()
744
744
  en_hw = auto()
745
745
 
746
- class DocumentContent(BaseModel):
746
+ class File(BaseModel):
747
747
  '''
748
748
  This class represents the input of a Document processing task.
749
749
 
@@ -752,7 +752,7 @@ class DocumentContent(BaseModel):
752
752
  language (LanguageCode): Optional language code used when processing the input document
753
753
  '''
754
754
  # This is declared as bytes but the runtime will understand if a URL is send in as input.
755
- # We need to use bytes here for Chat-with-doc to recognize the input as a Document.
755
+ # We need to use bytes here for Chat-with-doc to recognize the input as a File.
756
756
  document_ref: bytes | str = Field(
757
757
  description="Either an ID or a URL identifying the document to be used.",
758
758
  title='Document reference',
@@ -779,73 +779,175 @@ class TextExtractionResponse(BaseModel):
779
779
  '''
780
780
  output: TextExtraction = Field(description='The text extraction response')
781
781
 
782
- class Invoice(BaseModel):
783
- '''
784
- This class represents the fields extracted by the "kvp_invoices_extraction" document processing (docproc) operation.
785
- '''
786
- bank_account_number: Optional[str] = Field(title='Bank account number', default=None)
787
- bank_name: Optional[str] = Field(title='Bank name', default=None)
788
- bill_to_address: Optional[str] = Field(title='Bill-to address', default=None)
789
- bill_to_name: Optional[str] = Field(title='Bill-to name', default=None)
790
- invoice_date: Optional[str] = Field(title='Invoice date', format='date', default=None)
791
- invoice_number: Optional[str] = Field(title='Invoice number', default=None)
792
- invoice_total: Optional[float] = Field(title='Invoice total', default=None)
793
- payment_due_date: Optional[str] = Field(title='Payment due date', format='date', default=None)
794
- payment_terms: Optional[str] = Field(title='Payment terms', default=None)
795
- purchase_order_number: Optional[str] = Field(title='Purchase order number', default=None)
796
- ship_to_address: Optional[str] = Field(title='Ship-to address', default=None)
797
- ship_to_name: Optional[str] = Field(title='Ship-to name', default=None)
798
- shipping_amount: Optional[float] = Field(title='Shipping amount', default=None)
799
- subtotal: Optional[float] = Field(title='Subtotal', default=None)
800
- tax_amount: Optional[float] = Field(title='Tax amount', default=None)
801
- tax_rate: Optional[float] = Field(title='Tax rate', default=None)
802
- tax_type: Optional[str] = Field(title='Tax type', default=None)
803
- vendor_address: Optional[str] = Field(title='Vendor address', default=None)
804
- vendor_name: Optional[str] = Field(title='Vendor name', default=None)
805
-
806
-
807
- class KVPInvoicesExtractionResponse(BaseModel):
808
- '''
809
- The response of a "kvp_invoices_extraction" document processing (docproc) operation.
810
- Attributes:
811
- invoice: an object with the fields extracted from the input invoice document
812
- '''
813
- output: Invoice = Field(
814
- title='Invoice',
815
- description='The fields extracted from an invoice document'
816
- )
817
782
 
783
+ class DecisionsCondition(BaseModel):
784
+ _condition: str | None = None
785
+
786
+ def greater_than(self, value: Union[numbers.Number, date, str]) -> Self:
787
+ self._check_type_is_number_or_date_or_str(value)
788
+ self._condition = f"> {self._format_value(value)}"
789
+ return self
790
+
791
+ def greater_than_or_equal(self, value: Union[numbers.Number, date, str]) -> Self:
792
+ self._check_type_is_number_or_date_or_str(value)
793
+ self._condition = f">= {self._format_value(value)}"
794
+ return self
795
+
796
+ def less_than(self, value: Union[numbers.Number, date, str]) -> Self:
797
+ self._check_type_is_number_or_date_or_str(value)
798
+ self._condition = f"< {self._format_value(value)}"
799
+ return self
800
+
801
+ def less_than_or_equal(self, value: Union[numbers.Number, date, str]) -> Self:
802
+ self._check_type_is_number_or_date_or_str(value)
803
+ self._condition = f"<= {self._format_value(value)}"
804
+ return self
818
805
 
819
- class UtilityBill(BaseModel):
806
+ def equal(self, value: Union[numbers.Number, date, str]) -> Self:
807
+ self._check_type_is_number_or_date_or_str(value)
808
+ self._condition = f"== {self._format_value(value)}"
809
+ return self
810
+
811
+ def not_equal(self, value: Union[numbers.Number, date, str]) -> Self:
812
+ self._check_type_is_number_or_date_or_str(value)
813
+ self._condition = f"== {self._format_value(value)}"
814
+ return self
815
+
816
+ def contains(self, value: str) -> Self:
817
+ self._check_type_is_str(value)
818
+ self._condition = f"contains {self._format_value(value)}"
819
+ return self
820
+
821
+ def not_contains(self, value: str) -> Self:
822
+ self._check_type_is_str(value)
823
+ self._condition = f"doesNotContain {self._format_value(value)}"
824
+ return self
825
+
826
+ def is_in(self, value: str) -> Self:
827
+ self._check_type_is_str(value)
828
+ self._condition = f"in {self._format_value(value)}"
829
+ return self
830
+
831
+ def is_not_in(self, value: str) -> Self:
832
+ self._check_type_is_str(value)
833
+ self._condition = f"notIn {self._format_value(value)}"
834
+ return self
835
+
836
+ def startswith(self, value: str) -> Self:
837
+ self._check_type_is_str(value)
838
+ self._condition = f"startsWith {self._format_value(value)}"
839
+ return self
840
+
841
+ def endswith(self, value: str) -> Self:
842
+ self._check_type_is_str(value)
843
+ self._condition = f"endsWith {self._format_value(value)}"
844
+ return self
845
+
846
+
847
+ def in_range(self, startValue: Union[numbers.Number, date], endValue: Union[numbers.Number, date],
848
+ startsInclusive: bool = False, endsInclusive: bool = False) -> Self:
849
+ self._check_type_is_number_or_date_or_str(startValue)
850
+ self._check_type_is_number_or_date_or_str(endValue)
851
+ if type(startValue) is not type(endValue):
852
+ raise TypeError("startValue and endValue must be of the same type")
853
+ start_op = "[" if startsInclusive else "(" # [ is inclusive, ( is exclusive
854
+ end_op = "]" if endsInclusive else ")"
855
+ self._condition = f"{start_op}{self._format_value(startValue)}:{self._format_value(endValue)}{end_op}"
856
+ return self
857
+
858
+ def _check_type_is_number_or_date(self, value: Union[numbers.Number, date]):
859
+ if not isinstance(value, (numbers.Number, date)):
860
+ raise TypeError("Value must be a number or a date")
861
+
862
+ def _check_type_is_number_or_date_or_str(self, value: Union[numbers.Number, date, str]):
863
+ if not isinstance(value, (numbers.Number, date, str)):
864
+ raise TypeError("Value must be a number or a date or a string")
865
+
866
+ def _check_type_is_str(self, value: str):
867
+ if not isinstance(value, str):
868
+ raise TypeError("Value must be a string")
869
+
870
+ @staticmethod
871
+ def _format_value(value: Union[numbers.Number, date, str]):
872
+ if isinstance(value, numbers.Number):
873
+ return f"{value}"
874
+ if isinstance(value, date):
875
+ return f"\"{value.strftime('%B %d, %Y')}\""
876
+ return f"\"{value}\""
877
+
878
+ def condition(self):
879
+ return self._condition
880
+
881
+
882
+
883
+ class DecisionsRule(BaseModel):
820
884
  '''
821
- This class represents the fields extracted by the "kvp_utility_bills_extraction" document processing (docproc) operation.
885
+ A set of decisions rules.
822
886
  '''
823
- account_number: Optional[str] = Field(title='Account number', default=None)
824
- amount_due: Optional[float] = Field(title='Amount due', default=None)
825
- client_number: Optional[str] = Field(title='Client number', default=None)
826
- company_name: Optional[str] = Field(title='Company name', default=None)
827
- company_address: Optional[str] = Field(title='Company address', default=None)
828
- customer_name: Optional[str] = Field(title='Customer name', default=None)
829
- customer_address: Optional[str] = Field(title='Customer address', default=None)
830
- due_date: Optional[str] = Field(title='Due date', format='date', default=None)
831
- payment_received: Optional[float] = Field(title='Payment received', default=None)
832
- previous_balance: Optional[float] = Field(title='Previous balance', default=None)
833
- service_address: Optional[str] = Field(title='Service address', default=None)
834
- statement_date: Optional[str] = Field(title='Statement date', format='date', default=None)
835
-
836
- #class UtilityBillResponse(BaseModel):
837
- # field_value: UtilityBill = Field(title='Field value')
838
-
839
- class KVPUtilityBillsExtractionResponse(BaseModel):
887
+ _conditions: dict[str, str]
888
+ _actions: dict[str, Union[numbers.Number, str]]
889
+
890
+ def __init__(self, **data):
891
+ super().__init__(**data)
892
+ self._conditions = {}
893
+ self._actions = {}
894
+
895
+ def condition(self, key: str, cond: DecisionsCondition) -> Self:
896
+ self._conditions[key] = cond.condition()
897
+ return self
898
+
899
+ def action(self, key: str, value: Union[numbers.Number, date, str]) -> Self:
900
+ if isinstance(value, date):
901
+ self._actions[key] = value.strftime("%B %d, %Y")
902
+ return self
903
+ self._actions[key] = value
904
+ return self
905
+
906
+ def to_json(self) -> dict[str, Any]:
907
+ '''
908
+ Serialize the rules into JSON object
909
+ '''
910
+ model_spec = {}
911
+ if self._conditions:
912
+ model_spec["conditions"] = self._conditions
913
+ if self._actions:
914
+ model_spec["actions"] = self._actions
915
+ return model_spec
916
+
917
+
918
+ class DecisionsNodeSpec(NodeSpec):
840
919
  '''
841
- The response of a "kvp_utility_bills_extraction" document processing (docproc) operation.
842
- Attributes:
843
- utility_bull: an object with the fields extracted from the input utility bill document
920
+ Node specification for Decision Table
844
921
  '''
845
- output: UtilityBill = Field(
846
- title='Utility bill',
847
- description='The fields extracted from a utility bill document'
848
- )
922
+ locale: str | None = None
923
+ rules: list[DecisionsRule]
924
+ default_actions: dict[str, Union[int, float, complex, str]] | None
925
+
926
+ def __init__(self, **data):
927
+ super().__init__(**data)
928
+ self.kind = "decisions"
929
+
930
+ def default_action(self, key: str, value: Union[int, float, complex, date, str]) -> Self:
931
+ '''
932
+ create a new default action
933
+ '''
934
+ if isinstance(value, date):
935
+ self.default_actions[key] = value.strftime("%B %d, %Y")
936
+ return self
937
+ self.default_actions[key] = value
938
+ return self
939
+
940
+ def to_json(self) -> dict[str, Any]:
941
+ model_spec = super().to_json()
942
+ if self.locale:
943
+ model_spec["locale"] = self.locale
944
+ if self.rules:
945
+ model_spec["rules"] = [rule.to_json() for rule in self.rules]
946
+ if self.default_actions:
947
+ model_spec["default_actions"] = self.default_actions
948
+
949
+ return model_spec
950
+
849
951
 
850
952
  def extract_node_spec(
851
953
  fn: Callable | PythonTool,
@@ -6,7 +6,6 @@ import logging
6
6
  from pydantic import BaseModel, TypeAdapter
7
7
 
8
8
  from langchain_core.utils.json_schema import dereference_refs
9
- from rpds import List
10
9
  import typer
11
10
  import yaml
12
11
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ibm-watsonx-orchestrate
3
- Version: 1.8.0b0
3
+ Version: 1.8.1
4
4
  Summary: IBM watsonx.orchestrate SDK
5
5
  Author-email: IBM <support@ibm.com>
6
6
  License: MIT License
@@ -11,12 +11,10 @@ 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.6
14
+ Requires-Dist: ibm-watsonx-orchestrate-evaluation-framework==1.0.8
15
15
  Requires-Dist: jsonref==1.1.0
16
- Requires-Dist: jsonschema<5.0.0,>=4.23.0
17
16
  Requires-Dist: langchain-core<=0.3.63
18
17
  Requires-Dist: langsmith<=0.3.45
19
- Requires-Dist: munch>=4.0.0
20
18
  Requires-Dist: packaging>=24.2
21
19
  Requires-Dist: pydantic<3.0.0,>=2.10.3
22
20
  Requires-Dist: pyjwt<3.0.0,>=2.10.1
@@ -1,16 +1,16 @@
1
- ibm_watsonx_orchestrate/__init__.py,sha256=4d69fLyzfeRTVOA__Q6T_majiXB51xYDqWZBiQE1VKw,427
1
+ ibm_watsonx_orchestrate/__init__.py,sha256=b17FhWemtG_CY1jQrXXiXeEtvz6vWNWDGSzVp1A6er4,426
2
2
  ibm_watsonx_orchestrate/agent_builder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  ibm_watsonx_orchestrate/agent_builder/agents/__init__.py,sha256=lmZwaiWXD4Ea19nrMwZXaqCxFMG29xNS8vUoZtK3yI4,392
4
4
  ibm_watsonx_orchestrate/agent_builder/agents/agent.py,sha256=W0uya81fQPrYZFaO_tlsxBL56Bfpw0xrqdxQJhAZ6XI,983
5
5
  ibm_watsonx_orchestrate/agent_builder/agents/assistant_agent.py,sha256=NnWThJ2N8HUOD9IDL6ZhtTKyLMHSacJCpxDNityRmgY,1051
6
6
  ibm_watsonx_orchestrate/agent_builder/agents/external_agent.py,sha256=7HzEFjd7JiiRTgvA1RVA3M0-Mr42FTQnOtGMII5ufk0,1045
7
- ibm_watsonx_orchestrate/agent_builder/agents/types.py,sha256=6in639wzd0mhy5X6LD6sojWiIePRD5Ryzd_btJ746BA,12797
7
+ ibm_watsonx_orchestrate/agent_builder/agents/types.py,sha256=kXbWWz4iHo-knQ5OZRZW7kc8rTwfOzPVn7iyndk5cDs,13013
8
8
  ibm_watsonx_orchestrate/agent_builder/agents/webchat_customizations/__init__.py,sha256=5TXa8UqKUAlDo4hTbE5S9OPEkQhxXhPJHJC4pEe8U00,92
9
9
  ibm_watsonx_orchestrate/agent_builder/agents/webchat_customizations/prompts.py,sha256=jNVF_jgz1Dmt7-RxAceAS0XWXk_fx9h3sS_fGrvZT28,941
10
10
  ibm_watsonx_orchestrate/agent_builder/agents/webchat_customizations/welcome_content.py,sha256=U76wZrblSXx4qv7phcPYs3l8SiFzwZ5cJ74u8Y2iYhU,608
11
11
  ibm_watsonx_orchestrate/agent_builder/connections/__init__.py,sha256=VG45ifpp6B00-ZAGW-dIEHFh18Fx3wbyfUiDDKS74u4,718
12
12
  ibm_watsonx_orchestrate/agent_builder/connections/connections.py,sha256=CD3QHI4d-j3rTugHOgvPZUdRu_zpWCwsSzkN63_Ke_c,5423
13
- ibm_watsonx_orchestrate/agent_builder/connections/types.py,sha256=Lu_LPHKIo_vuptNixU8Uu_j8d_YT85Fjy9rMNYxnXGA,9253
13
+ ibm_watsonx_orchestrate/agent_builder/connections/types.py,sha256=YOOlXXNKVxTZ6tK2ceeytWXUApZjwfi4mgdYwXoiqOk,9532
14
14
  ibm_watsonx_orchestrate/agent_builder/knowledge_bases/knowledge_base.py,sha256=_KuGF0RZpKpwdt31rzjlTjrhGRFz2RtLzleNkhMNX4k,1831
15
15
  ibm_watsonx_orchestrate/agent_builder/knowledge_bases/knowledge_base_requests.py,sha256=3xTfFMZR17EN8eYRhsVyBfOEzlTqyi0eYaMXyv0_ZtQ,862
16
16
  ibm_watsonx_orchestrate/agent_builder/knowledge_bases/types.py,sha256=_jHu9ELQqj1qwDK6U7jqemzNFeM2O5APlykiZRsDOcY,7009
@@ -23,41 +23,40 @@ ibm_watsonx_orchestrate/agent_builder/toolkits/types.py,sha256=yY-V4Hqct91-Rs4rJ
23
23
  ibm_watsonx_orchestrate/agent_builder/tools/__init__.py,sha256=adkYX0wgB-RKFCUBw6LPJhNVelUjUdsxipGPk2ghLns,479
24
24
  ibm_watsonx_orchestrate/agent_builder/tools/base_tool.py,sha256=0vwMIAyKyB8v1QmNrubLy8Al58g3qT78EUgrmOjegoI,1220
25
25
  ibm_watsonx_orchestrate/agent_builder/tools/flow_tool.py,sha256=DJWYVmIjw1O_cbzPpwU0a_vIZGvo0mj8UsjW9zkKMlA,2589
26
- ibm_watsonx_orchestrate/agent_builder/tools/openapi_tool.py,sha256=IuXJ6-A66Jiss-4jI7yMhg3QZRKFdc2GKBB8D52Wxvc,16473
26
+ ibm_watsonx_orchestrate/agent_builder/tools/openapi_tool.py,sha256=h9ma18GUQHt88UIakd6QZHic822bAXzYokh6sfqAMZk,19410
27
27
  ibm_watsonx_orchestrate/agent_builder/tools/python_tool.py,sha256=FDY-y9jy4bNy88i7JG85Zj_YrxnPfJPD0DjwvL9ITxc,12012
28
- ibm_watsonx_orchestrate/agent_builder/tools/types.py,sha256=NIH0p-iqi6s0KmAjSnsGuMXnyW_gaob9Pi192vaCjYE,7998
28
+ ibm_watsonx_orchestrate/agent_builder/tools/types.py,sha256=SAyDEnWYuguTFk6WxgSDnMaONqDqcr6QhBAxD1u5FDU,8165
29
29
  ibm_watsonx_orchestrate/agent_builder/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
- ibm_watsonx_orchestrate/agent_builder/utils/pydantic_utils.py,sha256=QEanM6FpkmntvS02whdhWx1d4v6zT_1l9ipEbfTgHs8,7623
31
30
  ibm_watsonx_orchestrate/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
31
  ibm_watsonx_orchestrate/cli/config.py,sha256=iXjDxymWhAmLSUu6eh7zJR20dYZDzbxcU5VoBdh3VIw,8318
33
32
  ibm_watsonx_orchestrate/cli/init_helper.py,sha256=qxnKdFcPtGsV_6RqP_IuLshRxgB004SxzDAkBTExA-4,1675
34
33
  ibm_watsonx_orchestrate/cli/main.py,sha256=eE71dfx-EdDYHymYDqXcTjyMXpX0b3cueXOxCI2YLLs,3119
35
34
  ibm_watsonx_orchestrate/cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
35
  ibm_watsonx_orchestrate/cli/commands/agents/agents_command.py,sha256=Zif3bH3X7j5qf7MWGcr53mJ2oEKXNRHeg3ZHeoHTIqQ,8984
37
- ibm_watsonx_orchestrate/cli/commands/agents/agents_controller.py,sha256=skAElLfh8Ip4wVkxpn1wnLskHb1eLU1p9W7GF1abHus,47998
36
+ ibm_watsonx_orchestrate/cli/commands/agents/agents_controller.py,sha256=AvDZ3HSRFzaCQ00Kgu9IsOtq0Dv6HPv2E0o9IrisA7Y,47981
38
37
  ibm_watsonx_orchestrate/cli/commands/channels/channels_command.py,sha256=fVIFhPUTPdxsxIE10nWL-W5wvBR-BS8V8D6r__J8R98,822
39
38
  ibm_watsonx_orchestrate/cli/commands/channels/channels_controller.py,sha256=WjQxwJujvo28SsWgfJSXIpkcgniKcskJ2arL4MOz0Ys,455
40
- ibm_watsonx_orchestrate/cli/commands/channels/types.py,sha256=h8gA3EM7k5X08sk8T9b5siL-XL9uUE-hl_jS-0PDBHA,254
39
+ ibm_watsonx_orchestrate/cli/commands/channels/types.py,sha256=hMFvWPr7tAmDrhBqtzfkCsrubX3lsU6lapTSOFsUbHM,475
41
40
  ibm_watsonx_orchestrate/cli/commands/channels/webchat/channels_webchat_command.py,sha256=vPCr6z1n1yzGDjTlM4f3_9MiuVRzNmXbvUifm6XyQi8,1103
42
- ibm_watsonx_orchestrate/cli/commands/channels/webchat/channels_webchat_controller.py,sha256=1Oze6sN8rH8LVL_52-lG_fjfGLCI0Ui4OytwHRdXAH0,8410
41
+ ibm_watsonx_orchestrate/cli/commands/channels/webchat/channels_webchat_controller.py,sha256=CGfmKsCBX4E3HMZ8C0IXD-DHQNwe96V1Y_BxUZM2us0,8557
43
42
  ibm_watsonx_orchestrate/cli/commands/chat/chat_command.py,sha256=Q9vg2Z5Fsunu6GQFY_TIsNRhUCa0SSGSPnK4jxSGK34,1581
44
- ibm_watsonx_orchestrate/cli/commands/connections/connections_command.py,sha256=qgg2NbAB7g_PHPHd0ZLUm0EjyaCSPi1qpOhtyOlydcY,10151
45
- ibm_watsonx_orchestrate/cli/commands/connections/connections_controller.py,sha256=ka7uBpuRlICZ4ACGiT4WqmufZYEw566NlZX5FhB9pXM,22178
43
+ ibm_watsonx_orchestrate/cli/commands/connections/connections_command.py,sha256=bZBzaaVMFmGY4Guk-JCknZqd8HvXY5L-FirxpxddQfc,10497
44
+ ibm_watsonx_orchestrate/cli/commands/connections/connections_controller.py,sha256=odsqxthEDyPO3C-GEtSn31sxLjRYgUBf1Vdkg6ZEwms,22290
46
45
  ibm_watsonx_orchestrate/cli/commands/copilot/copilot_command.py,sha256=IxasApIyQYWRMKPXKa38ZPVkUvOc4chggSmSGjgQGXc,2345
47
- ibm_watsonx_orchestrate/cli/commands/copilot/copilot_controller.py,sha256=FdvBmz7KXq-B9yp6MAuHCXILTgJcvEGZMtXsHFGWfmw,11777
48
- ibm_watsonx_orchestrate/cli/commands/copilot/copilot_server_controller.py,sha256=OYt0WA0PW9p2R3unpcIplwlTXIK2so9L65JqdGgnLlA,5348
46
+ ibm_watsonx_orchestrate/cli/commands/copilot/copilot_controller.py,sha256=rr6p4_yqriq3ts1FwFC4aV0ub5UC5D6JqpuLoba4j_U,14808
47
+ ibm_watsonx_orchestrate/cli/commands/copilot/copilot_server_controller.py,sha256=AcBE97qNYsRN0ftY_E-AAjKFyVea4fHtU5eB2HsB42I,5619
49
48
  ibm_watsonx_orchestrate/cli/commands/environment/environment_command.py,sha256=xwq7gdyjMtl2RYAnLAahGk2wDetr9BStt8yu7JkeBhk,3768
50
49
  ibm_watsonx_orchestrate/cli/commands/environment/environment_controller.py,sha256=oHZ7LONtPg3-SSnU_rRZryLi8N2mplz5h-LGg4XjzD4,10261
51
- ibm_watsonx_orchestrate/cli/commands/environment/types.py,sha256=HX8QvqYcc-DGnunQKgYp8q2ohedaHKqsJc7WGlaCxks,223
52
- ibm_watsonx_orchestrate/cli/commands/evaluations/evaluations_command.py,sha256=YHaTxcQxLkuojFhNcTtYbzb_lTv_dYBuz2IHl9RXXwU,11689
53
- ibm_watsonx_orchestrate/cli/commands/evaluations/evaluations_controller.py,sha256=pTWyuPNHKOPCYTMlYWwoGojZBdvDrHme2EAel0l4ltk,6957
50
+ ibm_watsonx_orchestrate/cli/commands/environment/types.py,sha256=X6jEnyBdxakromA7FhQ5btZMj9kwGcwRSFz8vpD65jA,224
51
+ ibm_watsonx_orchestrate/cli/commands/evaluations/evaluations_command.py,sha256=nOVxeZSTp1bfV_l_06B6x6wfNeusNAr5KImJYkwGWx8,14298
52
+ ibm_watsonx_orchestrate/cli/commands/evaluations/evaluations_controller.py,sha256=dZEAD0rIS9DQjWD2-i6367RjNd2PWB3Fm_DDk25toBg,7855
54
53
  ibm_watsonx_orchestrate/cli/commands/knowledge_bases/knowledge_bases_command.py,sha256=hOzRcGVoqq7dTc4bSregKxH-kYbrVqaFdhBLawqnRNo,2668
55
- ibm_watsonx_orchestrate/cli/commands/knowledge_bases/knowledge_bases_controller.py,sha256=bzRL-GGDWtBx-uZw4OBRg10yilOdIsL_UQi4iXwTiEc,10010
54
+ ibm_watsonx_orchestrate/cli/commands/knowledge_bases/knowledge_bases_controller.py,sha256=M19rRMFEEcAarPVw4fOr3S94Se1ZEo4hD7sCUr0xYTI,10115
56
55
  ibm_watsonx_orchestrate/cli/commands/login/login_command.py,sha256=xArMiojoozg7Exn6HTpbTcjDO2idZRA-y0WV-_Ic1Sk,651
57
56
  ibm_watsonx_orchestrate/cli/commands/models/model_provider_mapper.py,sha256=RVZfFCuPWiASkR9Mox61v5SZ1AoRxo4_g9stnbfjCkc,7994
58
57
  ibm_watsonx_orchestrate/cli/commands/models/models_command.py,sha256=PW-PIM5Nq0qdCopWjANGBWEuEoA3NLTFThYrN8ggGCI,6425
59
- ibm_watsonx_orchestrate/cli/commands/models/models_controller.py,sha256=BNfUoWST60x3k7yIvSbtBR3rmyTQmz9g0TDK2WOoOE4,18610
60
- ibm_watsonx_orchestrate/cli/commands/server/server_command.py,sha256=IkVcYjC_ijmDOYtKfeoMmGNC0Y0M63j5k8x2dF8Cqnc,39952
58
+ ibm_watsonx_orchestrate/cli/commands/models/models_controller.py,sha256=eZSYQUg9TL_-8lgcPVpKIx7MtOE7K_NCvZW9Y9YsFA0,18466
59
+ ibm_watsonx_orchestrate/cli/commands/server/server_command.py,sha256=ho1rSTN_fIJKeKzA5d4BdoQELl_4aF5Gzx90VySbaX8,39687
61
60
  ibm_watsonx_orchestrate/cli/commands/server/types.py,sha256=UCrgGErbSVBnOzesfjrIii4tTCuVfWemYz5AKGZX0oA,4213
62
61
  ibm_watsonx_orchestrate/cli/commands/settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
62
  ibm_watsonx_orchestrate/cli/commands/settings/settings_command.py,sha256=CzXRkd-97jXyS6LtaaNtMah-aZu0919dYl-mDwzGThc,344
@@ -78,7 +77,7 @@ ibm_watsonx_orchestrate/client/client_errors.py,sha256=72MKCNZbKoo2QXyY0RicLhP3r
78
77
  ibm_watsonx_orchestrate/client/credentials.py,sha256=gDVeeQZDdbbjJiO1EI61yx2oRgTQctxA2ZesSDHI4DA,3786
79
78
  ibm_watsonx_orchestrate/client/local_service_instance.py,sha256=dt7vfLnjgt7mT8wSq8SJZndNTwsPzhb0XDhcnPUPFpU,3524
80
79
  ibm_watsonx_orchestrate/client/service_instance.py,sha256=fp3Lc4yQf4zTkxVS5WnIAkrHT0xG_a5i44qcLeQkaa4,6600
81
- ibm_watsonx_orchestrate/client/utils.py,sha256=xf52qHluV-fKiKY29IeIN0xWlBCFbdUF19XCnN6HxQA,5666
80
+ ibm_watsonx_orchestrate/client/utils.py,sha256=MUw11r0_wYv3RdF6-1BmSxcwYNF6q2_Urte7tMYTKVA,5836
82
81
  ibm_watsonx_orchestrate/client/agents/agent_client.py,sha256=v1ZqXKj3p5JeJyOLpV84UUI2LY8XPjW1ejo5yzkeiMQ,4708
83
82
  ibm_watsonx_orchestrate/client/agents/assistant_agent_client.py,sha256=1JQN0E4T_uz5V0LM-LD1ahNu2KCeFBjXAr8WCiP9mkE,1745
84
83
  ibm_watsonx_orchestrate/client/agents/external_agent_client.py,sha256=iQ44XBdC4rYfS-zFn4St1xC5y5gf5SNqKHzMNQcFDZc,1808
@@ -86,9 +85,9 @@ ibm_watsonx_orchestrate/client/analytics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5
86
85
  ibm_watsonx_orchestrate/client/analytics/llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
87
86
  ibm_watsonx_orchestrate/client/analytics/llm/analytics_llm_client.py,sha256=0YS_BCpmf5oGFawpZkJ38cuz5ArhKsZIbSydWRd194s,1340
88
87
  ibm_watsonx_orchestrate/client/connections/__init__.py,sha256=J7TOyVg38h71AlaJjlFs5fOuAXTceHvELtOJ9oz4Mvg,207
89
- ibm_watsonx_orchestrate/client/connections/connections_client.py,sha256=B6LQPwoFHg_CIXHEJBjVu6fXnRj_xVsLGsC-DhmdfSQ,8478
88
+ ibm_watsonx_orchestrate/client/connections/connections_client.py,sha256=8f_olWVgQVLi6xKO_DvV68zu_AMLe1DMhoQAhC-BG3g,7583
90
89
  ibm_watsonx_orchestrate/client/connections/utils.py,sha256=f6HsiDI6cycOqfYN6P4uZ3SQds83xlh83zTUioZPeYk,2618
91
- ibm_watsonx_orchestrate/client/copilot/cpe/copilot_cpe_client.py,sha256=ZXm0o-LDcmSoMw2o4AaCwRDLT0GuffmAidsbHwW856M,1878
90
+ ibm_watsonx_orchestrate/client/copilot/cpe/copilot_cpe_client.py,sha256=eGE5VJb47XZxiMszBVQ7u0NKTVeHPuGVyfRJ6qPKlVs,1939
92
91
  ibm_watsonx_orchestrate/client/knowledge_bases/knowledge_base_client.py,sha256=YjC16dcL_l0jd-6yZ6uH8anlL4yaIv9f-7Y_urPuXWM,2201
93
92
  ibm_watsonx_orchestrate/client/model_policies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
94
93
  ibm_watsonx_orchestrate/client/model_policies/model_policies_client.py,sha256=Ddjraesv1MRPhZebB0PdBL0zgdsoWmnYpWTUci_6XFI,2258
@@ -97,8 +96,8 @@ ibm_watsonx_orchestrate/client/models/models_client.py,sha256=ZvP3iPgUFw_SXp41kJ
97
96
  ibm_watsonx_orchestrate/client/toolkit/toolkit_client.py,sha256=TLFNS39EeBD_t4Y-rX9sGp4sWBDr--mE5qVtHq8Q2hk,3121
98
97
  ibm_watsonx_orchestrate/client/tools/tempus_client.py,sha256=24fKDZUOVHBW-Vj4mubnpnUmab5LgGn8u5hOVyJaozI,1804
99
98
  ibm_watsonx_orchestrate/client/tools/tool_client.py,sha256=d3i3alVwa0TCN72w9sWOrM20GCbNmnpTnqEOJVbBIFM,1994
100
- ibm_watsonx_orchestrate/docker/compose-lite.yml,sha256=KG2k-HsRBpxlhlEMTY9dUecSpdkzIPf__Kcm1AeJxOk,39168
101
- ibm_watsonx_orchestrate/docker/default.env,sha256=jyaZtxq7G6oPfmSl74DRmnEImkmwXaIFKmud2QVt5bQ,5795
99
+ ibm_watsonx_orchestrate/docker/compose-lite.yml,sha256=igtukwqVFamdaRbuAbrlLPU8EfZ7hpveWSA0Ka34YHo,39437
100
+ ibm_watsonx_orchestrate/docker/default.env,sha256=84p3BEFeA0mVe_C_WKMi4JLiOhQkFLq8hwI_Hoe1eWE,5894
102
101
  ibm_watsonx_orchestrate/docker/proxy-config-single.yaml,sha256=WEbK4ENFuTCYhzRu_QblWp1_GMARgZnx5vReQafkIG8,308
103
102
  ibm_watsonx_orchestrate/docker/start-up.sh,sha256=LTtwHp0AidVgjohis2LXGvZnkFQStOiUAxgGABOyeUI,1811
104
103
  ibm_watsonx_orchestrate/docker/sdk/ibm_watsonx_orchestrate-0.6.0-py3-none-any.whl,sha256=Hi3-owh5OM0Jz2ihX9nLoojnr7Ky1TV-GelyqLcewLE,2047417
@@ -106,14 +105,14 @@ ibm_watsonx_orchestrate/docker/sdk/ibm_watsonx_orchestrate-0.6.0.tar.gz,sha256=e
106
105
  ibm_watsonx_orchestrate/docker/tempus/common-config.yaml,sha256=Zo3F36F5DV4VO_vUg1RG-r4WhcukVh79J2fXhGl6j0A,22
107
106
  ibm_watsonx_orchestrate/flow_builder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
107
  ibm_watsonx_orchestrate/flow_builder/data_map.py,sha256=1brmWWFERDsNG2XGais-5-r58LKUUwBtqwdaLQIFRhE,503
109
- ibm_watsonx_orchestrate/flow_builder/node.py,sha256=L7PPGJ9bb2QiyJSLcQRpcwC_igXTBsQx8MnSchYtjCs,4489
110
- ibm_watsonx_orchestrate/flow_builder/types.py,sha256=G2sFk2-HwY3-giqLqpDIvVSPvQjPhb6rLjxaamnR6uY,34863
111
- ibm_watsonx_orchestrate/flow_builder/utils.py,sha256=wTyYnLmB_SsT7A-VxRRnqNZ6jwChJ95EnlZ2wZXU03o,11731
112
- ibm_watsonx_orchestrate/flow_builder/flows/__init__.py,sha256=ZXinYYsxtplVqoJJSZtog-LCWIN80SrdleTsCEmRtK0,956
108
+ ibm_watsonx_orchestrate/flow_builder/node.py,sha256=I90a-K_xnEgZrl2NHo_rDmfT2Dj0n0Om15aDnEzhe74,4755
109
+ ibm_watsonx_orchestrate/flow_builder/types.py,sha256=bpnodCo9PnacSCvKHEybx8F8rvcp55DXITrXUmt2q88,37142
110
+ ibm_watsonx_orchestrate/flow_builder/utils.py,sha256=1ZetA6GBCG5MGqhGWDM66R_VuyRZ1pYCtVeeIRQgNIg,11709
111
+ ibm_watsonx_orchestrate/flow_builder/flows/__init__.py,sha256=dHS2fB-xbVS5yt_yNyZqYeuiAGs78lbCF65AX_VQlD4,1025
113
112
  ibm_watsonx_orchestrate/flow_builder/flows/constants.py,sha256=XXYtL5Y1OTjj3jKo2zoJiwb7FCUNu_M43fgU8w591TY,322
114
113
  ibm_watsonx_orchestrate/flow_builder/flows/decorators.py,sha256=lr4qSWq5PWqlGFf4fzUQZCVQDHBYflrYwZ24S89Aq80,2794
115
114
  ibm_watsonx_orchestrate/flow_builder/flows/events.py,sha256=VyaBm0sADwr15LWfKbcBQS1M80NKqzYDj3UlW3OpOf4,2984
116
- ibm_watsonx_orchestrate/flow_builder/flows/flow.py,sha256=SX7iPfUD7OKoxH2-Y8kqpHVfkqHDgRKtuwk5e1uNaEo,53707
115
+ ibm_watsonx_orchestrate/flow_builder/flows/flow.py,sha256=a33ciPFM5VUQlY4BdcXAQVed_MGARNi_GpChIHJ1uS4,55124
117
116
  ibm_watsonx_orchestrate/run/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
118
117
  ibm_watsonx_orchestrate/run/connections.py,sha256=K-65GXPA8GEsVmRdPfMe_LB2G9RfXQUr95wvRUOhkS4,1828
119
118
  ibm_watsonx_orchestrate/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -122,8 +121,8 @@ ibm_watsonx_orchestrate/utils/utils.py,sha256=U7z_2iASoFiZ2zM0a_2Mc2Y-P5oOT7hOwu
122
121
  ibm_watsonx_orchestrate/utils/logging/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
123
122
  ibm_watsonx_orchestrate/utils/logging/logger.py,sha256=FzeGnidXAjC7yHrvIaj4KZPeaBBSCniZFlwgr5yV3oA,1037
124
123
  ibm_watsonx_orchestrate/utils/logging/logging.yaml,sha256=9_TKfuFr1barnOKP0fZT5D6MhddiwsXVTFjtRbcOO5w,314
125
- ibm_watsonx_orchestrate-1.8.0b0.dist-info/METADATA,sha256=MlvtXVevJQdRFHTTwAFAXw0TFTI4ZP8E2tyWQobPvuI,1431
126
- ibm_watsonx_orchestrate-1.8.0b0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
127
- ibm_watsonx_orchestrate-1.8.0b0.dist-info/entry_points.txt,sha256=SfIT02-Jen5e99OcLhzbcM9Bdyf8SGVOCtnSplgZdQI,69
128
- ibm_watsonx_orchestrate-1.8.0b0.dist-info/licenses/LICENSE,sha256=Shgxx7hTdCOkiVRmfGgp_1ISISrwQD7m2f0y8Hsapl4,1083
129
- ibm_watsonx_orchestrate-1.8.0b0.dist-info/RECORD,,
124
+ ibm_watsonx_orchestrate-1.8.1.dist-info/METADATA,sha256=GqBl0E5ZkcUj_R4Muk7lL7hR0GgV3UsS4PB2xEaBiVo,1360
125
+ ibm_watsonx_orchestrate-1.8.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
126
+ ibm_watsonx_orchestrate-1.8.1.dist-info/entry_points.txt,sha256=SfIT02-Jen5e99OcLhzbcM9Bdyf8SGVOCtnSplgZdQI,69
127
+ ibm_watsonx_orchestrate-1.8.1.dist-info/licenses/LICENSE,sha256=Shgxx7hTdCOkiVRmfGgp_1ISISrwQD7m2f0y8Hsapl4,1083
128
+ ibm_watsonx_orchestrate-1.8.1.dist-info/RECORD,,
@@ -1,149 +0,0 @@
1
- import json
2
- from pathlib import Path
3
- from typing import Any, Dict, Type, Literal
4
-
5
- import jsonschema
6
- from pydantic import BaseModel
7
- from pydantic.json_schema import DEFAULT_REF_TEMPLATE, GenerateJsonSchema, JsonSchemaMode
8
- from pydantic.main import IncEx
9
- from typing_extensions import Self
10
-
11
- from ibm_watsonx_orchestrate.agent_builder.tools import ToolRequestBody, ToolResponseBody, JsonSchemaObject
12
-
13
-
14
- def generate_schema_only_base_model(schema: ToolRequestBody | ToolResponseBody | JsonSchemaObject) -> Type[BaseModel]:
15
- class SchemaOnlyBaseModel(BaseModel):
16
- __primitive__: Any
17
- model_config = {
18
- 'extra': 'allow'
19
- }
20
- """
21
- The purpose of a SchemaOnlyBaseModel is to pass along the json schema represented by schema
22
- to a langchain tool's arg_schema
23
- :arg schema The json schema to emulate
24
- :returns a fake BaseModel that only returns a json schema
25
- """
26
-
27
- def __init__(self, /, *args, **kwargs: Any) -> None:
28
- if schema.type == 'object':
29
- super().__init__(**kwargs)
30
- for name, value in kwargs.items():
31
- setattr(self, name, value)
32
- else:
33
- kwargs={}
34
- kwargs['__primitive__'] = args[0]
35
- super().__init__(**kwargs)
36
- setattr(self, '__primitive__', args[0])
37
-
38
- @classmethod
39
- def model_json_schema(cls, by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE,
40
- schema_generator: type[GenerateJsonSchema] = GenerateJsonSchema,
41
- mode: JsonSchemaMode = 'validation') -> dict[str, Any]:
42
- return schema.model_dump(exclude_unset=True, exclude_none=True)
43
-
44
- @classmethod
45
- def schema(cls, by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE) -> Dict[str, Any]:
46
- return schema.model_dump(exclude_unset=True, exclude_none=True)
47
-
48
- @classmethod
49
- def schema_json(cls, *, by_alias: bool = True, ref_template: str = DEFAULT_REF_TEMPLATE,
50
- **dumps_kwargs: Any) -> str:
51
- return schema.model_dump_json(exclude_unset=True, exclude_none=True)
52
-
53
- @classmethod
54
- def model_validate_json(cls, json_data: str | bytes | bytearray, *, strict: bool | None = None,
55
- context: Any | None = None) -> Self:
56
- obj = json.loads(json_data)
57
- jsonschema.validate(obj, schema=schema.model_dump(exclude_unset=True))
58
- if schema.type == 'object':
59
- return SchemaOnlyBaseModel(**obj)
60
- else:
61
- return SchemaOnlyBaseModel(obj)
62
-
63
- @classmethod
64
- def model_validate(cls, obj: Any, *, strict: bool | None = None, from_attributes: bool | None = None,
65
- context: Any | None = None) -> Self:
66
- jsonschema.validate(obj, schema=schema.model_dump(exclude_unset=True))
67
- if schema.type == 'object':
68
- return SchemaOnlyBaseModel(**obj)
69
- else:
70
- return SchemaOnlyBaseModel(obj)
71
-
72
- @classmethod
73
- def model_validate_strings(cls, obj: Any, *, strict: bool | None = None, context: Any | None = None) -> Self:
74
- raise NotImplementedError('unimplemented for SchemaOnlyBaseModel')
75
-
76
- @classmethod
77
- def validate(cls, value: Any) -> Self:
78
- jsonschema.validate(value, schema=schema.model_dump(exclude_unset=True))
79
- return SchemaOnlyBaseModel(**value)
80
-
81
- @classmethod
82
- def model_construct(cls, _fields_set: set[str] | None = None, **values: Any) -> Self:
83
- raise NotImplementedError('unimplemented for SchemaOnlyBaseModel')
84
-
85
- @classmethod
86
- def model_parametrized_name(cls, params: tuple[type[Any], ...]) -> str:
87
- raise NotImplementedError('unimplemented for SchemaOnlyBaseModel')
88
-
89
- @classmethod
90
- def model_rebuild(cls, *, force: bool = False, raise_errors: bool = True, _parent_namespace_depth: int = 2,
91
- _types_namespace: Any = None) -> bool | None:
92
- raise NotImplementedError('unimplemented for SchemaOnlyBaseModel')
93
-
94
- @classmethod
95
- def parse_obj(cls, obj: Any) -> Self:
96
- raise NotImplementedError('unimplemented for SchemaOnlyBaseModel')
97
-
98
- @classmethod
99
- def parse_raw(cls, b: str | bytes, *, content_type: str | None = None, encoding: str = 'utf8',
100
- proto: Any | None = None, allow_pickle: bool = False) -> Self:
101
- raise NotImplementedError('unimplemented for SchemaOnlyBaseModel')
102
-
103
- @classmethod
104
- def parse_file(cls, path: str | Path, *, content_type: str | None = None, encoding: str = 'utf8',
105
- proto: Any | None = None, allow_pickle: bool = False) -> Self:
106
- raise NotImplementedError('unimplemented for SchemaOnlyBaseModel')
107
-
108
- @classmethod
109
- def from_orm(cls, obj: Any) -> Self:
110
- raise NotImplementedError('unimplemented for SchemaOnlyBaseModel')
111
-
112
- @classmethod
113
- def construct(cls, _fields_set: set[str] | None = None, **values: Any) -> Self:
114
- raise NotImplementedError('unimplemented for SchemaOnlyBaseModel')
115
-
116
- @classmethod
117
- def update_forward_refs(cls, **localns: Any) -> None:
118
- raise NotImplementedError('unimplemented for SchemaOnlyBaseModel')
119
-
120
- def model_dump(self, *, mode: Literal['json', 'python'] | str = 'python', include: IncEx | None = None,
121
- exclude: IncEx | None = None, context: Any | None = None, by_alias: bool = False,
122
- exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False,
123
- round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True,
124
- serialize_as_any: bool = False) -> dict[str, Any]:
125
- primitive = getattr(self, '__primitive__', None)
126
- if primitive is not None:
127
- return primitive
128
- else:
129
- return super().model_dump(mode=mode, include=include, exclude=exclude, context=context, by_alias=by_alias,
130
- exclude_unset=exclude_unset, exclude_defaults=exclude_defaults,
131
- exclude_none=exclude_none, round_trip=round_trip, warnings=warnings,
132
- serialize_as_any=serialize_as_any)
133
-
134
- def model_dump_json(self, *, indent: int | None = None, include: IncEx | None = None,
135
- exclude: IncEx | None = None, context: Any | None = None, by_alias: bool = False,
136
- exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False,
137
- round_trip: bool = False, warnings: bool | Literal['none', 'warn', 'error'] = True,
138
- serialize_as_any: bool = False) -> str:
139
- primitive = getattr(self, '__primitive__')
140
- if primitive is not None:
141
- return json.dumps(primitive)
142
- else:
143
- return super().model_dump_json(indent=indent, include=include, exclude=exclude, context=context,
144
- by_alias=by_alias, exclude_unset=exclude_unset,
145
- exclude_defaults=exclude_defaults, exclude_none=exclude_none,
146
- round_trip=round_trip, warnings=warnings, serialize_as_any=serialize_as_any)
147
-
148
- return SchemaOnlyBaseModel
149
-