diffio 0.1.91__tar.gz → 0.1.93__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: diffio
3
- Version: 0.1.91
3
+ Version: 0.1.93
4
4
  Summary: Python SDK for the Diffio API.
5
5
  Author: Diffio
6
6
  License: MIT
@@ -95,7 +95,7 @@ project = client.create_project(
95
95
 
96
96
  generation = client.create_generation(
97
97
  apiProjectId=project.apiProjectId,
98
- model="diffio-3.5",
98
+ model="diffio-4.0-flash",
99
99
  sampling={"steps": 12, "guidance": 1.5},
100
100
  idempotencyKey="restore-job-2026-001",
101
101
  requestOptions={"maxRetries": 2},
@@ -117,7 +117,7 @@ from diffio import DiffioClient
117
117
  client = DiffioClient(apiKey="diffio_live_...")
118
118
  result = client.audio_isolation.isolate(
119
119
  filePath="sample.wav",
120
- model="diffio-3.5",
120
+ model="diffio-4.0-flash",
121
121
  sampling={"steps": 12, "guidance": 1.5},
122
122
  )
123
123
 
@@ -134,7 +134,7 @@ from diffio import DiffioClient
134
134
  client = DiffioClient(apiKey="diffio_live_...")
135
135
  audio_bytes, info = client.restore_audio(
136
136
  filePath="sample.wav",
137
- model="diffio-3.5",
137
+ model="diffio-4.0-flash",
138
138
  sampling={"steps": 12, "guidance": 1.5},
139
139
  onProgress=lambda progress: print(progress.status),
140
140
  )
@@ -67,7 +67,7 @@ project = client.create_project(
67
67
 
68
68
  generation = client.create_generation(
69
69
  apiProjectId=project.apiProjectId,
70
- model="diffio-3.5",
70
+ model="diffio-4.0-flash",
71
71
  sampling={"steps": 12, "guidance": 1.5},
72
72
  idempotencyKey="restore-job-2026-001",
73
73
  requestOptions={"maxRetries": 2},
@@ -89,7 +89,7 @@ from diffio import DiffioClient
89
89
  client = DiffioClient(apiKey="diffio_live_...")
90
90
  result = client.audio_isolation.isolate(
91
91
  filePath="sample.wav",
92
- model="diffio-3.5",
92
+ model="diffio-4.0-flash",
93
93
  sampling={"steps": 12, "guidance": 1.5},
94
94
  )
95
95
 
@@ -106,7 +106,7 @@ from diffio import DiffioClient
106
106
  client = DiffioClient(apiKey="diffio_live_...")
107
107
  audio_bytes, info = client.restore_audio(
108
108
  filePath="sample.wav",
109
- model="diffio-3.5",
109
+ model="diffio-4.0-flash",
110
110
  sampling={"steps": 12, "guidance": 1.5},
111
111
  onProgress=lambda progress: print(progress.status),
112
112
  )
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "diffio"
7
- version = "0.1.91"
7
+ version = "0.1.93"
8
8
  description = "Python SDK for the Diffio API."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -74,4 +74,4 @@ __all__ = [
74
74
  "WebhooksClient",
75
75
  ]
76
76
 
77
- __version__ = "0.1.91"
77
+ __version__ = "0.1.93"
@@ -38,6 +38,8 @@ MODEL_ENDPOINTS = {
38
38
  "diffio-2-flash": "diffio-2.0-flash-generation",
39
39
  "diffio-3.4": "diffio-3.4-generation",
40
40
  "diffio-3.5": "diffio-3.5-generation",
41
+ "diffio-4.0-flash": "diffio-4.0-flash-generation",
42
+ "diffio-4.0-pro": "diffio-4.0-pro-generation",
41
43
  }
42
44
  DEFAULT_RETRY_STATUS_CODES = [408, 429, 500, 502, 503, 504]
43
45
  DEFAULT_RETRY_BACKOFF = 0.5
@@ -305,7 +307,7 @@ class DiffioClient:
305
307
  self,
306
308
  *,
307
309
  apiProjectId,
308
- model="diffio-2",
310
+ model="diffio-4.0-flash",
309
311
  sampling=None,
310
312
  params=None,
311
313
  idempotencyKey=None,
@@ -717,7 +719,7 @@ class DiffioClient:
717
719
  contentType=None,
718
720
  contentLength=None,
719
721
  fileFormat=None,
720
- model="diffio-2",
722
+ model="diffio-4.0-flash",
721
723
  sampling=None,
722
724
  projectParams=None,
723
725
  generationParams=None,
@@ -852,7 +854,7 @@ class GenerationsClient:
852
854
  self,
853
855
  *,
854
856
  apiProjectId,
855
- model="diffio-2",
857
+ model="diffio-4.0-flash",
856
858
  sampling=None,
857
859
  params=None,
858
860
  idempotencyKey=None,
@@ -966,7 +968,7 @@ class GenerationsClient:
966
968
  self,
967
969
  *,
968
970
  apiProjectId,
969
- model="diffio-2",
971
+ model="diffio-4.0-flash",
970
972
  sampling=None,
971
973
  params=None,
972
974
  idempotencyKey=None,
@@ -1090,7 +1092,7 @@ class AudioIsolationClient:
1090
1092
  contentType=None,
1091
1093
  contentLength=None,
1092
1094
  fileFormat=None,
1093
- model="diffio-2",
1095
+ model="diffio-4.0-flash",
1094
1096
  sampling=None,
1095
1097
  projectParams=None,
1096
1098
  generationParams=None,
@@ -1115,7 +1117,7 @@ class AudioIsolationClient:
1115
1117
  contentType=None,
1116
1118
  contentLength=None,
1117
1119
  fileFormat=None,
1118
- model="diffio-2",
1120
+ model="diffio-4.0-flash",
1119
1121
  sampling=None,
1120
1122
  projectParams=None,
1121
1123
  generationParams=None,
@@ -1147,7 +1149,7 @@ class AudioIsolationClient:
1147
1149
  contentType=None,
1148
1150
  contentLength=None,
1149
1151
  fileFormat=None,
1150
- model="diffio-2",
1152
+ model="diffio-4.0-flash",
1151
1153
  sampling=None,
1152
1154
  projectParams=None,
1153
1155
  generationParams=None,
@@ -1271,7 +1273,7 @@ class AudioIsolationClient:
1271
1273
  contentType=None,
1272
1274
  contentLength=None,
1273
1275
  fileFormat=None,
1274
- model="diffio-2",
1276
+ model="diffio-4.0-flash",
1275
1277
  sampling=None,
1276
1278
  projectParams=None,
1277
1279
  generationParams=None,
@@ -451,7 +451,7 @@ class AudioIsolationResult:
451
451
  self.generation = generation
452
452
 
453
453
 
454
- ModelKey = ("diffio-2", "diffio-2-flash", "diffio-3.4", "diffio-3.5")
454
+ ModelKey = ("diffio-2", "diffio-2-flash", "diffio-3.4", "diffio-3.5", "diffio-4.0-flash", "diffio-4.0-pro")
455
455
  DownloadType = ("audio", "mp3", "video", "transcript")
456
456
  WebhookMode = ("test", "live")
457
457
  WebhookEventType = (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: diffio
3
- Version: 0.1.91
3
+ Version: 0.1.93
4
4
  Summary: Python SDK for the Diffio API.
5
5
  Author: Diffio
6
6
  License: MIT
@@ -95,7 +95,7 @@ project = client.create_project(
95
95
 
96
96
  generation = client.create_generation(
97
97
  apiProjectId=project.apiProjectId,
98
- model="diffio-3.5",
98
+ model="diffio-4.0-flash",
99
99
  sampling={"steps": 12, "guidance": 1.5},
100
100
  idempotencyKey="restore-job-2026-001",
101
101
  requestOptions={"maxRetries": 2},
@@ -117,7 +117,7 @@ from diffio import DiffioClient
117
117
  client = DiffioClient(apiKey="diffio_live_...")
118
118
  result = client.audio_isolation.isolate(
119
119
  filePath="sample.wav",
120
- model="diffio-3.5",
120
+ model="diffio-4.0-flash",
121
121
  sampling={"steps": 12, "guidance": 1.5},
122
122
  )
123
123
 
@@ -134,7 +134,7 @@ from diffio import DiffioClient
134
134
  client = DiffioClient(apiKey="diffio_live_...")
135
135
  audio_bytes, info = client.restore_audio(
136
136
  filePath="sample.wav",
137
- model="diffio-3.5",
137
+ model="diffio-4.0-flash",
138
138
  sampling={"steps": 12, "guidance": 1.5},
139
139
  onProgress=lambda progress: print(progress.status),
140
140
  )
@@ -12,5 +12,6 @@ src/diffio.egg-info/dependency_links.txt
12
12
  src/diffio.egg-info/requires.txt
13
13
  src/diffio.egg-info/top_level.txt
14
14
  tests/test_client.py
15
+ tests/test_diffio40_models.py
15
16
  tests/test_emulator_e2e.py
16
17
  tests/test_transcription.py
@@ -248,7 +248,7 @@ def test_audio_isolation_isolate_runs_full_flow(tmp_path: Path):
248
248
  assert request.headers.get("Content-Type") == "audio/wav"
249
249
  return httpx.Response(200)
250
250
 
251
- if request.url.path == "/v1/diffio-2.0-generation":
251
+ if request.url.path in ("/v1/diffio-2.0-generation", "/v1/diffio-4.0-flash-generation"):
252
252
  payload = json.loads(request.content.decode("utf-8"))
253
253
  assert payload["apiProjectId"] == "proj_abc"
254
254
  assert payload["sampling"]["steps"] == 10
@@ -257,7 +257,7 @@ def test_audio_isolation_isolate_runs_full_flow(tmp_path: Path):
257
257
  json={
258
258
  "generationId": "gen_123",
259
259
  "apiProjectId": "proj_abc",
260
- "modelKey": "diffio-2",
260
+ "modelKey": "diffio-4.0-flash" if "4.0-flash" in request.url.path else "diffio-2",
261
261
  "status": "queued",
262
262
  },
263
263
  )
@@ -326,7 +326,7 @@ def test_create_generation_sends_idempotency_key_and_parses_replay():
326
326
  json={
327
327
  "generationId": "gen_original",
328
328
  "apiProjectId": "proj_123",
329
- "modelKey": "diffio-2",
329
+ "modelKey": "diffio-4.0-flash" if "4.0-flash" in request.url.path else "diffio-2",
330
330
  "status": "queued",
331
331
  "idempotentReplay": True,
332
332
  },
@@ -341,7 +341,7 @@ def test_create_generation_sends_idempotency_key_and_parses_replay():
341
341
  idempotencyKey="restore-job-2026-001",
342
342
  )
343
343
 
344
- assert received["path"] == "/v1/diffio-2.0-generation"
344
+ assert received["path"] == "/v1/diffio-4.0-flash-generation"
345
345
  assert received["payload"] == {
346
346
  "apiProjectId": "proj_123",
347
347
  "idempotencyKey": "restore-job-2026-001",
@@ -360,7 +360,7 @@ def test_generations_create_forwards_idempotency_key():
360
360
  json={
361
361
  "generationId": "gen_123",
362
362
  "apiProjectId": "proj_123",
363
- "modelKey": "diffio-2",
363
+ "modelKey": "diffio-4.0-flash" if "4.0-flash" in request.url.path else "diffio-2",
364
364
  "status": "queued",
365
365
  },
366
366
  )
@@ -382,14 +382,14 @@ def test_generations_create_and_wait_forwards_idempotency_key():
382
382
  received = {}
383
383
 
384
384
  def handler(request):
385
- if request.url.path == "/v1/diffio-2.0-generation":
385
+ if request.url.path in ("/v1/diffio-2.0-generation", "/v1/diffio-4.0-flash-generation"):
386
386
  received["createPayload"] = json.loads(request.content.decode("utf-8"))
387
387
  return httpx.Response(
388
388
  200,
389
389
  json={
390
390
  "generationId": "gen_123",
391
391
  "apiProjectId": "proj_123",
392
- "modelKey": "diffio-2",
392
+ "modelKey": "diffio-4.0-flash" if "4.0-flash" in request.url.path else "diffio-2",
393
393
  "status": "queued",
394
394
  "idempotentReplay": False,
395
395
  },
@@ -474,7 +474,7 @@ def test_restore_audio_runs_full_flow_and_downloads(tmp_path, monkeypatch, trans
474
474
  assert request.headers.get("Content-Type") == "audio/wav"
475
475
  return httpx.Response(200)
476
476
 
477
- if request.url.path == "/v1/diffio-2.0-generation":
477
+ if request.url.path in ("/v1/diffio-2.0-generation", "/v1/diffio-4.0-flash-generation"):
478
478
  payload = json.loads(request.content.decode("utf-8"))
479
479
  assert payload["apiProjectId"] == "proj_abc"
480
480
  assert payload["sampling"]["steps"] == 10
@@ -483,7 +483,7 @@ def test_restore_audio_runs_full_flow_and_downloads(tmp_path, monkeypatch, trans
483
483
  json={
484
484
  "generationId": "gen_123",
485
485
  "apiProjectId": "proj_abc",
486
- "modelKey": "diffio-2",
486
+ "modelKey": "diffio-4.0-flash" if "4.0-flash" in request.url.path else "diffio-2",
487
487
  "status": "queued",
488
488
  },
489
489
  )
@@ -861,7 +861,7 @@ def test_list_project_generations_payload_and_response():
861
861
  {
862
862
  "generationId": "gen_123",
863
863
  "status": "processing",
864
- "modelKey": "diffio-2",
864
+ "modelKey": "diffio-4.0-flash" if "4.0-flash" in request.url.path else "diffio-2",
865
865
  "progress": None,
866
866
  "createdAt": "2026-01-05T12:40:00Z",
867
867
  "updatedAt": "2026-01-05T12:41:00Z",
@@ -0,0 +1,48 @@
1
+ import json
2
+
3
+ import httpx
4
+ import pytest
5
+
6
+ from diffio import DiffioClient
7
+
8
+
9
+ @pytest.mark.parametrize(
10
+ ("model", "path"),
11
+ [
12
+ ("diffio-4.0-flash", "/v1/diffio-4.0-flash-generation"),
13
+ ("diffio-4.0-pro", "/v1/diffio-4.0-pro-generation"),
14
+ ],
15
+ )
16
+ def test_create_generation_routes_each_diffio_4_0_model_to_its_endpoint(model, path):
17
+ received = {}
18
+
19
+ def handler(request: httpx.Request) -> httpx.Response:
20
+ received["path"] = request.url.path
21
+ received["payload"] = json.loads(request.content.decode("utf-8"))
22
+ return httpx.Response(
23
+ 200,
24
+ json={"generationId": "gen_40", "apiProjectId": "proj_40", "modelKey": model, "status": "queued"},
25
+ )
26
+
27
+ http_client = httpx.Client(base_url="https://api.test", transport=httpx.MockTransport(handler))
28
+ client = DiffioClient(apiKey="diffio_live_test", baseUrl="https://api.test", httpClient=http_client)
29
+
30
+ response = client.create_generation(apiProjectId="proj_40", model=model)
31
+
32
+ assert received["path"] == path
33
+ assert received["payload"]["apiProjectId"] == "proj_40"
34
+ assert response.modelKey == model
35
+
36
+
37
+ def test_creating_a_generation_without_a_model_uses_diffio_40_flash():
38
+ """The published SDK defaulted to the deprecated diffio-2, so docs examples broke."""
39
+ import inspect
40
+
41
+ from diffio.client import DiffioClient
42
+
43
+ for name in ("create_generation", "restore"):
44
+ method = getattr(DiffioClient, name, None)
45
+ if method is None:
46
+ continue
47
+ default = inspect.signature(method).parameters["model"].default
48
+ assert default == "diffio-4.0-flash", f"{name} still defaults to {default}"
File without changes
File without changes
File without changes
File without changes