Skip to content

Commit 4cc92d0

Browse files
authored
Merge pull request #6 from Not-Diamond/release-please--branches--main--changes--next
release: 1.0.0-rc2
2 parents 13549d3 + b8756ef commit 4cc92d0

18 files changed

Lines changed: 142 additions & 153 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-rc1"
2+
".": "1.0.0-rc2"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 17
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/not-diamond-dragos199993%2Fnot-diamond-76d84ad8b4d68f7470a24f0f938d10318ecc1f16b86ca654c1644065c13e413a.yml
3-
openapi_spec_hash: 92030c9eb965278da586919e9c7375b3
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/not-diamond-dragos199993%2Fnot-diamond-8bcbee982c8824ec1768e681aafe64151b8c1790fda874599f7818c8e067099b.yml
3+
openapi_spec_hash: cf30014285209649e86e504008efb7d1
44
config_hash: ebc053f864d961cd31bf34d651c7c04d

CHANGELOG.md

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

3+
## 1.0.0-rc2 (2025-10-31)
4+
5+
Full Changelog: [v1.0.0-rc1...v1.0.0-rc2](https://github.com/Not-Diamond/not-diamond-python/compare/v1.0.0-rc1...v1.0.0-rc2)
6+
7+
### Features
8+
9+
* **api:** api update ([f4f83bd](https://github.com/Not-Diamond/not-diamond-python/commit/f4f83bd926d4296f883f5db75de90a5db275867a))
10+
311
## 1.0.0-rc1 (2025-10-31)
412

513
Full Changelog: [v0.3.0...v1.0.0-rc1](https://github.com/Not-Diamond/not-diamond-python/compare/v0.3.0...v1.0.0-rc1)

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ response = client.routing.select_model(
4141
"provider": "openai",
4242
},
4343
{
44-
"model": "claude-3-5-sonnet-20241022",
44+
"model": "claude-sonnet-4-5-20250929",
4545
"provider": "anthropic",
4646
},
4747
{
@@ -92,7 +92,7 @@ async def main() -> None:
9292
"provider": "openai",
9393
},
9494
{
95-
"model": "claude-3-5-sonnet-20241022",
95+
"model": "claude-sonnet-4-5-20250929",
9696
"provider": "anthropic",
9797
},
9898
{
@@ -150,7 +150,7 @@ async def main() -> None:
150150
"provider": "openai",
151151
},
152152
{
153-
"model": "claude-3-5-sonnet-20241022",
153+
"model": "claude-sonnet-4-5-20250929",
154154
"provider": "anthropic",
155155
},
156156
{
@@ -195,14 +195,10 @@ client = NotDiamond()
195195

196196
response = client.prompt_adaptation.adapt(
197197
fields=["question"],
198-
origin_model={
199-
"model": "gpt-4o",
200-
"provider": "openai",
201-
},
202198
system_prompt="You are a helpful assistant that answers questions accurately.",
203199
target_models=[
204200
{
205-
"model": "claude-3-5-sonnet-20241022",
201+
"model": "claude-sonnet-4-5-20250929",
206202
"provider": "anthropic",
207203
},
208204
{
@@ -211,6 +207,10 @@ response = client.prompt_adaptation.adapt(
211207
},
212208
],
213209
template="Question: {question}\nAnswer:",
210+
origin_model={
211+
"model": "gpt-4o",
212+
"provider": "openai",
213+
},
214214
)
215215
print(response.origin_model)
216216
```
@@ -261,7 +261,7 @@ try:
261261
"provider": "openai",
262262
},
263263
{
264-
"model": "claude-3-5-sonnet-20241022",
264+
"model": "claude-sonnet-4-5-20250929",
265265
"provider": "anthropic",
266266
},
267267
{
@@ -329,7 +329,7 @@ client.with_options(max_retries=5).routing.select_model(
329329
"provider": "openai",
330330
},
331331
{
332-
"model": "claude-3-5-sonnet-20241022",
332+
"model": "claude-sonnet-4-5-20250929",
333333
"provider": "anthropic",
334334
},
335335
{
@@ -377,7 +377,7 @@ client.with_options(timeout=5.0).routing.select_model(
377377
"provider": "openai",
378378
},
379379
{
380-
"model": "claude-3-5-sonnet-20241022",
380+
"model": "claude-sonnet-4-5-20250929",
381381
"provider": "anthropic",
382382
},
383383
{
@@ -441,7 +441,7 @@ response = client.routing.with_raw_response.select_model(
441441
"model": "gpt-4o",
442442
"provider": "openai",
443443
}, {
444-
"model": "claude-3-5-sonnet-20241022",
444+
"model": "claude-sonnet-4-5-20250929",
445445
"provider": "anthropic",
446446
}, {
447447
"model": "gemini-1.5-pro",
@@ -479,7 +479,7 @@ with client.routing.with_streaming_response.select_model(
479479
"provider": "openai",
480480
},
481481
{
482-
"model": "claude-3-5-sonnet-20241022",
482+
"model": "claude-sonnet-4-5-20250929",
483483
"provider": "anthropic",
484484
},
485485
{

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-rc1"
3+
version = "1.0.0-rc2"
44
description = "The official Python library for the not-diamond API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/not_diamond/_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__ = "not_diamond"
4-
__version__ = "1.0.0-rc1" # x-release-please-version
4+
__version__ = "1.0.0-rc2" # x-release-please-version

src/not_diamond/resources/prompt_adaptation.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ def adapt(
5151
self,
5252
*,
5353
fields: SequenceNotStr[str],
54-
origin_model: prompt_adaptation_adapt_params.OriginModel,
5554
system_prompt: str,
5655
target_models: Iterable[prompt_adaptation_adapt_params.TargetModel],
5756
template: str,
5857
evaluation_config: Optional[str] | Omit = omit,
5958
evaluation_metric: Optional[str] | Omit = omit,
6059
goldens: Optional[Iterable[prompt_adaptation_adapt_params.Golden]] | Omit = omit,
60+
origin_model: Optional[prompt_adaptation_adapt_params.OriginModel] | Omit = omit,
6161
origin_model_evaluation_score: Optional[float] | Omit = omit,
6262
test_goldens: Optional[Iterable[prompt_adaptation_adapt_params.TestGolden]] | Omit = omit,
6363
train_goldens: Optional[Iterable[prompt_adaptation_adapt_params.TrainGolden]] | Omit = omit,
@@ -137,8 +137,6 @@ def adapt(
137137
fields: List of field names that will be substituted into the template. Must match keys
138138
in golden records
139139
140-
origin_model: The model your current prompt is optimized for
141-
142140
system_prompt: System prompt to use with the origin model. This sets the context and role for
143141
the LLM
144142
@@ -151,6 +149,8 @@ def adapt(
151149
goldens: Training examples (legacy parameter). Use train_goldens and test_goldens for
152150
better control
153151
152+
origin_model: Model for specifying an LLM provider in API requests.
153+
154154
origin_model_evaluation_score: Optional baseline score for the origin model
155155
156156
test_goldens: Test examples for evaluation. Required if train_goldens is provided
@@ -170,13 +170,13 @@ def adapt(
170170
body=maybe_transform(
171171
{
172172
"fields": fields,
173-
"origin_model": origin_model,
174173
"system_prompt": system_prompt,
175174
"target_models": target_models,
176175
"template": template,
177176
"evaluation_config": evaluation_config,
178177
"evaluation_metric": evaluation_metric,
179178
"goldens": goldens,
179+
"origin_model": origin_model,
180180
"origin_model_evaluation_score": origin_model_evaluation_score,
181181
"test_goldens": test_goldens,
182182
"train_goldens": train_goldens,
@@ -470,13 +470,13 @@ async def adapt(
470470
self,
471471
*,
472472
fields: SequenceNotStr[str],
473-
origin_model: prompt_adaptation_adapt_params.OriginModel,
474473
system_prompt: str,
475474
target_models: Iterable[prompt_adaptation_adapt_params.TargetModel],
476475
template: str,
477476
evaluation_config: Optional[str] | Omit = omit,
478477
evaluation_metric: Optional[str] | Omit = omit,
479478
goldens: Optional[Iterable[prompt_adaptation_adapt_params.Golden]] | Omit = omit,
479+
origin_model: Optional[prompt_adaptation_adapt_params.OriginModel] | Omit = omit,
480480
origin_model_evaluation_score: Optional[float] | Omit = omit,
481481
test_goldens: Optional[Iterable[prompt_adaptation_adapt_params.TestGolden]] | Omit = omit,
482482
train_goldens: Optional[Iterable[prompt_adaptation_adapt_params.TrainGolden]] | Omit = omit,
@@ -556,8 +556,6 @@ async def adapt(
556556
fields: List of field names that will be substituted into the template. Must match keys
557557
in golden records
558558
559-
origin_model: The model your current prompt is optimized for
560-
561559
system_prompt: System prompt to use with the origin model. This sets the context and role for
562560
the LLM
563561
@@ -570,6 +568,8 @@ async def adapt(
570568
goldens: Training examples (legacy parameter). Use train_goldens and test_goldens for
571569
better control
572570
571+
origin_model: Model for specifying an LLM provider in API requests.
572+
573573
origin_model_evaluation_score: Optional baseline score for the origin model
574574
575575
test_goldens: Test examples for evaluation. Required if train_goldens is provided
@@ -589,13 +589,13 @@ async def adapt(
589589
body=await async_maybe_transform(
590590
{
591591
"fields": fields,
592-
"origin_model": origin_model,
593592
"system_prompt": system_prompt,
594593
"target_models": target_models,
595594
"template": template,
596595
"evaluation_config": evaluation_config,
597596
"evaluation_metric": evaluation_metric,
598597
"goldens": goldens,
598+
"origin_model": origin_model,
599599
"origin_model_evaluation_score": origin_model_evaluation_score,
600600
"test_goldens": test_goldens,
601601
"train_goldens": train_goldens,

src/not_diamond/resources/routing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def train_custom_router(
269269
**Example CSV structure:**
270270
271271
```
272-
prompt,openai/gpt-4o/score,openai/gpt-4o/response,anthropic/claude-3-5-sonnet-20241022/score,anthropic/claude-3-5-sonnet-20241022/response
272+
prompt,openai/gpt-4o/score,openai/gpt-4o/response,anthropic/claude-sonnet-4-5-20250929/score,anthropic/claude-sonnet-4-5-20250929/response
273273
"Explain quantum computing",0.95,"Quantum computing uses...",0.87,"Quantum computers leverage..."
274274
"Write a Python function",0.82,"def my_function()...",0.91,"Here's a Python function..."
275275
```
@@ -308,7 +308,7 @@ def train_custom_router(
308308
llm_providers:
309309
JSON string array of LLM providers to train the router on. Format:
310310
'[{"provider": "openai", "model": "gpt-4o"}, {"provider": "anthropic", "model":
311-
"claude-3-5-sonnet-20241022"}]'
311+
"claude-sonnet-4-5-20250929"}]'
312312
313313
maximize: Whether higher scores are better. Set to true if higher scores indicate better
314314
performance, false otherwise
@@ -598,7 +598,7 @@ async def train_custom_router(
598598
**Example CSV structure:**
599599
600600
```
601-
prompt,openai/gpt-4o/score,openai/gpt-4o/response,anthropic/claude-3-5-sonnet-20241022/score,anthropic/claude-3-5-sonnet-20241022/response
601+
prompt,openai/gpt-4o/score,openai/gpt-4o/response,anthropic/claude-sonnet-4-5-20250929/score,anthropic/claude-sonnet-4-5-20250929/response
602602
"Explain quantum computing",0.95,"Quantum computing uses...",0.87,"Quantum computers leverage..."
603603
"Write a Python function",0.82,"def my_function()...",0.91,"Here's a Python function..."
604604
```
@@ -637,7 +637,7 @@ async def train_custom_router(
637637
llm_providers:
638638
JSON string array of LLM providers to train the router on. Format:
639639
'[{"provider": "openai", "model": "gpt-4o"}, {"provider": "anthropic", "model":
640-
"claude-3-5-sonnet-20241022"}]'
640+
"claude-sonnet-4-5-20250929"}]'
641641
642642
maximize: Whether higher scores are better. Set to true if higher scores indicate better
643643
performance, false otherwise

src/not_diamond/types/adaptation_run_results.py

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,7 @@
88
from .._models import BaseModel
99
from .job_status import JobStatus
1010

11-
__all__ = ["AdaptationRunResults", "OriginModel", "TargetModel"]
12-
13-
14-
class OriginModel(BaseModel):
15-
cost: Optional[float] = None
16-
17-
evals: Optional[Dict[str, object]] = None
18-
19-
api_model_name: str = FieldInfo(alias="model_name")
20-
21-
result_status: Optional[JobStatus] = None
22-
23-
score: Optional[float] = None
24-
25-
system_prompt: Optional[str] = None
26-
27-
user_message_template: Optional[str] = None
11+
__all__ = ["AdaptationRunResults", "TargetModel", "OriginModel"]
2812

2913

3014
class TargetModel(BaseModel):
@@ -46,13 +30,31 @@ class TargetModel(BaseModel):
4630
system_prompt: Optional[str] = None
4731
"""Optimized system prompt for this target model"""
4832

33+
task_type: Optional[str] = None
34+
4935
user_message_template: Optional[str] = None
5036
"""Optimized user message template for this target model"""
5137

5238
user_message_template_fields: Optional[List[str]] = None
5339
"""Field names used in the optimized template"""
5440

5541

42+
class OriginModel(BaseModel):
43+
cost: Optional[float] = None
44+
45+
evals: Optional[Dict[str, object]] = None
46+
47+
api_model_name: Optional[str] = FieldInfo(alias="model_name", default=None)
48+
49+
result_status: Optional[JobStatus] = None
50+
51+
score: Optional[float] = None
52+
53+
system_prompt: Optional[str] = None
54+
55+
user_message_template: Optional[str] = None
56+
57+
5658
class AdaptationRunResults(BaseModel):
5759
id: str
5860
"""Unique ID for this adaptation run"""
@@ -63,9 +65,6 @@ class AdaptationRunResults(BaseModel):
6365
job_status: JobStatus
6466
"""Overall status of the adaptation run"""
6567

66-
origin_model: OriginModel
67-
"""Results for the origin model (baseline performance)"""
68-
6968
target_models: List[TargetModel]
7069
"""Results for each target model with optimized prompts"""
7170

@@ -75,3 +74,9 @@ class AdaptationRunResults(BaseModel):
7574
evaluation_config: Optional[str] = None
7675

7776
evaluation_metric: Optional[str] = None
77+
78+
llm_request_metrics: Optional[Dict[str, float]] = None
79+
"""Metrics for the LLM requests made during the adaptation run"""
80+
81+
origin_model: Optional[OriginModel] = None
82+
"""Results for the origin model (baseline performance)"""

0 commit comments

Comments
 (0)