perceptic-core-client 0.30.0__py3-none-any.whl → 0.31.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.

Potentially problematic release.


This version of perceptic-core-client might be problematic. Click here for more details.

Files changed (29) hide show
  1. perceptic_core_client/__init__.py +22 -0
  2. perceptic_core_client/api/__init__.py +1 -0
  3. perceptic_core_client/api/citations_resource_api.py +569 -0
  4. perceptic_core_client/models/__init__.py +10 -0
  5. perceptic_core_client/models/biotech_analysis_api_dto.py +119 -0
  6. perceptic_core_client/models/biotech_analysis_image_annotated_citation_api_dto.py +91 -0
  7. perceptic_core_client/models/bulk_get_citations_request.py +87 -0
  8. perceptic_core_client/models/bulk_get_citations_response.py +95 -0
  9. perceptic_core_client/models/citation_api_dto.py +102 -0
  10. perceptic_core_client/models/citation_metadata_api_dto.py +189 -0
  11. perceptic_core_client/models/get_citation_output_uri_response.py +87 -0
  12. perceptic_core_client/models/highlighted_text_citation_metadata_api_dto.py +91 -0
  13. perceptic_core_client/models/image_detection_box_api_dto.py +97 -0
  14. perceptic_core_client/models/web_page_citation_metadata_api_dto.py +89 -0
  15. perceptic_core_client/test/test_biotech_analysis_api_dto.py +77 -0
  16. perceptic_core_client/test/test_biotech_analysis_image_annotated_citation_api_dto.py +78 -0
  17. perceptic_core_client/test/test_bulk_get_citations_request.py +53 -0
  18. perceptic_core_client/test/test_bulk_get_citations_response.py +57 -0
  19. perceptic_core_client/test/test_citation_api_dto.py +54 -0
  20. perceptic_core_client/test/test_citation_metadata_api_dto.py +83 -0
  21. perceptic_core_client/test/test_citations_resource_api.py +45 -0
  22. perceptic_core_client/test/test_get_citation_output_uri_response.py +51 -0
  23. perceptic_core_client/test/test_highlighted_text_citation_metadata_api_dto.py +53 -0
  24. perceptic_core_client/test/test_image_detection_box_api_dto.py +56 -0
  25. perceptic_core_client/test/test_web_page_citation_metadata_api_dto.py +52 -0
  26. {perceptic_core_client-0.30.0.dist-info → perceptic_core_client-0.31.0.dist-info}/METADATA +1 -1
  27. {perceptic_core_client-0.30.0.dist-info → perceptic_core_client-0.31.0.dist-info}/RECORD +29 -7
  28. {perceptic_core_client-0.30.0.dist-info → perceptic_core_client-0.31.0.dist-info}/WHEEL +0 -0
  29. {perceptic_core_client-0.30.0.dist-info → perceptic_core_client-0.31.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,189 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import json
17
+ import pprint
18
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
19
+ from typing import Any, List, Optional
20
+ from perceptic_core_client.models.biotech_analysis_image_annotated_citation_api_dto import BiotechAnalysisImageAnnotatedCitationApiDto
21
+ from perceptic_core_client.models.highlighted_text_citation_metadata_api_dto import HighlightedTextCitationMetadataApiDto
22
+ from perceptic_core_client.models.web_page_citation_metadata_api_dto import WebPageCitationMetadataApiDto
23
+ from pydantic import StrictStr, Field
24
+ from typing import Union, List, Set, Optional, Dict
25
+ from typing_extensions import Literal, Self
26
+
27
+ CITATIONMETADATAAPIDTO_ONE_OF_SCHEMAS = ["BiotechAnalysisImageAnnotatedCitationApiDto", "HighlightedTextCitationMetadataApiDto", "WebPageCitationMetadataApiDto"]
28
+
29
+ class CitationMetadataApiDto(BaseModel):
30
+ """
31
+ CitationMetadataApiDto
32
+ """
33
+ # data type: HighlightedTextCitationMetadataApiDto
34
+ oneof_schema_1_validator: Optional[HighlightedTextCitationMetadataApiDto] = None
35
+ # data type: WebPageCitationMetadataApiDto
36
+ oneof_schema_2_validator: Optional[WebPageCitationMetadataApiDto] = None
37
+ # data type: BiotechAnalysisImageAnnotatedCitationApiDto
38
+ oneof_schema_3_validator: Optional[BiotechAnalysisImageAnnotatedCitationApiDto] = None
39
+ actual_instance: Optional[Union[BiotechAnalysisImageAnnotatedCitationApiDto, HighlightedTextCitationMetadataApiDto, WebPageCitationMetadataApiDto]] = None
40
+ one_of_schemas: Set[str] = { "BiotechAnalysisImageAnnotatedCitationApiDto", "HighlightedTextCitationMetadataApiDto", "WebPageCitationMetadataApiDto" }
41
+
42
+ model_config = ConfigDict(
43
+ validate_assignment=True,
44
+ protected_namespaces=(),
45
+ )
46
+
47
+
48
+ discriminator_value_class_map: Dict[str, str] = {
49
+ }
50
+
51
+ def __init__(self, *args, **kwargs) -> None:
52
+ if args:
53
+ if len(args) > 1:
54
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
55
+ if kwargs:
56
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
57
+ super().__init__(actual_instance=args[0])
58
+ else:
59
+ super().__init__(**kwargs)
60
+
61
+ @field_validator('actual_instance')
62
+ def actual_instance_must_validate_oneof(cls, v):
63
+ instance = CitationMetadataApiDto.model_construct()
64
+ error_messages = []
65
+ match = 0
66
+ # validate data type: HighlightedTextCitationMetadataApiDto
67
+ if not isinstance(v, HighlightedTextCitationMetadataApiDto):
68
+ error_messages.append(f"Error! Input type `{type(v)}` is not `HighlightedTextCitationMetadataApiDto`")
69
+ else:
70
+ match += 1
71
+ # validate data type: WebPageCitationMetadataApiDto
72
+ if not isinstance(v, WebPageCitationMetadataApiDto):
73
+ error_messages.append(f"Error! Input type `{type(v)}` is not `WebPageCitationMetadataApiDto`")
74
+ else:
75
+ match += 1
76
+ # validate data type: BiotechAnalysisImageAnnotatedCitationApiDto
77
+ if not isinstance(v, BiotechAnalysisImageAnnotatedCitationApiDto):
78
+ error_messages.append(f"Error! Input type `{type(v)}` is not `BiotechAnalysisImageAnnotatedCitationApiDto`")
79
+ else:
80
+ match += 1
81
+ if match > 1:
82
+ # more than 1 match
83
+ raise ValueError("Multiple matches found when setting `actual_instance` in CitationMetadataApiDto with oneOf schemas: BiotechAnalysisImageAnnotatedCitationApiDto, HighlightedTextCitationMetadataApiDto, WebPageCitationMetadataApiDto. Details: " + ", ".join(error_messages))
84
+ elif match == 0:
85
+ # no match
86
+ raise ValueError("No match found when setting `actual_instance` in CitationMetadataApiDto with oneOf schemas: BiotechAnalysisImageAnnotatedCitationApiDto, HighlightedTextCitationMetadataApiDto, WebPageCitationMetadataApiDto. Details: " + ", ".join(error_messages))
87
+ else:
88
+ return v
89
+
90
+ @classmethod
91
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
92
+ return cls.from_json(json.dumps(obj))
93
+
94
+ @classmethod
95
+ def from_json(cls, json_str: str) -> Self:
96
+ """Returns the object represented by the json string"""
97
+ instance = cls.model_construct()
98
+ error_messages = []
99
+ match = 0
100
+
101
+ # use oneOf discriminator to lookup the data type
102
+ _data_type = json.loads(json_str).get("type")
103
+ if not _data_type:
104
+ raise ValueError("Failed to lookup data type from the field `type` in the input.")
105
+
106
+ # check if data type is `AnnotatedImageCitationMetadataApiDto`
107
+ if _data_type == "annotated-image":
108
+ instance.actual_instance = AnnotatedImageCitationMetadataApiDto.from_json(json_str)
109
+ return instance
110
+
111
+ # check if data type is `HighlightedTextCitationMetadataApiDto`
112
+ if _data_type == "highlighted-text":
113
+ instance.actual_instance = HighlightedTextCitationMetadataApiDto.from_json(json_str)
114
+ return instance
115
+
116
+ # check if data type is `WebPageCitationMetadataApiDto`
117
+ if _data_type == "web-page":
118
+ instance.actual_instance = WebPageCitationMetadataApiDto.from_json(json_str)
119
+ return instance
120
+
121
+ # check if data type is `AnnotatedImageCitationMetadataApiDto`
122
+ if _data_type == "AnnotatedImageCitationMetadataApiDto":
123
+ instance.actual_instance = AnnotatedImageCitationMetadataApiDto.from_json(json_str)
124
+ return instance
125
+
126
+ # check if data type is `HighlightedTextCitationMetadataApiDto`
127
+ if _data_type == "HighlightedTextCitationMetadataApiDto":
128
+ instance.actual_instance = HighlightedTextCitationMetadataApiDto.from_json(json_str)
129
+ return instance
130
+
131
+ # check if data type is `WebPageCitationMetadataApiDto`
132
+ if _data_type == "WebPageCitationMetadataApiDto":
133
+ instance.actual_instance = WebPageCitationMetadataApiDto.from_json(json_str)
134
+ return instance
135
+
136
+ # deserialize data into HighlightedTextCitationMetadataApiDto
137
+ try:
138
+ instance.actual_instance = HighlightedTextCitationMetadataApiDto.from_json(json_str)
139
+ match += 1
140
+ except (ValidationError, ValueError) as e:
141
+ error_messages.append(str(e))
142
+ # deserialize data into WebPageCitationMetadataApiDto
143
+ try:
144
+ instance.actual_instance = WebPageCitationMetadataApiDto.from_json(json_str)
145
+ match += 1
146
+ except (ValidationError, ValueError) as e:
147
+ error_messages.append(str(e))
148
+ # deserialize data into BiotechAnalysisImageAnnotatedCitationApiDto
149
+ try:
150
+ instance.actual_instance = BiotechAnalysisImageAnnotatedCitationApiDto.from_json(json_str)
151
+ match += 1
152
+ except (ValidationError, ValueError) as e:
153
+ error_messages.append(str(e))
154
+
155
+ if match > 1:
156
+ # more than 1 match
157
+ raise ValueError("Multiple matches found when deserializing the JSON string into CitationMetadataApiDto with oneOf schemas: BiotechAnalysisImageAnnotatedCitationApiDto, HighlightedTextCitationMetadataApiDto, WebPageCitationMetadataApiDto. Details: " + ", ".join(error_messages))
158
+ elif match == 0:
159
+ # no match
160
+ raise ValueError("No match found when deserializing the JSON string into CitationMetadataApiDto with oneOf schemas: BiotechAnalysisImageAnnotatedCitationApiDto, HighlightedTextCitationMetadataApiDto, WebPageCitationMetadataApiDto. Details: " + ", ".join(error_messages))
161
+ else:
162
+ return instance
163
+
164
+ def to_json(self) -> str:
165
+ """Returns the JSON representation of the actual instance"""
166
+ if self.actual_instance is None:
167
+ return "null"
168
+
169
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
170
+ return self.actual_instance.to_json()
171
+ else:
172
+ return json.dumps(self.actual_instance)
173
+
174
+ def to_dict(self) -> Optional[Union[Dict[str, Any], BiotechAnalysisImageAnnotatedCitationApiDto, HighlightedTextCitationMetadataApiDto, WebPageCitationMetadataApiDto]]:
175
+ """Returns the dict representation of the actual instance"""
176
+ if self.actual_instance is None:
177
+ return None
178
+
179
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
180
+ return self.actual_instance.to_dict()
181
+ else:
182
+ # primitive type
183
+ return self.actual_instance
184
+
185
+ def to_str(self) -> str:
186
+ """Returns the string representation of the actual instance"""
187
+ return pprint.pformat(self.model_dump())
188
+
189
+
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class GetCitationOutputUriResponse(BaseModel):
26
+ """
27
+ GetCitationOutputUriResponse
28
+ """ # noqa: E501
29
+ output_uri: Optional[StrictStr] = Field(default=None, alias="outputUri")
30
+ __properties: ClassVar[List[str]] = ["outputUri"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of GetCitationOutputUriResponse from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of GetCitationOutputUriResponse from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "outputUri": obj.get("outputUri")
84
+ })
85
+ return _obj
86
+
87
+
@@ -0,0 +1,91 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class HighlightedTextCitationMetadataApiDto(BaseModel):
26
+ """
27
+ HighlightedTextCitationMetadataApiDto
28
+ """ # noqa: E501
29
+ page_index: Optional[StrictInt] = Field(default=None, alias="pageIndex")
30
+ paragraph_index: Optional[StrictInt] = Field(default=None, alias="paragraphIndex")
31
+ text: Optional[StrictStr] = None
32
+ __properties: ClassVar[List[str]] = ["pageIndex", "paragraphIndex", "text"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of HighlightedTextCitationMetadataApiDto from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of HighlightedTextCitationMetadataApiDto from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate({
85
+ "pageIndex": obj.get("pageIndex"),
86
+ "paragraphIndex": obj.get("paragraphIndex"),
87
+ "text": obj.get("text")
88
+ })
89
+ return _obj
90
+
91
+
@@ -0,0 +1,97 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional, Union
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class ImageDetectionBoxApiDto(BaseModel):
26
+ """
27
+ ImageDetectionBoxApiDto
28
+ """ # noqa: E501
29
+ x_min: Optional[StrictInt] = Field(default=None, alias="xMin")
30
+ y_min: Optional[StrictInt] = Field(default=None, alias="yMin")
31
+ x_max: Optional[StrictInt] = Field(default=None, alias="xMax")
32
+ y_max: Optional[StrictInt] = Field(default=None, alias="yMax")
33
+ label: Optional[StrictStr] = None
34
+ confidence: Optional[Union[StrictFloat, StrictInt]] = None
35
+ __properties: ClassVar[List[str]] = ["xMin", "yMin", "xMax", "yMax", "label", "confidence"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of ImageDetectionBoxApiDto from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ return _dict
77
+
78
+ @classmethod
79
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
+ """Create an instance of ImageDetectionBoxApiDto from a dict"""
81
+ if obj is None:
82
+ return None
83
+
84
+ if not isinstance(obj, dict):
85
+ return cls.model_validate(obj)
86
+
87
+ _obj = cls.model_validate({
88
+ "xMin": obj.get("xMin"),
89
+ "yMin": obj.get("yMin"),
90
+ "xMax": obj.get("xMax"),
91
+ "yMax": obj.get("yMax"),
92
+ "label": obj.get("label"),
93
+ "confidence": obj.get("confidence")
94
+ })
95
+ return _obj
96
+
97
+
@@ -0,0 +1,89 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class WebPageCitationMetadataApiDto(BaseModel):
26
+ """
27
+ WebPageCitationMetadataApiDto
28
+ """ # noqa: E501
29
+ url: Optional[StrictStr] = None
30
+ description: Optional[StrictStr] = None
31
+ __properties: ClassVar[List[str]] = ["url", "description"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of WebPageCitationMetadataApiDto from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of WebPageCitationMetadataApiDto from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({
84
+ "url": obj.get("url"),
85
+ "description": obj.get("description")
86
+ })
87
+ return _obj
88
+
89
+
@@ -0,0 +1,77 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ import unittest
16
+
17
+ from perceptic_core_client.models.biotech_analysis_api_dto import BiotechAnalysisApiDto
18
+
19
+ class TestBiotechAnalysisApiDto(unittest.TestCase):
20
+ """BiotechAnalysisApiDto unit test stubs"""
21
+
22
+ def setUp(self):
23
+ pass
24
+
25
+ def tearDown(self):
26
+ pass
27
+
28
+ def make_instance(self, include_optional) -> BiotechAnalysisApiDto:
29
+ """Test BiotechAnalysisApiDto
30
+ include_optional is a boolean, when False only required
31
+ params are included, when True both required and
32
+ optional params are included """
33
+ # uncomment below to create an instance of `BiotechAnalysisApiDto`
34
+ """
35
+ model = BiotechAnalysisApiDto()
36
+ if include_optional:
37
+ return BiotechAnalysisApiDto(
38
+ raw_analysis = '',
39
+ compound_data_present = True,
40
+ compounds = [
41
+ ''
42
+ ],
43
+ development_stage = '',
44
+ therapeutic_area = '',
45
+ key_findings = [
46
+ ''
47
+ ],
48
+ risks = [
49
+ ''
50
+ ],
51
+ market_potential = '',
52
+ confidence = 1.337,
53
+ reasoning = '',
54
+ bounding_boxes = [
55
+ perceptic_core_client.models.image_detection_box_api_dto.ImageDetectionBoxApiDto(
56
+ x_min = 56,
57
+ y_min = 56,
58
+ x_max = 56,
59
+ y_max = 56,
60
+ label = '',
61
+ confidence = 1.337, )
62
+ ],
63
+ page_index = 56,
64
+ character_count = 56
65
+ )
66
+ else:
67
+ return BiotechAnalysisApiDto(
68
+ )
69
+ """
70
+
71
+ def testBiotechAnalysisApiDto(self):
72
+ """Test BiotechAnalysisApiDto"""
73
+ # inst_req_only = self.make_instance(include_optional=False)
74
+ # inst_req_and_optional = self.make_instance(include_optional=True)
75
+
76
+ if __name__ == '__main__':
77
+ unittest.main()