Skip to content

Commit af9df92

Browse files
authored
Merge pull request #29 from Not-Diamond/release-please--branches--main--changes--next
release: 1.0.1
2 parents 90d72dd + 3da8959 commit af9df92

17 files changed

Lines changed: 175 additions & 5 deletions

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.0.0"
2+
".": "1.0.1"
33
}

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Changelog
22

3+
## 1.0.1 (2025-12-09)
4+
5+
Full Changelog: [v1.0.0...v1.0.1](https://github.com/Not-Diamond/not-diamond-python/compare/v1.0.0...v1.0.1)
6+
7+
### Bug Fixes
8+
9+
* **types:** allow pyright to infer TypedDict types within SequenceNotStr ([5663881](https://github.com/Not-Diamond/not-diamond-python/commit/566388145d7d3fea2e52158963fc2ad8e8ee45c8))
10+
11+
12+
### Chores
13+
14+
* add missing docstrings ([003db35](https://github.com/Not-Diamond/not-diamond-python/commit/003db35899fda442fd45bdcafe4aeaad09b1dd4d))
15+
316
## 1.0.0 (2025-12-08)
417

518
Full Changelog: [v1.0.0-rc18...v1.0.0](https://github.com/Not-Diamond/not-diamond-python/compare/v1.0.0-rc18...v1.0.0)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "notdiamond"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
description = "The official Python library for the notdiamond API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/notdiamond/_types.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ class HttpxSendArgs(TypedDict, total=False):
243243
if TYPE_CHECKING:
244244
# This works because str.__contains__ does not accept object (either in typeshed or at runtime)
245245
# https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285
246+
#
247+
# Note: index() and count() methods are intentionally omitted to allow pyright to properly
248+
# infer TypedDict types when dict literals are used in lists assigned to SequenceNotStr.
246249
class SequenceNotStr(Protocol[_T_co]):
247250
@overload
248251
def __getitem__(self, index: SupportsIndex, /) -> _T_co: ...
@@ -251,8 +254,6 @@ def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ...
251254
def __contains__(self, value: object, /) -> bool: ...
252255
def __len__(self) -> int: ...
253256
def __iter__(self) -> Iterator[_T_co]: ...
254-
def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ...
255-
def count(self, value: Any, /) -> int: ...
256257
def __reversed__(self) -> Iterator[_T_co]: ...
257258
else:
258259
# just point this to a normal `Sequence` at runtime to avoid having to special case

src/notdiamond/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "notdiamond"
4-
__version__ = "1.0.0" # x-release-please-version
4+
__version__ = "1.0.1" # x-release-please-version

src/notdiamond/types/custom_router_train_custom_router_response.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,24 @@
66

77

88
class CustomRouterTrainCustomRouterResponse(BaseModel):
9+
"""Response model for POST /v2/pzn/trainCustomRouter endpoint.
10+
11+
Returned immediately after submitting a custom router training request. The training
12+
process runs asynchronously (typically 5-15 minutes), so use the returned preference_id
13+
to make routing calls once training completes.
14+
15+
**Next steps:**
16+
1. Store the preference_id
17+
2. Wait for training to complete (typically 5-15 minutes)
18+
3. Use this preference_id in POST /v2/modelRouter/modelSelect requests
19+
4. The router will use your custom-trained model to make routing decisions
20+
21+
**How to use the preference_id:**
22+
- Include it in the 'preference_id' field of model_select() calls
23+
- The system automatically uses your custom router once training is complete
24+
- No need to poll status - you can start using it immediately (will use default until ready)
25+
"""
26+
927
preference_id: str
1028
"""Unique identifier for the custom router.
1129

src/notdiamond/types/golden_record_param.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010

1111
class GoldenRecordParam(TypedDict, total=False):
12+
"""A training or test example for prompt adaptation."""
13+
1214
fields: Required[Dict[str, str]]
1315
"""Dictionary mapping field names to their values.
1416

src/notdiamond/types/model.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88

99

1010
class Model(BaseModel):
11+
"""Response model for a single LLM model from GET /v2/models endpoint.
12+
13+
Contains metadata about a supported text generation model including pricing,
14+
context limits, and availability information.
15+
"""
16+
1117
context_length: int
1218
"""Maximum context window size in tokens"""
1319

src/notdiamond/types/model_list_response.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99

1010

1111
class ModelListResponse(BaseModel):
12+
"""Response model for GET /v2/models endpoint.
13+
14+
Returns a list of all supported text generation models with their metadata,
15+
separated into active and deprecated models.
16+
"""
17+
1218
deprecated_models: List[Model]
1319
"""List of deprecated models that are no longer recommended but may still work"""
1420

src/notdiamond/types/model_router_select_model_params.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,19 @@ class ModelRouterSelectModelParams(TypedDict, total=False):
5858

5959

6060
class LlmProviderOpenRouterProvider(TypedDict, total=False):
61+
"""Model for specifying an LLM provider using OpenRouter format.
62+
63+
Used in model routing requests when you want to specify providers using the
64+
OpenRouter naming convention (combined 'provider/model' format). This is an
65+
alternative to the standard RequestProvider which uses separate provider and
66+
model fields.
67+
68+
**When to use:**
69+
- When working with OpenRouter-compatible systems
70+
- When you prefer the unified 'provider/model' format
71+
- For models accessed via OpenRouter proxy
72+
"""
73+
6174
model: Required[str]
6275
"""
6376
OpenRouter model identifier in 'provider/model' format (e.g., 'openai/gpt-4o',

0 commit comments

Comments
 (0)