Skip to content

Commit e196566

Browse files
feat(sdk): move ilgs to its own resource
1 parent 8620bb5 commit e196566

32 files changed

Lines changed: 84 additions & 81 deletions

.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: 6989204ddc6219d42aeefea50912c031
4+
config_hash: 4905dce1697ac01039f6ceb525fadec2

api.md

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

39
Types:
@@ -60,14 +66,16 @@ from isaacus.types import EnrichmentResponse
6066

6167
Methods:
6268

63-
- <code title="post /enrichments">client.enrichments.<a href="./src/isaacus/resources/enrichments/enrichments.py">create</a>(\*\*<a href="src/isaacus/types/enrichment_create_params.py">params</a>) -> <a href="./src/isaacus/types/enrichment_response.py">EnrichmentResponse</a></code>
69+
- <code title="post /enrichments">client.enrichments.<a href="./src/isaacus/resources/enrichments.py">create</a>(\*\*<a href="src/isaacus/types/enrichment_create_params.py">params</a>) -> <a href="./src/isaacus/types/enrichment_response.py">EnrichmentResponse</a></code>
70+
71+
# ILGS
6472

65-
## Ilgsv1
73+
## v1
6674

6775
Types:
6876

6977
```python
70-
from isaacus.types.enrichments import (
78+
from isaacus.types.ilgs import (
7179
Crossreference,
7280
Date,
7381
Document,

src/isaacus/_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
from .resources import embeddings, rerankings, enrichments, extractions, classifications
3535
from .resources.embeddings import EmbeddingsResource, AsyncEmbeddingsResource
3636
from .resources.rerankings import RerankingsResource, AsyncRerankingsResource
37-
from .resources.enrichments.enrichments import EnrichmentsResource, AsyncEnrichmentsResource
37+
from .resources.enrichments import EnrichmentsResource, AsyncEnrichmentsResource
3838
from .resources.extractions.extractions import ExtractionsResource, AsyncExtractionsResource
3939
from .resources.classifications.classifications import ClassificationsResource, AsyncClassificationsResource
4040

src/isaacus/resources/classifications/universal.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
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
2223
from ...types.classifications.universal_classification_response import UniversalClassificationResponse
2324

2425
__all__ = ["UniversalResource", "AsyncUniversalResource"]
@@ -52,7 +53,7 @@ def create(
5253
texts: SequenceNotStr[str],
5354
is_iql: bool | Omit = omit,
5455
scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"] | Omit = omit,
55-
chunking_options: Optional[universal_create_params.ChunkingOptions] | Omit = omit,
56+
chunking_options: Optional[ChunkingOptions] | Omit = omit,
5657
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5758
# The extra values given here take precedence over values defined on the client or passed to this method.
5859
extra_headers: Headers | None = None,
@@ -153,7 +154,7 @@ async def create(
153154
texts: SequenceNotStr[str],
154155
is_iql: bool | Omit = omit,
155156
scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"] | Omit = omit,
156-
chunking_options: Optional[universal_create_params.ChunkingOptions] | Omit = omit,
157+
chunking_options: Optional[ChunkingOptions] | Omit = omit,
157158
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
158159
# The extra values given here take precedence over values defined on the client or passed to this method.
159160
extra_headers: Headers | None = None,

src/isaacus/resources/enrichments/enrichments.py renamed to src/isaacus/resources/enrichments.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77

88
import httpx
99

10-
from ...types import enrichment_create_params
11-
from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
12-
from ..._utils import maybe_transform, async_maybe_transform
13-
from ..._compat import cached_property
14-
from ..._resource import SyncAPIResource, AsyncAPIResource
15-
from ..._response import (
10+
from ..types import enrichment_create_params
11+
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
12+
from .._utils import maybe_transform, async_maybe_transform
13+
from .._compat import cached_property
14+
from .._resource import SyncAPIResource, AsyncAPIResource
15+
from .._response import (
1616
to_raw_response_wrapper,
1717
to_streamed_response_wrapper,
1818
async_to_raw_response_wrapper,
1919
async_to_streamed_response_wrapper,
2020
)
21-
from ..._base_client import make_request_options
22-
from ...types.enrichment_response import EnrichmentResponse
21+
from .._base_client import make_request_options
22+
from ..types.enrichment_response import EnrichmentResponse
2323

2424
__all__ = ["EnrichmentsResource", "AsyncEnrichmentsResource"]
2525

src/isaacus/resources/enrichments/__init__.py

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

src/isaacus/resources/extractions/qa.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
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
2223
from ...types.extractions.answer_extraction_response import AnswerExtractionResponse
2324

2425
__all__ = ["QAResource", "AsyncQAResource"]
@@ -52,7 +53,7 @@ def create(
5253
texts: SequenceNotStr[str],
5354
ignore_inextractability: bool | Omit = omit,
5455
top_k: int | Omit = omit,
55-
chunking_options: Optional[qa_create_params.ChunkingOptions] | Omit = omit,
56+
chunking_options: Optional[ChunkingOptions] | Omit = omit,
5657
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5758
# The extra values given here take precedence over values defined on the client or passed to this method.
5859
extra_headers: Headers | None = None,
@@ -152,7 +153,7 @@ async def create(
152153
texts: SequenceNotStr[str],
153154
ignore_inextractability: bool | Omit = omit,
154155
top_k: int | Omit = omit,
155-
chunking_options: Optional[qa_create_params.ChunkingOptions] | Omit = omit,
156+
chunking_options: Optional[ChunkingOptions] | Omit = omit,
156157
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
157158
# The extra values given here take precedence over values defined on the client or passed to this method.
158159
extra_headers: Headers | None = None,

src/isaacus/resources/rerankings.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
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
2324

2425
__all__ = ["RerankingsResource", "AsyncRerankingsResource"]
2526

@@ -53,7 +54,7 @@ def create(
5354
top_n: Optional[int] | Omit = omit,
5455
is_iql: bool | Omit = omit,
5556
scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"] | Omit = omit,
56-
chunking_options: Optional[reranking_create_params.ChunkingOptions] | Omit = omit,
57+
chunking_options: Optional[ChunkingOptions] | Omit = omit,
5758
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5859
# The extra values given here take precedence over values defined on the client or passed to this method.
5960
extra_headers: Headers | None = None,
@@ -164,7 +165,7 @@ async def create(
164165
top_n: Optional[int] | Omit = omit,
165166
is_iql: bool | Omit = omit,
166167
scoring_method: Literal["auto", "chunk_max", "chunk_avg", "chunk_min"] | Omit = omit,
167-
chunking_options: Optional[reranking_create_params.ChunkingOptions] | Omit = omit,
168+
chunking_options: Optional[ChunkingOptions] | Omit = omit,
168169
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
169170
# The extra values given here take precedence over values defined on the client or passed to this method.
170171
extra_headers: Headers | None = None,

src/isaacus/types/__init__.py

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

33
from __future__ import annotations
44

5+
from .shared import ChunkingOptions as ChunkingOptions
56
from .embedding_response import EmbeddingResponse as EmbeddingResponse
67
from .reranking_response import RerankingResponse as RerankingResponse
78
from .enrichment_response import EnrichmentResponse as EnrichmentResponse

src/isaacus/types/classifications/universal_create_params.py

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

88
from ..._types import SequenceNotStr
9+
from ..shared_params.chunking_options import ChunkingOptions
910

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

1213

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

5758
chunking_options: Optional[ChunkingOptions]
5859
"""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."""

0 commit comments

Comments
 (0)