Skip to content

Commit e9b0d33

Browse files
committed
Release 0.0.68
1 parent 2a77ddc commit e9b0d33

12 files changed

+168
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "axiomatic"
33

44
[tool.poetry]
55
name = "axiomatic"
6-
version = "0.0.67"
6+
version = "0.0.68"
77
description = ""
88
readme = "README.md"
99
authors = []

src/axiomatic/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
ComputationArgumentsValue,
88
CostFunction,
99
ExecuteCodeResponse,
10+
ExtractConstantsResponse,
1011
ExtractTextResponse,
1112
FindMappingResponse,
1213
FindUserResponse,
@@ -74,6 +75,7 @@
7475
"ComputationArgumentsValue",
7576
"CostFunction",
7677
"ExecuteCodeResponse",
78+
"ExtractConstantsResponse",
7779
"ExtractTextResponse",
7880
"FindMappingResponse",
7981
"FindUserResponse",

src/axiomatic/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_headers(self) -> typing.Dict[str, str]:
1616
headers: typing.Dict[str, str] = {
1717
"X-Fern-Language": "Python",
1818
"X-Fern-SDK-Name": "axiomatic",
19-
"X-Fern-SDK-Version": "0.0.67",
19+
"X-Fern-SDK-Version": "0.0.68",
2020
}
2121
headers["X-API-Key"] = self.api_key
2222
return headers

src/axiomatic/document/client.py

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from json.decoder import JSONDecodeError
1212
from ..core.api_error import ApiError
1313
from ..types.parse_response import ParseResponse
14+
from ..types.extract_constants_response import ExtractConstantsResponse
1415
from ..core.client_wrapper import AsyncClientWrapper
1516

