Skip to content

Commit b11b540

Browse files
feat(sdk): removed chunking options as a shared resource
1 parent e196566 commit b11b540

13 files changed

Lines changed: 49 additions & 70 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 5
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-fa910a5a3d1321234423bd8c042d202a64d4d956ef45847b4de358cb18e447eb.yml
33
openapi_spec_hash: 926b9b619c15e8570e496e11d4fb753e
4-
config_hash: 4905dce1697ac01039f6ceb525fadec2
4+
config_hash: 129ba75e63f0a898125e7d39a475830c

api.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Shared Types
2-
3-
```python
4-
from isaacus.types import ChunkingOptions
5-
```
6-
71
# Embeddings
82

93
Types:

src/isaacus/resources/classifications/universal.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
)
2020
from ..._base_client import make_request_options
2121
from ...types.classifications import universal_create_params
22-
from ...types.shared_params.chunking_options import ChunkingOptions
2322
from ...types.classifications.universal_classification_response import UniversalClassificationResponse
2423

2524
__all__ = ["UniversalResource", "AsyncUniversalResource"]
@@ -53,7 +52,7 @@ def create(
5352
texts: SequenceNotStr[str],
5453
is_iql: bool | Omit = omit,
5554
scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"] | Omit = omit,
56-
chunking_options: Optional[ChunkingOptions] | Omit = omit,
55+
chunking_options: Optional[universal_create_params.ChunkingOptions] | Omit = omit,
5756
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5857
# The extra values given here take precedence over values defined on the client or passed to this method.
5958
extra_headers: Headers | None = None,
@@ -154,7 +153,7 @@ async def create(
154153
texts: SequenceNotStr[str],
155154
is_iql: bool | Omit = omit,
156155
scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"] | Omit = omit,
157-
chunking_options: Optional[ChunkingOptions] | Omit = omit,
156+
chunking_options: Optional[universal_create_params.ChunkingOptions] | Omit = omit,
158157
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
159158
# The extra values given here take precedence over values defined on the client or passed to this method.
160159
extra_headers: Headers | None = None,

src/isaacus/resources/extractions/qa.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
)
2020
from ..._base_client import make_request_options
2121
from ...types.extractions import qa_create_params
22-
from ...types.shared_params.chunking_options import ChunkingOptions
2322
from ...types.extractions.answer_extraction_response import AnswerExtractionResponse
2423

2524
__all__ = ["QAResource", "AsyncQAResource"]
@@ -53,7 +52,7 @@ def create(
5352
texts: SequenceNotStr[str],
5453
ignore_inextractability: bool | Omit = omit,
5554
top_k: int | Omit = omit,
56-
chunking_options: Optional[ChunkingOptions] | Omit = omit,
55+
chunking_options: Optional[qa_create_params.ChunkingOptions] | Omit = omit,
5756
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5857
# The extra values given here take precedence over values defined on the client or passed to this method.
5958
extra_headers: Headers | None = None,
@@ -153,7 +152,7 @@ async def create(
153152
texts: SequenceNotStr[str],
154153
ignore_inextractability: bool | Omit = omit,
155154
top_k: int | Omit = omit,
156-
chunking_options: Optional[ChunkingOptions] | Omit = omit,
155+
chunking_options: Optional[qa_create_params.ChunkingOptions] | Omit = omit,
157156
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
158157
# The extra values given here take precedence over values defined on the client or passed to this method.
159158
extra_headers: Headers | None = None,

src/isaacus/resources/rerankings.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
)
2121
from .._base_client import make_request_options
2222
from ..types.reranking_response import RerankingResponse
23-
from ..types.shared_params.chunking_options import ChunkingOptions
2423

2524
__all__ = ["RerankingsResource", "AsyncRerankingsResource"]
2625

@@ -54,7 +53,7 @@ def create(
5453
top_n: Optional[int] | Omit = omit,
5554
is_iql: bool | Omit = omit,
5655
scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"] | Omit = omit,
57-
chunking_options: Optional[ChunkingOptions] | Omit = omit,
56+
chunking_options: Optional[reranking_create_params.ChunkingOptions] | Omit = omit,
5857
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5958
# The extra values given here take precedence over values defined on the client or passed to this method.
6059
extra_headers: Headers | None = None,
@@ -165,7 +164,7 @@ async def create(
165164
top_n: Optional[int] | Omit = omit,
166165
is_iql: bool | Omit = omit,
167166
scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"] | Omit = omit,
168-
chunking_options: Optional[ChunkingOptions] | Omit = omit,
167+
chunking_options: Optional[reranking_create_params.ChunkingOptions] | Omit = omit,
169168
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
170169
# The extra values given here take precedence over values defined on the client or passed to this method.
171170
extra_headers: Headers | None = None,

src/isaacus/types/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from __future__ import annotations
44

5-
from .shared import ChunkingOptions as ChunkingOptions
65
from .embedding_response import EmbeddingResponse as EmbeddingResponse
76
from .reranking_response import RerankingResponse as RerankingResponse
87
from .enrichment_response import EnrichmentResponse as EnrichmentResponse

src/isaacus/types/classifications/universal_create_params.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
from typing_extensions import Literal, Required, TypedDict
77

88
from ..._types import SequenceNotStr
9-
from ..shared_params.chunking_options import ChunkingOptions
109

11-
__all__ = ["UniversalCreateParams"]
10+
__all__ = ["UniversalCreateParams", "ChunkingOptions"]
1211

1312

1413
class UniversalCreateParams(TypedDict, total=False):
@@ -57,3 +56,16 @@ class UniversalCreateParams(TypedDict, total=False):
5756

5857
chunking_options: Optional[ChunkingOptions]
5958
"""Options for how to split text into smaller chunks."""
59+
60+
61+
class ChunkingOptions(TypedDict, total=False):
62+
"""Options for how to split text into smaller chunks."""
63+
64+
size: Optional[int]
65+
"""A whole number greater than or equal to 1."""
66+
67+
overlap_ratio: Optional[float]
68+
"""A number greater than or equal to 0 and less than 1."""
69+
70+
overlap_tokens: Optional[int]
71+
"""A whole number greater than or equal to 0."""

src/isaacus/types/extractions/qa_create_params.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
from typing_extensions import Literal, Required, TypedDict
77

88
from ..._types import SequenceNotStr
9-
from ..shared_params.chunking_options import ChunkingOptions
109

11-
__all__ = ["QACreateParams"]
10+
__all__ = ["QACreateParams", "ChunkingOptions"]
1211

1312

1413
class QACreateParams(TypedDict, total=False):
@@ -55,3 +54,16 @@ class QACreateParams(TypedDict, total=False):
5554

5655
chunking_options: Optional[ChunkingOptions]
5756
"""Options for how to split text into smaller chunks."""
57+
58+
59+
class ChunkingOptions(TypedDict, total=False):
60+
"""Options for how to split text into smaller chunks."""
61+
62+
size: Optional[int]
63+
"""A whole number greater than or equal to 1."""
64+
65+
overlap_ratio: Optional[float]
66+
"""A number greater than or equal to 0 and less than 1."""
67+
68+
overlap_tokens: Optional[int]
69+
"""A whole number greater than or equal to 0."""

src/isaacus/types/reranking_create_params.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
from typing_extensions import Literal, Required, TypedDict
77

88
from .._types import SequenceNotStr
9-
from .shared_params.chunking_options import ChunkingOptions
109

11-
__all__ = ["RerankingCreateParams"]
10+
__all__ = ["RerankingCreateParams", "ChunkingOptions"]
1211

1312

1413
class RerankingCreateParams(TypedDict, total=False):
@@ -65,3 +64,16 @@ class RerankingCreateParams(TypedDict, total=False):
6564

6665
chunking_options: Optional[ChunkingOptions]
6766
"""Options for how to split text into smaller chunks."""
67+
68+
69+
class ChunkingOptions(TypedDict, total=False):
70+
"""Options for how to split text into smaller chunks."""
71+
72+
size: Optional[int]
73+
"""A whole number greater than or equal to 1."""
74+
75+
overlap_ratio: Optional[float]
76+
"""A number greater than or equal to 0 and less than 1."""
77+
78+
overlap_tokens: Optional[int]
79+
"""A whole number greater than or equal to 0."""

src/isaacus/types/shared/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)