pulse-python-sdk 0.0.52__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 (72) hide show
  1. pulse/__init__.py +42 -0
  2. pulse/client.py +666 -0
  3. pulse/core/__init__.py +34 -0
  4. pulse/core/api_error.py +23 -0
  5. pulse/core/client_wrapper.py +89 -0
  6. pulse/core/datetime_utils.py +28 -0
  7. pulse/core/file.py +67 -0
  8. pulse/core/force_multipart.py +18 -0
  9. pulse/core/http_client.py +663 -0
  10. pulse/core/http_response.py +55 -0
  11. pulse/core/http_sse/__init__.py +42 -0
  12. pulse/core/http_sse/_api.py +112 -0
  13. pulse/core/http_sse/_decoders.py +61 -0
  14. pulse/core/http_sse/_exceptions.py +7 -0
  15. pulse/core/http_sse/_models.py +17 -0
  16. pulse/core/jsonable_encoder.py +100 -0
  17. pulse/core/pydantic_utilities.py +260 -0
  18. pulse/core/query_encoder.py +58 -0
  19. pulse/core/remove_none_from_dict.py +11 -0
  20. pulse/core/request_options.py +35 -0
  21. pulse/core/serialization.py +276 -0
  22. pulse/core/unchecked_base_model.py +396 -0
  23. pulse/environment.py +7 -0
  24. pulse/errors/__init__.py +4 -0
  25. pulse/errors/bad_request_error.py +10 -0
  26. pulse/errors/forbidden_error.py +10 -0
  27. pulse/errors/internal_server_error.py +10 -0
  28. pulse/errors/not_found_error.py +10 -0
  29. pulse/errors/too_many_requests_error.py +10 -0
  30. pulse/errors/unauthorized_error.py +10 -0
  31. pulse/jobs/__init__.py +4 -0
  32. pulse/jobs/client.py +191 -0
  33. pulse/jobs/raw_client.py +408 -0
  34. pulse/py.typed +0 -0
  35. pulse/raw_client.py +661 -0
  36. pulse/types/__init__.py +4 -0
  37. pulse/types/extract_async_input.py +5 -0
  38. pulse/types/extract_async_response.py +43 -0
  39. pulse/types/extract_async_submission_response_status.py +7 -0
  40. pulse/types/extract_input.py +5 -0
  41. pulse/types/extract_json_input.py +116 -0
  42. pulse/types/extract_json_input_experimental_schema.py +5 -0
  43. pulse/types/extract_json_input_schema.py +5 -0
  44. pulse/types/extract_json_input_storage.py +36 -0
  45. pulse/types/extract_json_input_structured_output.py +38 -0
  46. pulse/types/extract_multipart_input.py +111 -0
  47. pulse/types/extract_multipart_input_experimental_schema.py +5 -0
  48. pulse/types/extract_multipart_input_schema.py +5 -0
  49. pulse/types/extract_multipart_input_storage.py +36 -0
  50. pulse/types/extract_multipart_input_structured_output.py +38 -0
  51. pulse/types/extract_options.py +111 -0
  52. pulse/types/extract_options_experimental_schema.py +5 -0
  53. pulse/types/extract_options_schema.py +5 -0
  54. pulse/types/extract_options_storage.py +36 -0
  55. pulse/types/extract_options_structured_output.py +38 -0
  56. pulse/types/extract_response.py +47 -0
  57. pulse/types/extract_source_multipart_one.py +27 -0
  58. pulse/types/extract_source_multipart_zero.py +27 -0
  59. pulse/types/job_cancellation_response.py +32 -0
  60. pulse/types/job_status.py +5 -0
  61. pulse/types/job_status_response.py +50 -0
  62. pulse/types/json_source.py +29 -0
  63. pulse/types/multipart_source.py +8 -0
  64. pulse/version.py +3 -0
  65. pulse/webhooks/__init__.py +4 -0
  66. pulse/webhooks/client.py +104 -0
  67. pulse/webhooks/raw_client.py +139 -0
  68. pulse/webhooks/types/__init__.py +4 -0
  69. pulse/webhooks/types/create_webhook_link_response.py +23 -0
  70. pulse_python_sdk-0.0.52.dist-info/METADATA +197 -0
  71. pulse_python_sdk-0.0.52.dist-info/RECORD +72 -0
  72. pulse_python_sdk-0.0.52.dist-info/WHEEL +4 -0
