chunkr-ai 0.1.0__py3-none-any.whl → 0.1.0a1__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.
- chunkr_ai/__init__.py +89 -2
- chunkr_ai/_base_client.py +1995 -0
- chunkr_ai/_client.py +402 -0
- chunkr_ai/_compat.py +219 -0
- chunkr_ai/_constants.py +14 -0
- chunkr_ai/_exceptions.py +108 -0
- chunkr_ai/_files.py +123 -0
- chunkr_ai/_models.py +829 -0
- chunkr_ai/_qs.py +150 -0
- chunkr_ai/_resource.py +43 -0
- chunkr_ai/_response.py +830 -0
- chunkr_ai/_streaming.py +333 -0
- chunkr_ai/_types.py +219 -0
- chunkr_ai/_utils/__init__.py +57 -0
- chunkr_ai/_utils/_logs.py +25 -0
- chunkr_ai/_utils/_proxy.py +65 -0
- chunkr_ai/_utils/_reflection.py +42 -0
- chunkr_ai/_utils/_resources_proxy.py +24 -0
- chunkr_ai/_utils/_streams.py +12 -0
- chunkr_ai/_utils/_sync.py +86 -0
- chunkr_ai/_utils/_transform.py +447 -0
- chunkr_ai/_utils/_typing.py +151 -0
- chunkr_ai/_utils/_utils.py +422 -0
- chunkr_ai/_version.py +4 -0
- chunkr_ai/lib/.keep +4 -0
- chunkr_ai/pagination.py +71 -0
- chunkr_ai/resources/__init__.py +33 -0
- chunkr_ai/resources/health.py +136 -0
- chunkr_ai/resources/task.py +1166 -0
- chunkr_ai/types/__init__.py +27 -0
- chunkr_ai/types/auto_generation_config.py +39 -0
- chunkr_ai/types/auto_generation_config_param.py +39 -0
- chunkr_ai/types/bounding_box.py +19 -0
- chunkr_ai/types/chunk_processing.py +40 -0
- chunkr_ai/types/chunk_processing_param.py +42 -0
- chunkr_ai/types/health_check_response.py +7 -0
- chunkr_ai/types/ignore_generation_config.py +39 -0
- chunkr_ai/types/ignore_generation_config_param.py +39 -0
- chunkr_ai/types/llm_generation_config.py +39 -0
- chunkr_ai/types/llm_generation_config_param.py +39 -0
- chunkr_ai/types/llm_processing.py +36 -0
- chunkr_ai/types/llm_processing_param.py +36 -0
- chunkr_ai/types/picture_generation_config.py +39 -0
- chunkr_ai/types/picture_generation_config_param.py +39 -0
- chunkr_ai/types/segment_processing.py +280 -0
- chunkr_ai/types/segment_processing_param.py +281 -0
- chunkr_ai/types/table_generation_config.py +39 -0
- chunkr_ai/types/table_generation_config_param.py +39 -0
- chunkr_ai/types/task.py +379 -0
- chunkr_ai/types/task_get_params.py +18 -0
- chunkr_ai/types/task_list_params.py +37 -0
- chunkr_ai/types/task_parse_params.py +90 -0
- chunkr_ai/types/task_update_params.py +90 -0
- chunkr_ai-0.1.0a1.dist-info/METADATA +504 -0
- chunkr_ai-0.1.0a1.dist-info/RECORD +58 -0
- {chunkr_ai-0.1.0.dist-info → chunkr_ai-0.1.0a1.dist-info}/WHEEL +1 -2
- chunkr_ai-0.1.0a1.dist-info/licenses/LICENSE +201 -0
- chunkr_ai/api/auth.py +0 -13
- chunkr_ai/api/chunkr.py +0 -103
- chunkr_ai/api/chunkr_base.py +0 -185
- chunkr_ai/api/configuration.py +0 -313
- chunkr_ai/api/decorators.py +0 -101
- chunkr_ai/api/misc.py +0 -139
- chunkr_ai/api/protocol.py +0 -14
- chunkr_ai/api/task_response.py +0 -208
- chunkr_ai/models.py +0 -55
- chunkr_ai-0.1.0.dist-info/METADATA +0 -268
- chunkr_ai-0.1.0.dist-info/RECORD +0 -16
- chunkr_ai-0.1.0.dist-info/licenses/LICENSE +0 -21
- chunkr_ai-0.1.0.dist-info/top_level.txt +0 -1
- /chunkr_ai/{api/__init__.py → py.typed} +0 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from .task import Task as Task
|
6
|
+
from .bounding_box import BoundingBox as BoundingBox
|
7
|
+
from .llm_processing import LlmProcessing as LlmProcessing
|
8
|
+
from .task_get_params import TaskGetParams as TaskGetParams
|
9
|
+
from .chunk_processing import ChunkProcessing as ChunkProcessing
|
10
|
+
from .task_list_params import TaskListParams as TaskListParams
|
11
|
+
from .task_parse_params import TaskParseParams as TaskParseParams
|
12
|
+
from .segment_processing import SegmentProcessing as SegmentProcessing
|
13
|
+
from .task_update_params import TaskUpdateParams as TaskUpdateParams
|
14
|
+
from .llm_processing_param import LlmProcessingParam as LlmProcessingParam
|
15
|
+
from .health_check_response import HealthCheckResponse as HealthCheckResponse
|
16
|
+
from .llm_generation_config import LlmGenerationConfig as LlmGenerationConfig
|
17
|
+
from .auto_generation_config import AutoGenerationConfig as AutoGenerationConfig
|
18
|
+
from .chunk_processing_param import ChunkProcessingParam as ChunkProcessingParam
|
19
|
+
from .table_generation_config import TableGenerationConfig as TableGenerationConfig
|
20
|
+
from .ignore_generation_config import IgnoreGenerationConfig as IgnoreGenerationConfig
|
21
|
+
from .segment_processing_param import SegmentProcessingParam as SegmentProcessingParam
|
22
|
+
from .picture_generation_config import PictureGenerationConfig as PictureGenerationConfig
|
23
|
+
from .llm_generation_config_param import LlmGenerationConfigParam as LlmGenerationConfigParam
|
24
|
+
from .auto_generation_config_param import AutoGenerationConfigParam as AutoGenerationConfigParam
|
25
|
+
from .table_generation_config_param import TableGenerationConfigParam as TableGenerationConfigParam
|
26
|
+
from .ignore_generation_config_param import IgnoreGenerationConfigParam as IgnoreGenerationConfigParam
|
27
|
+
from .picture_generation_config_param import PictureGenerationConfigParam as PictureGenerationConfigParam
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import List, Optional
|
4
|
+
from typing_extensions import Literal
|
5
|
+
|
6
|
+
from .._models import BaseModel
|
7
|
+
|
8
|
+
__all__ = ["AutoGenerationConfig"]
|
9
|
+
|
10
|
+
|
11
|
+
class AutoGenerationConfig(BaseModel):
|
12
|
+
crop_image: Optional[Literal["All", "Auto"]] = None
|
13
|
+
"""Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
|
14
|
+
|
15
|
+
- `All` crops all images in the item
|
16
|
+
- `Auto` crops images only if required for post-processing
|
17
|
+
"""
|
18
|
+
|
19
|
+
description: Optional[bool] = None
|
20
|
+
"""Generate LLM descriptions for this segment"""
|
21
|
+
|
22
|
+
embed_sources: Optional[List[Literal["Content", "HTML", "Markdown", "LLM"]]] = None
|
23
|
+
"""**DEPRECATED**: `embed` field is auto populated"""
|
24
|
+
|
25
|
+
extended_context: Optional[bool] = None
|
26
|
+
"""Use the full page image as context for LLM generation"""
|
27
|
+
|
28
|
+
format: Optional[Literal["Html", "Markdown"]] = None
|
29
|
+
|
30
|
+
html: Optional[Literal["LLM", "Auto", "Ignore"]] = None
|
31
|
+
"""**DEPRECATED**: Use `format: html` and `strategy` instead."""
|
32
|
+
|
33
|
+
llm: Optional[str] = None
|
34
|
+
"""**DEPRECATED**: use description instead"""
|
35
|
+
|
36
|
+
markdown: Optional[Literal["LLM", "Auto", "Ignore"]] = None
|
37
|
+
"""**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
|
38
|
+
|
39
|
+
strategy: Optional[Literal["LLM", "Auto", "Ignore"]] = None
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import List, Optional
|
6
|
+
from typing_extensions import Literal, TypedDict
|
7
|
+
|
8
|
+
__all__ = ["AutoGenerationConfigParam"]
|
9
|
+
|
10
|
+
|
11
|
+
class AutoGenerationConfigParam(TypedDict, total=False):
|
12
|
+
crop_image: Literal["All", "Auto"]
|
13
|
+
"""Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
|
14
|
+
|
15
|
+
- `All` crops all images in the item
|
16
|
+
- `Auto` crops images only if required for post-processing
|
17
|
+
"""
|
18
|
+
|
19
|
+
description: bool
|
20
|
+
"""Generate LLM descriptions for this segment"""
|
21
|
+
|
22
|
+
embed_sources: List[Literal["Content", "HTML", "Markdown", "LLM"]]
|
23
|
+
"""**DEPRECATED**: `embed` field is auto populated"""
|
24
|
+
|
25
|
+
extended_context: bool
|
26
|
+
"""Use the full page image as context for LLM generation"""
|
27
|
+
|
28
|
+
format: Literal["Html", "Markdown"]
|
29
|
+
|
30
|
+
html: Optional[Literal["LLM", "Auto", "Ignore"]]
|
31
|
+
"""**DEPRECATED**: Use `format: html` and `strategy` instead."""
|
32
|
+
|
33
|
+
llm: Optional[str]
|
34
|
+
"""**DEPRECATED**: use description instead"""
|
35
|
+
|
36
|
+
markdown: Optional[Literal["LLM", "Auto", "Ignore"]]
|
37
|
+
"""**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
|
38
|
+
|
39
|
+
strategy: Literal["LLM", "Auto", "Ignore"]
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from .._models import BaseModel
|
4
|
+
|
5
|
+
__all__ = ["BoundingBox"]
|
6
|
+
|
7
|
+
|
8
|
+
class BoundingBox(BaseModel):
|
9
|
+
height: float
|
10
|
+
"""The height of the bounding box."""
|
11
|
+
|
12
|
+
left: float
|
13
|
+
"""The left coordinate of the bounding box."""
|
14
|
+
|
15
|
+
top: float
|
16
|
+
"""The top coordinate of the bounding box."""
|
17
|
+
|
18
|
+
width: float
|
19
|
+
"""The width of the bounding box."""
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import Union, Optional
|
4
|
+
from typing_extensions import Literal, TypeAlias
|
5
|
+
|
6
|
+
from pydantic import Field as FieldInfo
|
7
|
+
|
8
|
+
from .._models import BaseModel
|
9
|
+
|
10
|
+
__all__ = ["ChunkProcessing", "Tokenizer", "TokenizerEnum", "TokenizerString"]
|
11
|
+
|
12
|
+
|
13
|
+
class TokenizerEnum(BaseModel):
|
14
|
+
enum: Literal["Word", "Cl100kBase", "XlmRobertaBase", "BertBaseUncased"] = FieldInfo(alias="Enum")
|
15
|
+
"""Use one of the predefined tokenizer types"""
|
16
|
+
|
17
|
+
|
18
|
+
class TokenizerString(BaseModel):
|
19
|
+
string: str = FieldInfo(alias="String")
|
20
|
+
"""
|
21
|
+
Use any Hugging Face tokenizer by specifying its model ID Examples:
|
22
|
+
"Qwen/Qwen-tokenizer", "facebook/bart-large"
|
23
|
+
"""
|
24
|
+
|
25
|
+
|
26
|
+
Tokenizer: TypeAlias = Union[TokenizerEnum, TokenizerString]
|
27
|
+
|
28
|
+
|
29
|
+
class ChunkProcessing(BaseModel):
|
30
|
+
ignore_headers_and_footers: Optional[bool] = None
|
31
|
+
"""DEPRECATED: use `segment_processing.ignore` This value will not be used"""
|
32
|
+
|
33
|
+
target_length: Optional[int] = None
|
34
|
+
"""The target number of words in each chunk.
|
35
|
+
|
36
|
+
If 0, each chunk will contain a single segment.
|
37
|
+
"""
|
38
|
+
|
39
|
+
tokenizer: Optional[Tokenizer] = None
|
40
|
+
"""The tokenizer to use for the chunking process."""
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Union
|
6
|
+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
|
7
|
+
|
8
|
+
from .._utils import PropertyInfo
|
9
|
+
|
10
|
+
__all__ = ["ChunkProcessingParam", "Tokenizer", "TokenizerEnum", "TokenizerString"]
|
11
|
+
|
12
|
+
|
13
|
+
class TokenizerEnum(TypedDict, total=False):
|
14
|
+
enum: Required[
|
15
|
+
Annotated[Literal["Word", "Cl100kBase", "XlmRobertaBase", "BertBaseUncased"], PropertyInfo(alias="Enum")]
|
16
|
+
]
|
17
|
+
"""Use one of the predefined tokenizer types"""
|
18
|
+
|
19
|
+
|
20
|
+
class TokenizerString(TypedDict, total=False):
|
21
|
+
string: Required[Annotated[str, PropertyInfo(alias="String")]]
|
22
|
+
"""
|
23
|
+
Use any Hugging Face tokenizer by specifying its model ID Examples:
|
24
|
+
"Qwen/Qwen-tokenizer", "facebook/bart-large"
|
25
|
+
"""
|
26
|
+
|
27
|
+
|
28
|
+
Tokenizer: TypeAlias = Union[TokenizerEnum, TokenizerString]
|
29
|
+
|
30
|
+
|
31
|
+
class ChunkProcessingParam(TypedDict, total=False):
|
32
|
+
ignore_headers_and_footers: bool
|
33
|
+
"""DEPRECATED: use `segment_processing.ignore` This value will not be used"""
|
34
|
+
|
35
|
+
target_length: int
|
36
|
+
"""The target number of words in each chunk.
|
37
|
+
|
38
|
+
If 0, each chunk will contain a single segment.
|
39
|
+
"""
|
40
|
+
|
41
|
+
tokenizer: Tokenizer
|
42
|
+
"""The tokenizer to use for the chunking process."""
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import List, Optional
|
4
|
+
from typing_extensions import Literal
|
5
|
+
|
6
|
+
from .._models import BaseModel
|
7
|
+
|
8
|
+
__all__ = ["IgnoreGenerationConfig"]
|
9
|
+
|
10
|
+
|
11
|
+
class IgnoreGenerationConfig(BaseModel):
|
12
|
+
crop_image: Optional[Literal["All", "Auto"]] = None
|
13
|
+
"""Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
|
14
|
+
|
15
|
+
- `All` crops all images in the item
|
16
|
+
- `Auto` crops images only if required for post-processing
|
17
|
+
"""
|
18
|
+
|
19
|
+
description: Optional[bool] = None
|
20
|
+
"""Generate LLM descriptions for this segment"""
|
21
|
+
|
22
|
+
embed_sources: Optional[List[Literal["Content", "HTML", "Markdown", "LLM"]]] = None
|
23
|
+
"""**DEPRECATED**: `embed` field is auto populated"""
|
24
|
+
|
25
|
+
extended_context: Optional[bool] = None
|
26
|
+
"""Use the full page image as context for LLM generation"""
|
27
|
+
|
28
|
+
format: Optional[Literal["Html", "Markdown"]] = None
|
29
|
+
|
30
|
+
html: Optional[Literal["LLM", "Auto", "Ignore"]] = None
|
31
|
+
"""**DEPRECATED**: Use `format: html` and `strategy` instead."""
|
32
|
+
|
33
|
+
llm: Optional[str] = None
|
34
|
+
"""**DEPRECATED**: use description instead"""
|
35
|
+
|
36
|
+
markdown: Optional[Literal["LLM", "Auto", "Ignore"]] = None
|
37
|
+
"""**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
|
38
|
+
|
39
|
+
strategy: Optional[Literal["LLM", "Auto", "Ignore"]] = None
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import List, Optional
|
6
|
+
from typing_extensions import Literal, TypedDict
|
7
|
+
|
8
|
+
__all__ = ["IgnoreGenerationConfigParam"]
|
9
|
+
|
10
|
+
|
11
|
+
class IgnoreGenerationConfigParam(TypedDict, total=False):
|
12
|
+
crop_image: Literal["All", "Auto"]
|
13
|
+
"""Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
|
14
|
+
|
15
|
+
- `All` crops all images in the item
|
16
|
+
- `Auto` crops images only if required for post-processing
|
17
|
+
"""
|
18
|
+
|
19
|
+
description: bool
|
20
|
+
"""Generate LLM descriptions for this segment"""
|
21
|
+
|
22
|
+
embed_sources: List[Literal["Content", "HTML", "Markdown", "LLM"]]
|
23
|
+
"""**DEPRECATED**: `embed` field is auto populated"""
|
24
|
+
|
25
|
+
extended_context: bool
|
26
|
+
"""Use the full page image as context for LLM generation"""
|
27
|
+
|
28
|
+
format: Literal["Html", "Markdown"]
|
29
|
+
|
30
|
+
html: Optional[Literal["LLM", "Auto", "Ignore"]]
|
31
|
+
"""**DEPRECATED**: Use `format: html` and `strategy` instead."""
|
32
|
+
|
33
|
+
llm: Optional[str]
|
34
|
+
"""**DEPRECATED**: use description instead"""
|
35
|
+
|
36
|
+
markdown: Optional[Literal["LLM", "Auto", "Ignore"]]
|
37
|
+
"""**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
|
38
|
+
|
39
|
+
strategy: Literal["LLM", "Auto", "Ignore"]
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import List, Optional
|
4
|
+
from typing_extensions import Literal
|
5
|
+
|
6
|
+
from .._models import BaseModel
|
7
|
+
|
8
|
+
__all__ = ["LlmGenerationConfig"]
|
9
|
+
|
10
|
+
|
11
|
+
class LlmGenerationConfig(BaseModel):
|
12
|
+
crop_image: Optional[Literal["All", "Auto"]] = None
|
13
|
+
"""Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
|
14
|
+
|
15
|
+
- `All` crops all images in the item
|
16
|
+
- `Auto` crops images only if required for post-processing
|
17
|
+
"""
|
18
|
+
|
19
|
+
description: Optional[bool] = None
|
20
|
+
"""Generate LLM descriptions for this segment"""
|
21
|
+
|
22
|
+
embed_sources: Optional[List[Literal["Content", "HTML", "Markdown", "LLM"]]] = None
|
23
|
+
"""**DEPRECATED**: `embed` field is auto populated"""
|
24
|
+
|
25
|
+
extended_context: Optional[bool] = None
|
26
|
+
"""Use the full page image as context for LLM generation"""
|
27
|
+
|
28
|
+
format: Optional[Literal["Html", "Markdown"]] = None
|
29
|
+
|
30
|
+
html: Optional[Literal["LLM", "Auto", "Ignore"]] = None
|
31
|
+
"""**DEPRECATED**: Use `format: html` and `strategy` instead."""
|
32
|
+
|
33
|
+
llm: Optional[str] = None
|
34
|
+
"""**DEPRECATED**: use description instead"""
|
35
|
+
|
36
|
+
markdown: Optional[Literal["LLM", "Auto", "Ignore"]] = None
|
37
|
+
"""**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
|
38
|
+
|
39
|
+
strategy: Optional[Literal["LLM", "Auto", "Ignore"]] = None
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import List, Optional
|
6
|
+
from typing_extensions import Literal, TypedDict
|
7
|
+
|
8
|
+
__all__ = ["LlmGenerationConfigParam"]
|
9
|
+
|
10
|
+
|
11
|
+
class LlmGenerationConfigParam(TypedDict, total=False):
|
12
|
+
crop_image: Literal["All", "Auto"]
|
13
|
+
"""Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
|
14
|
+
|
15
|
+
- `All` crops all images in the item
|
16
|
+
- `Auto` crops images only if required for post-processing
|
17
|
+
"""
|
18
|
+
|
19
|
+
description: bool
|
20
|
+
"""Generate LLM descriptions for this segment"""
|
21
|
+
|
22
|
+
embed_sources: List[Literal["Content", "HTML", "Markdown", "LLM"]]
|
23
|
+
"""**DEPRECATED**: `embed` field is auto populated"""
|
24
|
+
|
25
|
+
extended_context: bool
|
26
|
+
"""Use the full page image as context for LLM generation"""
|
27
|
+
|
28
|
+
format: Literal["Html", "Markdown"]
|
29
|
+
|
30
|
+
html: Optional[Literal["LLM", "Auto", "Ignore"]]
|
31
|
+
"""**DEPRECATED**: Use `format: html` and `strategy` instead."""
|
32
|
+
|
33
|
+
llm: Optional[str]
|
34
|
+
"""**DEPRECATED**: use description instead"""
|
35
|
+
|
36
|
+
markdown: Optional[Literal["LLM", "Auto", "Ignore"]]
|
37
|
+
"""**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
|
38
|
+
|
39
|
+
strategy: Literal["LLM", "Auto", "Ignore"]
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import Union, Optional
|
4
|
+
from typing_extensions import Literal, TypeAlias
|
5
|
+
|
6
|
+
from pydantic import Field as FieldInfo
|
7
|
+
|
8
|
+
from .._models import BaseModel
|
9
|
+
|
10
|
+
__all__ = ["LlmProcessing", "FallbackStrategy", "FallbackStrategyModel"]
|
11
|
+
|
12
|
+
|
13
|
+
class FallbackStrategyModel(BaseModel):
|
14
|
+
model: str = FieldInfo(alias="Model")
|
15
|
+
"""Use a specific model as fallback"""
|
16
|
+
|
17
|
+
|
18
|
+
FallbackStrategy: TypeAlias = Union[Literal["None", "Default"], FallbackStrategyModel]
|
19
|
+
|
20
|
+
|
21
|
+
class LlmProcessing(BaseModel):
|
22
|
+
fallback_strategy: Optional[FallbackStrategy] = None
|
23
|
+
"""The fallback strategy to use for the LLMs in the task."""
|
24
|
+
|
25
|
+
max_completion_tokens: Optional[int] = None
|
26
|
+
"""The maximum number of tokens to generate."""
|
27
|
+
|
28
|
+
api_model_id: Optional[str] = FieldInfo(alias="model_id", default=None)
|
29
|
+
"""The ID of the model to use for the task.
|
30
|
+
|
31
|
+
If not provided, the default model will be used. Please check the documentation
|
32
|
+
for the model you want to use.
|
33
|
+
"""
|
34
|
+
|
35
|
+
temperature: Optional[float] = None
|
36
|
+
"""The temperature to use for the LLM."""
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Union, Optional
|
6
|
+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
|
7
|
+
|
8
|
+
from .._utils import PropertyInfo
|
9
|
+
|
10
|
+
__all__ = ["LlmProcessingParam", "FallbackStrategy", "FallbackStrategyModel"]
|
11
|
+
|
12
|
+
|
13
|
+
class FallbackStrategyModel(TypedDict, total=False):
|
14
|
+
model: Required[Annotated[str, PropertyInfo(alias="Model")]]
|
15
|
+
"""Use a specific model as fallback"""
|
16
|
+
|
17
|
+
|
18
|
+
FallbackStrategy: TypeAlias = Union[Literal["None", "Default"], FallbackStrategyModel]
|
19
|
+
|
20
|
+
|
21
|
+
class LlmProcessingParam(TypedDict, total=False):
|
22
|
+
fallback_strategy: FallbackStrategy
|
23
|
+
"""The fallback strategy to use for the LLMs in the task."""
|
24
|
+
|
25
|
+
max_completion_tokens: Optional[int]
|
26
|
+
"""The maximum number of tokens to generate."""
|
27
|
+
|
28
|
+
model_id: Optional[str]
|
29
|
+
"""The ID of the model to use for the task.
|
30
|
+
|
31
|
+
If not provided, the default model will be used. Please check the documentation
|
32
|
+
for the model you want to use.
|
33
|
+
"""
|
34
|
+
|
35
|
+
temperature: float
|
36
|
+
"""The temperature to use for the LLM."""
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import List, Optional
|
4
|
+
from typing_extensions import Literal
|
5
|
+
|
6
|
+
from .._models import BaseModel
|
7
|
+
|
8
|
+
__all__ = ["PictureGenerationConfig"]
|
9
|
+
|
10
|
+
|
11
|
+
class PictureGenerationConfig(BaseModel):
|
12
|
+
crop_image: Optional[Literal["All", "Auto"]] = None
|
13
|
+
"""Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
|
14
|
+
|
15
|
+
- `All` crops all images in the item
|
16
|
+
- `Auto` crops images only if required for post-processing
|
17
|
+
"""
|
18
|
+
|
19
|
+
description: Optional[bool] = None
|
20
|
+
"""Generate LLM descriptions for this segment"""
|
21
|
+
|
22
|
+
embed_sources: Optional[List[Literal["Content", "HTML", "Markdown", "LLM"]]] = None
|
23
|
+
"""**DEPRECATED**: `embed` field is auto populated"""
|
24
|
+
|
25
|
+
extended_context: Optional[bool] = None
|
26
|
+
"""Use the full page image as context for LLM generation"""
|
27
|
+
|
28
|
+
format: Optional[Literal["Html", "Markdown"]] = None
|
29
|
+
|
30
|
+
html: Optional[Literal["LLM", "Auto", "Ignore"]] = None
|
31
|
+
"""**DEPRECATED**: Use `format: html` and `strategy` instead."""
|
32
|
+
|
33
|
+
llm: Optional[str] = None
|
34
|
+
"""**DEPRECATED**: use description instead"""
|
35
|
+
|
36
|
+
markdown: Optional[Literal["LLM", "Auto", "Ignore"]] = None
|
37
|
+
"""**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
|
38
|
+
|
39
|
+
strategy: Optional[Literal["LLM", "Auto", "Ignore"]] = None
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import List, Optional
|
6
|
+
from typing_extensions import Literal, TypedDict
|
7
|
+
|
8
|
+
__all__ = ["PictureGenerationConfigParam"]
|
9
|
+
|
10
|
+
|
11
|
+
class PictureGenerationConfigParam(TypedDict, total=False):
|
12
|
+
crop_image: Literal["All", "Auto"]
|
13
|
+
"""Controls the cropping strategy for an item (e.g. segment, chunk, etc.)
|
14
|
+
|
15
|
+
- `All` crops all images in the item
|
16
|
+
- `Auto` crops images only if required for post-processing
|
17
|
+
"""
|
18
|
+
|
19
|
+
description: bool
|
20
|
+
"""Generate LLM descriptions for this segment"""
|
21
|
+
|
22
|
+
embed_sources: List[Literal["Content", "HTML", "Markdown", "LLM"]]
|
23
|
+
"""**DEPRECATED**: `embed` field is auto populated"""
|
24
|
+
|
25
|
+
extended_context: bool
|
26
|
+
"""Use the full page image as context for LLM generation"""
|
27
|
+
|
28
|
+
format: Literal["Html", "Markdown"]
|
29
|
+
|
30
|
+
html: Optional[Literal["LLM", "Auto", "Ignore"]]
|
31
|
+
"""**DEPRECATED**: Use `format: html` and `strategy` instead."""
|
32
|
+
|
33
|
+
llm: Optional[str]
|
34
|
+
"""**DEPRECATED**: use description instead"""
|
35
|
+
|
36
|
+
markdown: Optional[Literal["LLM", "Auto", "Ignore"]]
|
37
|
+
"""**DEPRECATED**: Use `format: markdown` and `strategy` instead."""
|
38
|
+
|
39
|
+
strategy: Literal["LLM", "Auto", "Ignore"]
|