1617
# this is used as the default value for optional parameters
@@ -175,6 +176,69 @@ def parse(
175176
raise ApiError(status_code=_response.status_code, body=_response.text)
176177
raise ApiError(status_code=_response.status_code, body=_response_json)
177178

179+
def constants(
180+
self,
181+
*,
182+
file: core.File,
183+
constants: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
184+
request_options: typing.Optional[RequestOptions] = None,
185+
) -> ExtractConstantsResponse:
186+
"""
187+
Extracts specific constants from documents
188+
189+
Parameters
190+
----------
191+
file : core.File
192+
See core.File for more documentation
193+
194+
constants : typing.Optional[typing.Union[str, typing.Sequence[str]]]
195+
List of constants to extract
196+
197+
request_options : typing.Optional[RequestOptions]
198+
Request-specific configuration.
199+
200+
Returns
201+
-------
202+
ExtractConstantsResponse
203+
Successful Response
204+
"""
205+
_response = self._client_wrapper.httpx_client.request(
206+
"document/constants",
207+
method="POST",
208+
params={
209+
"constants": constants,
210+
},
211+
data={},
212+
files={
213+
"file": file,
214+
},
215+
request_options=request_options,
216+
omit=OMIT,
217+
)
218+
try:
219+
if 200 <= _response.status_code < 300:
220+
return typing.cast(
221+
ExtractConstantsResponse,
222+
parse_obj_as(
223+
type_=ExtractConstantsResponse, # type: ignore
224+
object_=_response.json(),
225+
),
226+
)
227+
if _response.status_code == 422:
228+
raise UnprocessableEntityError(
229+
typing.cast(
230+
HttpValidationError,
231+
parse_obj_as(
232+
type_=HttpValidationError, # type: ignore
233+
object_=_response.json(),
234+
),
235+
)
236+
)
237+
_response_json = _response.json()
238+
except JSONDecodeError:
239+
raise ApiError(status_code=_response.status_code, body=_response.text)
240+
raise ApiError(status_code=_response.status_code, body=_response_json)
241+
178242

179243
class AsyncDocumentClient:
180244
def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -349,3 +413,66 @@ async def main() -> None:
349413
except JSONDecodeError:
350414
raise ApiError(status_code=_response.status_code, body=_response.text)
351415
raise ApiError(status_code=_response.status_code, body=_response_json)
416+
417+
async def constants(
418+
self,
419+
*,
420+
file: core.File,
421+
constants: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
422+
request_options: typing.Optional[RequestOptions] = None,
423+
) -> ExtractConstantsResponse:
424+
"""
425+
Extracts specific constants from documents
426+
427+
Parameters
428+
----------
429+
file : core.File
430+
See core.File for more documentation
431+
432+
constants : typing.Optional[typing.Union[str, typing.Sequence[str]]]
433+
List of constants to extract
434+
435+
request_options : typing.Optional[RequestOptions]
436+
Request-specific configuration.
437+
438+
Returns
439+
-------
440+
ExtractConstantsResponse
441+
Successful Response
442+
"""
443+
_response = await self._client_wrapper.httpx_client.request(
444+
"document/constants",
445+
method="POST",
446+
params={
447+
"constants": constants,
448+
},
449+
data={},
450+
files={
451+
"file": file,
452+
},
453+
request_options=request_options,
454+
omit=OMIT,
455+
)
456+
try:
457+
if 200 <= _response.status_code < 300:
458+
return typing.cast(
459+
ExtractConstantsResponse,
460+
parse_obj_as(
461+
type_=ExtractConstantsResponse, # type: ignore
462+
object_=_response.json(),
463+
),
464+
)
465+
if _response.status_code == 422:
466+
raise UnprocessableEntityError(
467+
typing.cast(
468+
HttpValidationError,
469+
parse_obj_as(
470+
type_=HttpValidationError, # type: ignore
471+
object_=_response.json(),
472+
),
473+
)
474+
)
475+
_response_json = _response.json()
476+
except JSONDecodeError:
477+
raise ApiError(status_code=_response.status_code, body=_response.text)
478+
raise ApiError(status_code=_response.status_code, body=_response_json)

src/axiomatic/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from .computation_arguments_value import ComputationArgumentsValue
77
from .cost_function import CostFunction
88
from .execute_code_response import ExecuteCodeResponse
9+
from .extract_constants_response import ExtractConstantsResponse
910
from .extract_text_response import ExtractTextResponse
1011
from .find_mapping_response import FindMappingResponse
1112
from .find_user_response import FindUserResponse
@@ -64,6 +65,7 @@
6465
"ComputationArgumentsValue",
6566
"CostFunction",
6667
"ExecuteCodeResponse",
68+
"ExtractConstantsResponse",
6769
"ExtractTextResponse",
6870
"FindMappingResponse",
6971
"FindUserResponse",

src/axiomatic/types/computation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
class Computation(UniversalBaseModel):
1111
"""
1212
A class describing a computation.
13+
The validation is such that an instance contains a name and a set of arguments that are valid to instantiate a function from the available computations.
14+
It does not check if the resulting computation can be called, this depends on the target Netlist.
1315
"""
1416

1517
name: str = pydantic.Field()
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
from ..core.pydantic_utilities import UniversalBaseModel
4+
import typing
5+
from ..core.pydantic_utilities import IS_PYDANTIC_V2
6+
import pydantic
7+
8+
9+
class ExtractConstantsResponse(UniversalBaseModel):
10+
constants: typing.Dict[str, str]
11+
12+
if IS_PYDANTIC_V2:
13+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
14+
else:
15+
16+
class Config:
17+
frozen = True
18+
smart_union = True
19+
extra = pydantic.Extra.allow

src/axiomatic/types/statement_validation.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
# This file was auto-generated by Fern from our API Definition.
22

33
from ..core.pydantic_utilities import UniversalBaseModel
4+
import typing
45
import pydantic
56
from ..core.pydantic_utilities import IS_PYDANTIC_V2
6-
import typing
77

88

99
class StatementValidation(UniversalBaseModel):
1010
"""
1111
The status of a statement.
1212
"""
1313

14-
holds: bool = pydantic.Field()
14+
satisfiable: typing.Optional[bool] = pydantic.Field(default=None)
15+
"""
16+
Whether the statement is satisfiable or not.
17+
"""
18+
19+
holds: typing.Optional[bool] = pydantic.Field(default=None)
1520
"""
1621
Whether the statement holds or not.
1722
"""
1823

19-
message: str = pydantic.Field()
24+
message: typing.Optional[str] = pydantic.Field(default=None)
2025
"""
2126
The feeedback message.
2227
"""

src/axiomatic/types/structure_function_call.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
class StructureFunctionCall(UniversalBaseModel):
1212
"""
1313
The model describing a function call.
14+
The validation is such that an instance contains a function name and a set of arguments that are valid to instantiate a function and a satisfiability check from the available functions.
15+
The resulting function and satisfiability check can always be called on any Netlist.
1416
"""
1517

1618
type: typing.Optional[typing.Literal["STRUCTURE_FUNCTION_CALL"]] = None

src/axiomatic/types/structure_function_call_arguments_value.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
import typing
44

5-
StructureFunctionCallArgumentsValue = typing.Union[float, int, str]
5+
StructureFunctionCallArgumentsValue = typing.Union[float, int, str, bool]

0 commit comments

Comments
 (0)