@@ -0,0 +1,43 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ import pydantic
7
+ import typing_extensions
8
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
9
+ from ..core.serialization import FieldMetadata
10
+ from ..core.unchecked_base_model import UncheckedBaseModel
11
+ from .extract_async_submission_response_status import ExtractAsyncSubmissionResponseStatus
12
+
13
+
14
+ class ExtractAsyncResponse(UncheckedBaseModel):
15
+ """
16
+ Metadata describing the enqueued asynchronous extraction job.
17
+ """
18
+
19
+ job_id: str = pydantic.Field()
20
+ """
21
+ Identifier assigned to the asynchronous extraction job.
22
+ """
23
+
24
+ status: ExtractAsyncSubmissionResponseStatus = pydantic.Field()
25
+ """
26
+ Initial status reported by the extractor.
27
+ """
28
+
29
+ queued_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="queuedAt")] = (
30
+ pydantic.Field(default=None)
31
+ )
32
+ """
33
+ Timestamp indicating when the job was accepted.
34
+ """
35
+
36
+ if IS_PYDANTIC_V2:
37
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
38
+ else:
39
+
40
+ class Config:
41
+ frozen = True
42
+ smart_union = True
43
+ extra = pydantic.Extra.allow
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ExtractAsyncSubmissionResponseStatus = typing.Union[
6
+ typing.Literal["pending", "processing", "completed", "failed", "canceled"], typing.Any
7
+ ]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ExtractInput = typing.Any
@@ -0,0 +1,116 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ from ..core.serialization import FieldMetadata
9
+ from ..core.unchecked_base_model import UncheckedBaseModel
10
+ from .extract_json_input_experimental_schema import ExtractJsonInputExperimentalSchema
11
+ from .extract_json_input_schema import ExtractJsonInputSchema
12
+ from .extract_json_input_storage import ExtractJsonInputStorage
13
+ from .extract_json_input_structured_output import ExtractJsonInputStructuredOutput
14
+
15
+
16
+ class ExtractJsonInput(UncheckedBaseModel):
17
+ """
18
+ Input schema for JSON requests (fileUrl only).
19
+ """
20
+
21
+ file_url: typing_extensions.Annotated[str, FieldMetadata(alias="fileUrl")] = pydantic.Field()
22
+ """
23
+ Public or pre-signed URL that Pulse will download and extract.
24
+ """
25
+
26
+ structured_output: typing_extensions.Annotated[
27
+ typing.Optional[ExtractJsonInputStructuredOutput], FieldMetadata(alias="structuredOutput")
28
+ ] = pydantic.Field(default=None)
29
+ """
30
+ Recommended method for schema-guided extraction. Contains the schema and optional prompt in a single object.
31
+ """
32
+
33
+ schema_: typing_extensions.Annotated[typing.Optional[ExtractJsonInputSchema], FieldMetadata(alias="schema")] = (
34
+ pydantic.Field(default=None)
35
+ )
36
+ """
37
+ (Deprecated) JSON schema describing structured data to extract. Use structuredOutput instead. Accepts either a JSON object or a stringified JSON representation.
38
+ """
39
+
40
+ experimental_schema: typing_extensions.Annotated[
41
+ typing.Optional[ExtractJsonInputExperimentalSchema], FieldMetadata(alias="experimentalSchema")
42
+ ] = pydantic.Field(default=None)
43
+ """
44
+ (Deprecated) Experimental schema definition used for feature flagged behaviour. Accepts either a JSON object or a stringified JSON representation.
45
+ """
46
+
47
+ schema_prompt: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="schemaPrompt")] = (
48
+ pydantic.Field(default=None)
49
+ )
50
+ """
51
+ (Deprecated) Natural language prompt for schema-guided extraction. Use structuredOutput.schemaPrompt instead.
52
+ """
53
+
54
+ custom_prompt: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="customPrompt")] = (
55
+ pydantic.Field(default=None)
56
+ )
57
+ """
58
+ (Deprecated) Custom instructions that augment the default extraction behaviour.
59
+ """
60
+
61
+ chunking: typing.Optional[str] = pydantic.Field(default=None)
62
+ """
63
+ Comma-separated list of chunking strategies to apply (for example `semantic,header,page,recursive`).
64
+ """
65
+
66
+ chunk_size: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="chunkSize")] = pydantic.Field(
67
+ default=None
68
+ )
69
+ """
70
+ Override for maximum characters per chunk when chunking is enabled.
71
+ """
72
+
73
+ pages: typing.Optional[str] = pydantic.Field(default=None)
74
+ """
75
+ Page range filter supporting segments such as `1-2` or mixed ranges like `1-2,5`.
76
+ """
77
+
78
+ extract_figure: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="extractFigure")] = (
79
+ pydantic.Field(default=None)
80
+ )
81
+ """
82
+ Toggle to enable figure extraction in results.
83
+ """
84
+
85
+ figure_description: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="figureDescription")] = (
86
+ pydantic.Field(default=None)
87
+ )
88
+ """
89
+ Toggle to generate descriptive captions for extracted figures.
90
+ """
91
+
92
+ return_html: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="returnHtml")] = pydantic.Field(
93
+ default=None
94
+ )
95
+ """
96
+ Whether to include HTML representation alongside markdown in the response.
97
+ """
98
+
99
+ thinking: typing.Optional[bool] = pydantic.Field(default=None)
100
+ """
101
+ (Deprecated) Enables expanded rationale output for debugging.
102
+ """
103
+
104
+ storage: typing.Optional[ExtractJsonInputStorage] = pydantic.Field(default=None)
105
+ """
106
+ Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created.
107
+ """
108
+
109
+ if IS_PYDANTIC_V2:
110
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
111
+ else:
112
+
113
+ class Config:
114
+ frozen = True
115
+ smart_union = True
116
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ExtractJsonInputExperimentalSchema = typing.Union[typing.Dict[str, typing.Any], str]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ExtractJsonInputSchema = typing.Union[typing.Dict[str, typing.Any], str]
@@ -0,0 +1,36 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ from ..core.serialization import FieldMetadata
9
+ from ..core.unchecked_base_model import UncheckedBaseModel
10
+
11
+
12
+ class ExtractJsonInputStorage(UncheckedBaseModel):
13
+ """
14
+ Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created.
15
+ """
16
+
17
+ enabled: typing.Optional[bool] = pydantic.Field(default=None)
18
+ """
19
+ Whether to persist extraction artifacts. Set to false for temporary extractions with no storage or database record.
20
+ """
21
+
22
+ folder_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="folderName")] = pydantic.Field(
23
+ default=None
24
+ )
25
+ """
26
+ Target folder name to save the extraction to. Creates the folder if it doesn't exist.
27
+ """
28
+
29
+ if IS_PYDANTIC_V2:
30
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
31
+ else:
32
+
33
+ class Config:
34
+ frozen = True
35
+ smart_union = True
36
+ extra = pydantic.Extra.allow
@@ -0,0 +1,38 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ from ..core.serialization import FieldMetadata
9
+ from ..core.unchecked_base_model import UncheckedBaseModel
10
+
11
+
12
+ class ExtractJsonInputStructuredOutput(UncheckedBaseModel):
13
+ """
14
+ Recommended method for schema-guided extraction. Contains the schema and optional prompt in a single object.
15
+ """
16
+
17
+ schema_: typing_extensions.Annotated[
18
+ typing.Optional[typing.Dict[str, typing.Any]], FieldMetadata(alias="schema")
19
+ ] = pydantic.Field(default=None)
20
+ """
21
+ JSON schema describing the structured data to extract.
22
+ """
23
+
24
+ schema_prompt: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="schemaPrompt")] = (
25
+ pydantic.Field(default=None)
26
+ )
27
+ """
28
+ Natural language prompt with additional extraction instructions.
29
+ """
30
+
31
+ if IS_PYDANTIC_V2:
32
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
33
+ else:
34
+
35
+ class Config:
36
+ frozen = True
37
+ smart_union = True
38
+ extra = pydantic.Extra.allow
@@ -0,0 +1,111 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ from ..core.serialization import FieldMetadata
9
+ from ..core.unchecked_base_model import UncheckedBaseModel
10
+ from .extract_multipart_input_experimental_schema import ExtractMultipartInputExperimentalSchema
11
+ from .extract_multipart_input_schema import ExtractMultipartInputSchema
12
+ from .extract_multipart_input_storage import ExtractMultipartInputStorage
13
+ from .extract_multipart_input_structured_output import ExtractMultipartInputStructuredOutput
14
+
15
+
16
+ class ExtractMultipartInput(UncheckedBaseModel):
17
+ """
18
+ Input schema for multipart/form-data requests (file upload or fileUrl).
19
+ """
20
+
21
+ structured_output: typing_extensions.Annotated[
22
+ typing.Optional[ExtractMultipartInputStructuredOutput], FieldMetadata(alias="structuredOutput")
23
+ ] = pydantic.Field(default=None)
24
+ """
25
+ Recommended method for schema-guided extraction. Contains the schema and optional prompt in a single object.
26
+ """
27
+
28
+ schema_: typing_extensions.Annotated[
29
+ typing.Optional[ExtractMultipartInputSchema], FieldMetadata(alias="schema")
30
+ ] = pydantic.Field(default=None)
31
+ """
32
+ (Deprecated) JSON schema describing structured data to extract. Use structuredOutput instead. Accepts either a JSON object or a stringified JSON representation.
33
+ """
34
+
35
+ experimental_schema: typing_extensions.Annotated[
36
+ typing.Optional[ExtractMultipartInputExperimentalSchema], FieldMetadata(alias="experimentalSchema")
37
+ ] = pydantic.Field(default=None)
38
+ """
39
+ (Deprecated) Experimental schema definition used for feature flagged behaviour. Accepts either a JSON object or a stringified JSON representation.
40
+ """
41
+
42
+ schema_prompt: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="schemaPrompt")] = (
43
+ pydantic.Field(default=None)
44
+ )
45
+ """
46
+ (Deprecated) Natural language prompt for schema-guided extraction. Use structuredOutput.schemaPrompt instead.
47
+ """
48
+
49
+ custom_prompt: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="customPrompt")] = (
50
+ pydantic.Field(default=None)
51
+ )
52
+ """
53
+ (Deprecated) Custom instructions that augment the default extraction behaviour.
54
+ """
55
+
56
+ chunking: typing.Optional[str] = pydantic.Field(default=None)
57
+ """
58
+ Comma-separated list of chunking strategies to apply (for example `semantic,header,page,recursive`).
59
+ """
60
+
61
+ chunk_size: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="chunkSize")] = pydantic.Field(
62
+ default=None
63
+ )
64
+ """
65
+ Override for maximum characters per chunk when chunking is enabled.
66
+ """
67
+
68
+ pages: typing.Optional[str] = pydantic.Field(default=None)
69
+ """
70
+ Page range filter supporting segments such as `1-2` or mixed ranges like `1-2,5`.
71
+ """
72
+
73
+ extract_figure: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="extractFigure")] = (
74
+ pydantic.Field(default=None)
75
+ )
76
+ """
77
+ Toggle to enable figure extraction in results.
78
+ """
79
+
80
+ figure_description: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="figureDescription")] = (
81
+ pydantic.Field(default=None)
82
+ )
83
+ """
84
+ Toggle to generate descriptive captions for extracted figures.
85
+ """
86
+
87
+ return_html: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="returnHtml")] = pydantic.Field(
88
+ default=None
89
+ )
90
+ """
91
+ Whether to include HTML representation alongside markdown in the response.
92
+ """
93
+
94
+ thinking: typing.Optional[bool] = pydantic.Field(default=None)
95
+ """
96
+ (Deprecated) Enables expanded rationale output for debugging.
97
+ """
98
+
99
+ storage: typing.Optional[ExtractMultipartInputStorage] = pydantic.Field(default=None)
100
+ """
101
+ Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created.
102
+ """
103
+
104
+ if IS_PYDANTIC_V2:
105
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
106
+ else:
107
+
108
+ class Config:
109
+ frozen = True
110
+ smart_union = True
111
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ExtractMultipartInputExperimentalSchema = typing.Union[typing.Dict[str, typing.Any], str]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ExtractMultipartInputSchema = typing.Union[typing.Dict[str, typing.Any], str]
@@ -0,0 +1,36 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ from ..core.serialization import FieldMetadata
9
+ from ..core.unchecked_base_model import UncheckedBaseModel
10
+
11
+
12
+ class ExtractMultipartInputStorage(UncheckedBaseModel):
13
+ """
14
+ Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created.
15
+ """
16
+
17
+ enabled: typing.Optional[bool] = pydantic.Field(default=None)
18
+ """
19
+ Whether to persist extraction artifacts. Set to false for temporary extractions with no storage or database record.
20
+ """
21
+
22
+ folder_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="folderName")] = pydantic.Field(
23
+ default=None
24
+ )
25
+ """
26
+ Target folder name to save the extraction to. Creates the folder if it doesn't exist.
27
+ """
28
+
29
+ if IS_PYDANTIC_V2:
30
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
31
+ else:
32
+
33
+ class Config:
34
+ frozen = True
35
+ smart_union = True
36
+ extra = pydantic.Extra.allow
@@ -0,0 +1,38 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ from ..core.serialization import FieldMetadata
9
+ from ..core.unchecked_base_model import UncheckedBaseModel
10
+
11
+
12
+ class ExtractMultipartInputStructuredOutput(UncheckedBaseModel):
13
+ """
14
+ Recommended method for schema-guided extraction. Contains the schema and optional prompt in a single object.
15
+ """
16
+
17
+ schema_: typing_extensions.Annotated[
18
+ typing.Optional[typing.Dict[str, typing.Any]], FieldMetadata(alias="schema")
19
+ ] = pydantic.Field(default=None)
20
+ """
21
+ JSON schema describing the structured data to extract.
22
+ """
23
+
24
+ schema_prompt: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="schemaPrompt")] = (
25
+ pydantic.Field(default=None)
26
+ )
27
+ """
28
+ Natural language prompt with additional extraction instructions.
29
+ """
30
+
31
+ if IS_PYDANTIC_V2:
32
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
33
+ else:
34
+
35
+ class Config:
36
+ frozen = True
37
+ smart_union = True
38
+ extra = pydantic.Extra.allow
@@ -0,0 +1,111 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ from ..core.serialization import FieldMetadata
9
+ from ..core.unchecked_base_model import UncheckedBaseModel
10
+ from .extract_options_experimental_schema import ExtractOptionsExperimentalSchema
11
+ from .extract_options_schema import ExtractOptionsSchema
12
+ from .extract_options_storage import ExtractOptionsStorage
13
+ from .extract_options_structured_output import ExtractOptionsStructuredOutput
14
+
15
+
16
+ class ExtractOptions(UncheckedBaseModel):
17
+ """
18
+ Common extraction options shared by synchronous and asynchronous endpoints.
19
+ """
20
+
21
+ structured_output: typing_extensions.Annotated[
22
+ typing.Optional[ExtractOptionsStructuredOutput], FieldMetadata(alias="structuredOutput")
23
+ ] = pydantic.Field(default=None)
24
+ """
25
+ Recommended method for schema-guided extraction. Contains the schema and optional prompt in a single object.
26
+ """
27
+
28
+ schema_: typing_extensions.Annotated[typing.Optional[ExtractOptionsSchema], FieldMetadata(alias="schema")] = (
29
+ pydantic.Field(default=None)
30
+ )
31
+ """
32
+ (Deprecated) JSON schema describing structured data to extract. Use structuredOutput instead. Accepts either a JSON object or a stringified JSON representation.
33
+ """
34
+
35
+ experimental_schema: typing_extensions.Annotated[
36
+ typing.Optional[ExtractOptionsExperimentalSchema], FieldMetadata(alias="experimentalSchema")
37
+ ] = pydantic.Field(default=None)
38
+ """
39
+ (Deprecated) Experimental schema definition used for feature flagged behaviour. Accepts either a JSON object or a stringified JSON representation.
40
+ """
41
+
42
+ schema_prompt: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="schemaPrompt")] = (
43
+ pydantic.Field(default=None)
44
+ )
45
+ """
46
+ (Deprecated) Natural language prompt for schema-guided extraction. Use structuredOutput.schemaPrompt instead.
47
+ """
48
+
49
+ custom_prompt: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="customPrompt")] = (
50
+ pydantic.Field(default=None)
51
+ )
52
+ """
53
+ (Deprecated) Custom instructions that augment the default extraction behaviour.
54
+ """
55
+
56
+ chunking: typing.Optional[str] = pydantic.Field(default=None)
57
+ """
58
+ Comma-separated list of chunking strategies to apply (for example `semantic,header,page,recursive`).
59
+ """
60
+
61
+ chunk_size: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="chunkSize")] = pydantic.Field(
62
+ default=None
63
+ )
64
+ """
65
+ Override for maximum characters per chunk when chunking is enabled.
66
+ """
67
+
68
+ pages: typing.Optional[str] = pydantic.Field(default=None)
69
+ """
70
+ Page range filter supporting segments such as `1-2` or mixed ranges like `1-2,5`.
71
+ """
72
+
73
+ extract_figure: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="extractFigure")] = (
74
+ pydantic.Field(default=None)
75
+ )
76
+ """
77
+ Toggle to enable figure extraction in results.
78
+ """
79
+
80
+ figure_description: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="figureDescription")] = (
81
+ pydantic.Field(default=None)
82
+ )
83
+ """
84
+ Toggle to generate descriptive captions for extracted figures.
85
+ """
86
+
87
+ return_html: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="returnHtml")] = pydantic.Field(
88
+ default=None
89
+ )
90
+ """
91
+ Whether to include HTML representation alongside markdown in the response.
92
+ """
93
+
94
+ thinking: typing.Optional[bool] = pydantic.Field(default=None)
95
+ """
96
+ (Deprecated) Enables expanded rationale output for debugging.
97
+ """
98
+
99
+ storage: typing.Optional[ExtractOptionsStorage] = pydantic.Field(default=None)
100
+ """
101
+ Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created.
102
+ """
103
+
104
+ if IS_PYDANTIC_V2:
105
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
106
+ else:
107
+
108
+ class Config:
109
+ frozen = True
110
+ smart_union = True
111
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ExtractOptionsExperimentalSchema = typing.Union[typing.Dict[str, typing.Any], str]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ ExtractOptionsSchema = typing.Union[typing.Dict[str, typing.Any], str]
@@ -0,0 +1,36 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ from ..core.serialization import FieldMetadata
9
+ from ..core.unchecked_base_model import UncheckedBaseModel
10
+
11
+
12
+ class ExtractOptionsStorage(UncheckedBaseModel):
13
+ """
14
+ Options for persisting extraction artifacts. When enabled (default), artifacts are saved to storage and a database record is created.
15
+ """
16
+
17
+ enabled: typing.Optional[bool] = pydantic.Field(default=None)
18
+ """
19
+ Whether to persist extraction artifacts. Set to false for temporary extractions with no storage or database record.
20
+ """
21
+
22
+ folder_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="folderName")] = pydantic.Field(
23
+ default=None
24
+ )
25
+ """
26
+ Target folder name to save the extraction to. Creates the folder if it doesn't exist.
27
+ """
28
+
29
+ if IS_PYDANTIC_V2:
30
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
31
+ else:
32
+
33
+ class Config:
34
+ frozen = True
35
+ smart_union = True
36
+ extra = pydantic.Extra.allow
@@ -0,0 +1,38 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ from ..core.serialization import FieldMetadata
9
+ from ..core.unchecked_base_model import UncheckedBaseModel
10
+
11
+
12
+ class ExtractOptionsStructuredOutput(UncheckedBaseModel):
13
+ """
14
+ Recommended method for schema-guided extraction. Contains the schema and optional prompt in a single object.
15
+ """
16
+
17
+ schema_: typing_extensions.Annotated[
18
+ typing.Optional[typing.Dict[str, typing.Any]], FieldMetadata(alias="schema")
19
+ ] = pydantic.Field(default=None)
20
+ """
21
+ JSON schema describing the structured data to extract.
22
+ """
23
+
24
+ schema_prompt: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="schemaPrompt")] = (
25
+ pydantic.Field(default=None)
26
+ )
27
+ """
28
+ Natural language prompt with additional extraction instructions.
29
+ """
30
+
31
+ if IS_PYDANTIC_V2:
32
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
33
+ else:
34
+
35
+ class Config:
36
+ frozen = True
37
+ smart_union = True
38
+ extra = pydantic.Extra.allow