vellum-ai 0.14.88__py3-none-any.whl → 0.14.89__py3-none-any.whl

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.
Files changed (31) hide show
  1. vellum/client/README.md +33 -10
  2. vellum/client/__init__.py +141 -40
  3. vellum/client/core/client_wrapper.py +18 -5
  4. vellum/client/reference.md +241 -318
  5. vellum/client/resources/ad_hoc/client.py +76 -24
  6. vellum/client/resources/container_images/client.py +14 -6
  7. vellum/client/resources/deployments/client.py +28 -4
  8. vellum/client/resources/document_indexes/client.py +30 -38
  9. vellum/client/resources/documents/client.py +8 -30
  10. vellum/client/resources/folder_entities/client.py +4 -0
  11. vellum/client/resources/metric_definitions/client.py +16 -4
  12. vellum/client/resources/ml_models/client.py +2 -0
  13. vellum/client/resources/organizations/client.py +2 -0
  14. vellum/client/resources/prompts/client.py +26 -6
  15. vellum/client/resources/release_reviews/client.py +2 -0
  16. vellum/client/resources/sandboxes/client.py +10 -10
  17. vellum/client/resources/test_suite_runs/client.py +6 -0
  18. vellum/client/resources/test_suites/client.py +96 -58
  19. vellum/client/resources/workflow_deployments/client.py +16 -0
  20. vellum/client/resources/workflow_sandboxes/client.py +4 -0
  21. vellum/client/resources/workflows/client.py +0 -30
  22. vellum/client/resources/workspace_secrets/client.py +4 -0
  23. vellum/client/resources/workspaces/client.py +2 -0
  24. vellum/workflows/nodes/displayable/tool_calling_node/node.py +1 -5
  25. vellum/workflows/nodes/displayable/tool_calling_node/state.py +9 -0
  26. vellum/workflows/nodes/displayable/tool_calling_node/utils.py +50 -41
  27. {vellum_ai-0.14.88.dist-info → vellum_ai-0.14.89.dist-info}/METADATA +1 -1
  28. {vellum_ai-0.14.88.dist-info → vellum_ai-0.14.89.dist-info}/RECORD +31 -30
  29. {vellum_ai-0.14.88.dist-info → vellum_ai-0.14.89.dist-info}/LICENSE +0 -0
  30. {vellum_ai-0.14.88.dist-info → vellum_ai-0.14.89.dist-info}/WHEEL +0 -0
  31. {vellum_ai-0.14.88.dist-info → vellum_ai-0.14.89.dist-info}/entry_points.txt +0 -0
vellum/client/README.md CHANGED
@@ -30,14 +30,19 @@ Instantiate and use the client with the following:
30
30
  from vellum import StringInputRequest, Vellum
31
31
 
32
32
  client = Vellum(
33
+ api_version="YOUR_API_VERSION",
33
34
  api_key="YOUR_API_KEY",
34
35
  )
35
36
  client.execute_prompt(
36
37
  inputs=[
37
38
  StringInputRequest(
38
- name="name",
39
+ name="x",
39
40
  value="value",
40
- )
41
+ ),
42
+ StringInputRequest(
43
+ name="x",
44
+ value="value",
45
+ ),
41
46
  ],
42
47
  )
43
48
  ```
@@ -52,6 +57,7 @@ import asyncio
52
57
  from vellum import AsyncVellum, StringInputRequest
53
58
 
54
59
  client = AsyncVellum(
60
+ api_version="YOUR_API_VERSION",
55
61
  api_key="YOUR_API_KEY",
56
62
  )
57
63
 
@@ -60,9 +66,13 @@ async def main() -> None:
60
66
  await client.execute_prompt(
61
67
  inputs=[
62
68
  StringInputRequest(
63
- name="name",
69
+ name="x",
70
+ value="value",
71
+ ),
72
+ StringInputRequest(
73
+ name="x",
64
74
  value="value",
65
- )
75
+ ),
66
76
  ],
67
77
  )
68
78
 
@@ -99,28 +109,41 @@ from vellum import (
99
109
  )
100
110
 
101
111
  client = Vellum(
112
+ api_version="YOUR_API_VERSION",
102
113
  api_key="YOUR_API_KEY",
103
114
  )
104
115
  response = client.ad_hoc.adhoc_execute_prompt_stream(
105
- ml_model="ml_model",
116
+ ml_model="x",
106
117
  input_values=[
107
118
  PromptRequestStringInput(
108
- key="key",
119
+ key="x",
120
+ value="value",
121
+ ),
122
+ PromptRequestStringInput(
123
+ key="x",
109
124
  value="value",
110
- )
125
+ ),
111
126
  ],
112
127
  input_variables=[
113
128
  VellumVariable(
114
- id="id",
129
+ id="x",
130
+ key="key",
131
+ type="STRING",
132
+ ),
133
+ VellumVariable(
134
+ id="x",
115
135
  key="key",
116
136
  type="STRING",
117
- )
137
+ ),
118
138
  ],
119
139
  parameters=PromptParameters(),
120
140
  blocks=[
121
141
  JinjaPromptBlock(
122
142
  template="template",
123
- )
143
+ ),
144
+ JinjaPromptBlock(
145
+ template="template",
146
+ ),
124
147
  ],
125
148
  )
126
149
  for chunk in response:
vellum/client/__init__.py CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  import typing
4
4
  from .environment import VellumEnvironment
5
+ from .types.api_version_enum import ApiVersionEnum
6
+ import os
5
7
  import httpx
6
8
  from .core.client_wrapper import SyncClientWrapper
7
9
  from .resources.ad_hoc.client import AdHocClient
@@ -101,6 +103,7 @@ class Vellum:
101
103
 
102
104
 
103
105
 
106
+ api_version : typing.Optional[ApiVersionEnum]
104
107
  api_key : str
105
108
  timeout : typing.Optional[float]
106
109
  The timeout to be used, in seconds, for requests. By default there is no timeout set, unless a custom httpx client is used, in which case this default is not enforced.
@@ -116,6 +119,7 @@ class Vellum:
116
119
  from vellum import Vellum
117
120
 
118
121
  client = Vellum(
122
+ api_version="YOUR_API_VERSION",
119
123
  api_key="YOUR_API_KEY",
120
124
  )
121
125
  """
@@ -124,6 +128,7 @@ class Vellum:
124
128
  self,
125
129
  *,
126
130
  environment: VellumEnvironment = VellumEnvironment.PRODUCTION,
131
+ api_version: typing.Optional[ApiVersionEnum] = os.getenv("VELLUM_API_VERSION", "2024-10-25"),
127
132
  api_key: str,
128
133
  timeout: typing.Optional[float] = None,
129
134
  follow_redirects: typing.Optional[bool] = True,
@@ -134,6 +139,7 @@ class Vellum:
134
139
  )
135
140
  self._client_wrapper = SyncClientWrapper(
136
141
  environment=environment,
142
+ api_version=api_version,
137
143
  api_key=api_key,
138
144
  httpx_client=httpx_client
139
145
  if httpx_client is not None
@@ -198,10 +204,11 @@ class Vellum:
198
204
  from vellum import Vellum
199
205
 
200
206
  client = Vellum(
207
+ api_version="YOUR_API_VERSION",
201
208
  api_key="YOUR_API_KEY",
202
209
  )
203
210
  client.execute_api(
204
- url="url",
211
+ url="x",
205
212
  )
206
213
  """
207
214
  _response = self._client_wrapper.httpx_client.request(
@@ -277,22 +284,31 @@ class Vellum:
277
284
  from vellum import CodeExecutionPackage, StringInput, Vellum
278
285
 
279
286
  client = Vellum(
287
+ api_version="YOUR_API_VERSION",
280
288
  api_key="YOUR_API_KEY",
281
289
  )
282
290
  client.execute_code(
283
- code="code",
291
+ code="x",
284
292
  runtime="PYTHON_3_11_6",
285
293
  input_values=[
286
294
  StringInput(
287
- name="name",
295
+ name="x",
288
296
  value="value",
289
- )
297
+ ),
298
+ StringInput(
299
+ name="x",
300
+ value="value",
301
+ ),
290
302
  ],
291
303
  packages=[
292
304
  CodeExecutionPackage(
293
305
  version="version",
294
306
  name="name",
295
- )
307
+ ),
308
+ CodeExecutionPackage(
309
+ version="version",
310
+ name="name",
311
+ ),
296
312
  ],
297
313
  output_type="STRING",
298
314
  )
@@ -401,14 +417,19 @@ class Vellum:
401
417
  from vellum import StringInputRequest, Vellum
402
418
 
403
419
  client = Vellum(
420
+ api_version="YOUR_API_VERSION",
404
421
  api_key="YOUR_API_KEY",
405
422
  )
406
423
  client.execute_prompt(
407
424
  inputs=[
408
425
  StringInputRequest(
409
- name="name",
426
+ name="x",
410
427
  value="value",
411
- )
428
+ ),
429
+ StringInputRequest(
430
+ name="x",
431
+ value="value",
432
+ ),
412
433
  ],
413
434
  )
414
435
  """
@@ -556,14 +577,19 @@ class Vellum:
556
577
  from vellum import StringInputRequest, Vellum
557
578
 
558
579
  client = Vellum(
580
+ api_version="YOUR_API_VERSION",
559
581
  api_key="YOUR_API_KEY",
560
582
  )
561
583
  response = client.execute_prompt_stream(
562
584
  inputs=[
563
585
  StringInputRequest(
564
- name="name",
586
+ name="x",
565
587
  value="value",
566
- )
588
+ ),
589
+ StringInputRequest(
590
+ name="x",
591
+ value="value",
592
+ ),
567
593
  ],
568
594
  )
569
595
  for chunk in response:
@@ -713,14 +739,19 @@ class Vellum:
713
739
  from vellum import Vellum, WorkflowRequestStringInputRequest
714
740
 
715
741
  client = Vellum(
742
+ api_version="YOUR_API_VERSION",
716
743
  api_key="YOUR_API_KEY",
717
744
  )
718
745
  client.execute_workflow(
719
746
  inputs=[
720
747
  WorkflowRequestStringInputRequest(
721
- name="name",
748
+ name="x",
722
749
  value="value",
723
- )
750
+ ),
751
+ WorkflowRequestStringInputRequest(
752
+ name="x",
753
+ value="value",
754
+ ),
724
755
  ],
725
756
  )
726
757
  """
@@ -846,14 +877,19 @@ class Vellum:
846
877
  from vellum import Vellum, WorkflowRequestStringInputRequest
847
878
 
848
879
  client = Vellum(
880
+ api_version="YOUR_API_VERSION",
849
881
  api_key="YOUR_API_KEY",
850
882
  )
851
883
  response = client.execute_workflow_stream(
852
884
  inputs=[
853
885
  WorkflowRequestStringInputRequest(
854
- name="name",
886
+ name="x",
855
887
  value="value",
856
- )
888
+ ),
889
+ WorkflowRequestStringInputRequest(
890
+ name="x",
891
+ value="value",
892
+ ),
857
893
  ],
858
894
  )
859
895
  for chunk in response:
@@ -977,13 +1013,17 @@ class Vellum:
977
1013
  from vellum import GenerateRequest, Vellum
978
1014
 
979
1015
  client = Vellum(
1016
+ api_version="YOUR_API_VERSION",
980
1017
  api_key="YOUR_API_KEY",
981
1018
  )
982
1019
  client.generate(
983
1020
  requests=[
984
1021
  GenerateRequest(
985
- input_values={"key": "value"},
986
- )
1022
+ input_values={"input_values": {"key": "value"}},
1023
+ ),
1024
+ GenerateRequest(
1025
+ input_values={"input_values": {"key": "value"}},
1026
+ ),
987
1027
  ],
988
1028
  )
989
1029
  """
@@ -1103,13 +1143,17 @@ class Vellum:
1103
1143
  from vellum import GenerateRequest, Vellum
1104
1144
 
1105
1145
  client = Vellum(
1146
+ api_version="YOUR_API_VERSION",
1106
1147
  api_key="YOUR_API_KEY",
1107
1148
  )
1108
1149
  response = client.generate_stream(
1109
1150
  requests=[
1110
1151
  GenerateRequest(
1111
- input_values={"key": "value"},
1112
- )
1152
+ input_values={"input_values": {"key": "value"}},
1153
+ ),
1154
+ GenerateRequest(
1155
+ input_values={"input_values": {"key": "value"}},
1156
+ ),
1113
1157
  ],
1114
1158
  )
1115
1159
  for chunk in response:
@@ -1240,10 +1284,11 @@ class Vellum:
1240
1284
  from vellum import Vellum
1241
1285
 
1242
1286
  client = Vellum(
1287
+ api_version="YOUR_API_VERSION",
1243
1288
  api_key="YOUR_API_KEY",
1244
1289
  )
1245
1290
  client.search(
1246
- query="query",
1291
+ query="x",
1247
1292
  )
1248
1293
  """
1249
1294
  _response = self._client_wrapper.httpx_client.request(
@@ -1343,10 +1388,11 @@ class Vellum:
1343
1388
  from vellum import SubmitCompletionActualRequest, Vellum
1344
1389
 
1345
1390
  client = Vellum(
1391
+ api_version="YOUR_API_VERSION",
1346
1392
  api_key="YOUR_API_KEY",
1347
1393
  )
1348
1394
  client.submit_completion_actuals(
1349
- actuals=[SubmitCompletionActualRequest()],
1395
+ actuals=[SubmitCompletionActualRequest(), SubmitCompletionActualRequest()],
1350
1396
  )
1351
1397
  """
1352
1398
  _response = self._client_wrapper.httpx_client.request(
@@ -1440,10 +1486,14 @@ class Vellum:
1440
1486
  from vellum import Vellum, WorkflowExecutionActualStringRequest
1441
1487
 
1442
1488
  client = Vellum(
1489
+ api_version="YOUR_API_VERSION",
1443
1490
  api_key="YOUR_API_KEY",
1444
1491
  )
1445
1492
  client.submit_workflow_execution_actuals(
1446
- actuals=[WorkflowExecutionActualStringRequest()],
1493
+ actuals=[
1494
+ WorkflowExecutionActualStringRequest(),
1495
+ WorkflowExecutionActualStringRequest(),
1496
+ ],
1447
1497
  )
1448
1498
  """
1449
1499
  _response = self._client_wrapper.httpx_client.request(
@@ -1487,6 +1537,7 @@ class AsyncVellum:
1487
1537
 
1488
1538
 
1489
1539
 
1540
+ api_version : typing.Optional[ApiVersionEnum]
1490
1541
  api_key : str
1491
1542
  timeout : typing.Optional[float]
1492
1543
  The timeout to be used, in seconds, for requests. By default there is no timeout set, unless a custom httpx client is used, in which case this default is not enforced.
@@ -1502,6 +1553,7 @@ class AsyncVellum:
1502
1553
  from vellum import AsyncVellum
1503
1554
 
1504
1555
  client = AsyncVellum(
1556
+ api_version="YOUR_API_VERSION",
1505
1557
  api_key="YOUR_API_KEY",
1506
1558
  )
1507
1559
  """
@@ -1510,6 +1562,7 @@ class AsyncVellum:
1510
1562
  self,
1511
1563
  *,
1512
1564
  environment: VellumEnvironment = VellumEnvironment.PRODUCTION,
1565
+ api_version: typing.Optional[ApiVersionEnum] = os.getenv("VELLUM_API_VERSION", "2024-10-25"),
1513
1566
  api_key: str,
1514
1567
  timeout: typing.Optional[float] = None,
1515
1568
  follow_redirects: typing.Optional[bool] = True,
@@ -1520,6 +1573,7 @@ class AsyncVellum:
1520
1573
  )
1521
1574
  self._client_wrapper = AsyncClientWrapper(
1522
1575
  environment=environment,
1576
+ api_version=api_version,
1523
1577
  api_key=api_key,
1524
1578
  httpx_client=httpx_client
1525
1579
  if httpx_client is not None
@@ -1586,13 +1640,14 @@ class AsyncVellum:
1586
1640
  from vellum import AsyncVellum
1587
1641
 
1588
1642
  client = AsyncVellum(
1643
+ api_version="YOUR_API_VERSION",
1589
1644
  api_key="YOUR_API_KEY",
1590
1645
  )
1591
1646
 
1592
1647
 
1593
1648
  async def main() -> None:
1594
1649
  await client.execute_api(
1595
- url="url",
1650
+ url="x",
1596
1651
  )
1597
1652
 
1598
1653
 
@@ -1673,25 +1728,34 @@ class AsyncVellum:
1673
1728
  from vellum import AsyncVellum, CodeExecutionPackage, StringInput
1674
1729
 
1675
1730
  client = AsyncVellum(
1731
+ api_version="YOUR_API_VERSION",
1676
1732
  api_key="YOUR_API_KEY",
1677
1733
  )
1678
1734
 
1679
1735
 
1680
1736
  async def main() -> None:
1681
1737
  await client.execute_code(
1682
- code="code",
1738
+ code="x",
1683
1739
  runtime="PYTHON_3_11_6",
1684
1740
  input_values=[
1685
1741
  StringInput(
1686
- name="name",
1742
+ name="x",
1687
1743
  value="value",
1688
- )
1744
+ ),
1745
+ StringInput(
1746
+ name="x",
1747
+ value="value",
1748
+ ),
1689
1749
  ],
1690
1750
  packages=[
1691
1751
  CodeExecutionPackage(
1692
1752
  version="version",
1693
1753
  name="name",
1694
- )
1754
+ ),
1755
+ CodeExecutionPackage(
1756
+ version="version",
1757
+ name="name",
1758
+ ),
1695
1759
  ],
1696
1760
  output_type="STRING",
1697
1761
  )
@@ -1805,6 +1869,7 @@ class AsyncVellum:
1805
1869
  from vellum import AsyncVellum, StringInputRequest
1806
1870
 
1807
1871
  client = AsyncVellum(
1872
+ api_version="YOUR_API_VERSION",
1808
1873
  api_key="YOUR_API_KEY",
1809
1874
  )
1810
1875
 
@@ -1813,9 +1878,13 @@ class AsyncVellum:
1813
1878
  await client.execute_prompt(
1814
1879
  inputs=[
1815
1880
  StringInputRequest(
1816
- name="name",
1881
+ name="x",
1817
1882
  value="value",
1818
- )
1883
+ ),
1884
+ StringInputRequest(
1885
+ name="x",
1886
+ value="value",
1887
+ ),
1819
1888
  ],
1820
1889
  )
1821
1890
 
@@ -1968,6 +2037,7 @@ class AsyncVellum:
1968
2037
  from vellum import AsyncVellum, StringInputRequest
1969
2038
 
1970
2039
  client = AsyncVellum(
2040
+ api_version="YOUR_API_VERSION",
1971
2041
  api_key="YOUR_API_KEY",
1972
2042
  )
1973
2043
 
@@ -1976,9 +2046,13 @@ class AsyncVellum:
1976
2046
  response = await client.execute_prompt_stream(
1977
2047
  inputs=[
1978
2048
  StringInputRequest(
1979
- name="name",
2049
+ name="x",
1980
2050
  value="value",
1981
- )
2051
+ ),
2052
+ StringInputRequest(
2053
+ name="x",
2054
+ value="value",
2055
+ ),
1982
2056
  ],
1983
2057
  )
1984
2058
  async for chunk in response:
@@ -2133,6 +2207,7 @@ class AsyncVellum:
2133
2207
  from vellum import AsyncVellum, WorkflowRequestStringInputRequest
2134
2208
 
2135
2209
  client = AsyncVellum(
2210
+ api_version="YOUR_API_VERSION",
2136
2211
  api_key="YOUR_API_KEY",
2137
2212
  )
2138
2213
 
@@ -2141,9 +2216,13 @@ class AsyncVellum:
2141
2216
  await client.execute_workflow(
2142
2217
  inputs=[
2143
2218
  WorkflowRequestStringInputRequest(
2144
- name="name",
2219
+ name="x",
2145
2220
  value="value",
2146
- )
2221
+ ),
2222
+ WorkflowRequestStringInputRequest(
2223
+ name="x",
2224
+ value="value",
2225
+ ),
2147
2226
  ],
2148
2227
  )
2149
2228
 
@@ -2274,6 +2353,7 @@ class AsyncVellum:
2274
2353
  from vellum import AsyncVellum, WorkflowRequestStringInputRequest
2275
2354
 
2276
2355
  client = AsyncVellum(
2356
+ api_version="YOUR_API_VERSION",
2277
2357
  api_key="YOUR_API_KEY",
2278
2358
  )
2279
2359
 
@@ -2282,9 +2362,13 @@ class AsyncVellum:
2282
2362
  response = await client.execute_workflow_stream(
2283
2363
  inputs=[
2284
2364
  WorkflowRequestStringInputRequest(
2285
- name="name",
2365
+ name="x",
2286
2366
  value="value",
2287
- )
2367
+ ),
2368
+ WorkflowRequestStringInputRequest(
2369
+ name="x",
2370
+ value="value",
2371
+ ),
2288
2372
  ],
2289
2373
  )
2290
2374
  async for chunk in response:
@@ -2413,6 +2497,7 @@ class AsyncVellum:
2413
2497
  from vellum import AsyncVellum, GenerateRequest
2414
2498
 
2415
2499
  client = AsyncVellum(
2500
+ api_version="YOUR_API_VERSION",
2416
2501
  api_key="YOUR_API_KEY",
2417
2502
  )
2418
2503
 
@@ -2421,8 +2506,11 @@ class AsyncVellum:
2421
2506
  await client.generate(
2422
2507
  requests=[
2423
2508
  GenerateRequest(
2424
- input_values={"key": "value"},
2425
- )
2509
+ input_values={"input_values": {"key": "value"}},
2510
+ ),
2511
+ GenerateRequest(
2512
+ input_values={"input_values": {"key": "value"}},
2513
+ ),
2426
2514
  ],
2427
2515
  )
2428
2516
 
@@ -2547,6 +2635,7 @@ class AsyncVellum:
2547
2635
  from vellum import AsyncVellum, GenerateRequest
2548
2636
 
2549
2637
  client = AsyncVellum(
2638
+ api_version="YOUR_API_VERSION",
2550
2639
  api_key="YOUR_API_KEY",
2551
2640
  )
2552
2641
 
@@ -2555,8 +2644,11 @@ class AsyncVellum:
2555
2644
  response = await client.generate_stream(
2556
2645
  requests=[
2557
2646
  GenerateRequest(
2558
- input_values={"key": "value"},
2559
- )
2647
+ input_values={"input_values": {"key": "value"}},
2648
+ ),
2649
+ GenerateRequest(
2650
+ input_values={"input_values": {"key": "value"}},
2651
+ ),
2560
2652
  ],
2561
2653
  )
2562
2654
  async for chunk in response:
@@ -2692,13 +2784,14 @@ class AsyncVellum:
2692
2784
  from vellum import AsyncVellum
2693
2785
 
2694
2786
  client = AsyncVellum(
2787
+ api_version="YOUR_API_VERSION",
2695
2788
  api_key="YOUR_API_KEY",
2696
2789
  )
2697
2790
 
2698
2791
 
2699
2792
  async def main() -> None:
2700
2793
  await client.search(
2701
- query="query",
2794
+ query="x",
2702
2795
  )
2703
2796
 
2704
2797
 
@@ -2803,13 +2896,17 @@ class AsyncVellum:
2803
2896
  from vellum import AsyncVellum, SubmitCompletionActualRequest
2804
2897
 
2805
2898
  client = AsyncVellum(
2899
+ api_version="YOUR_API_VERSION",
2806
2900
  api_key="YOUR_API_KEY",
2807
2901
  )
2808
2902
 
2809
2903
 
2810
2904
  async def main() -> None:
2811
2905
  await client.submit_completion_actuals(
2812
- actuals=[SubmitCompletionActualRequest()],
2906
+ actuals=[
2907
+ SubmitCompletionActualRequest(),
2908
+ SubmitCompletionActualRequest(),
2909
+ ],
2813
2910
  )
2814
2911
 
2815
2912
 
@@ -2908,13 +3005,17 @@ class AsyncVellum:
2908
3005
  from vellum import AsyncVellum, WorkflowExecutionActualStringRequest
2909
3006
 
2910
3007
  client = AsyncVellum(
3008
+ api_version="YOUR_API_VERSION",
2911
3009
  api_key="YOUR_API_KEY",
2912
3010
  )
2913
3011
 
2914
3012
 
2915
3013
  async def main() -> None:
2916
3014
  await client.submit_workflow_execution_actuals(
2917
- actuals=[WorkflowExecutionActualStringRequest()],
3015
+ actuals=[
3016
+ WorkflowExecutionActualStringRequest(),
3017
+ WorkflowExecutionActualStringRequest(),
3018
+ ],
2918
3019
  )
2919
3020
 
2920
3021
 
@@ -5,22 +5,33 @@ import typing
5
5
  import httpx
6
6
 
7
7
  from ..environment import VellumEnvironment
8
+ from ..types.api_version_enum import ApiVersionEnum
8
9
  from .http_client import AsyncHttpClient, HttpClient
9
10
 
10
11
 
11
12
  class BaseClientWrapper:
12
- def __init__(self, *, api_key: str, environment: VellumEnvironment, timeout: typing.Optional[float] = None):
13
+ def __init__(
14
+ self,
15
+ *,
16
+ api_version: typing.Optional[ApiVersionEnum] = None,
17
+ api_key: str,
18
+ environment: VellumEnvironment,
19
+ timeout: typing.Optional[float] = None,
20
+ ):
21
+ self._api_version = api_version
13
22
  self.api_key = api_key
14
23
  self._environment = environment
15
24
  self._timeout = timeout
16
25
 
17
26
  def get_headers(self) -> typing.Dict[str, str]:
18
27
  headers: typing.Dict[str, str] = {
19
- "User-Agent": "vellum-ai/0.14.88",
28
+ "User-Agent": "vellum-ai/0.14.89",
20
29
  "X-Fern-Language": "Python",
21
30
  "X-Fern-SDK-Name": "vellum-ai",
22
- "X-Fern-SDK-Version": "0.14.88",
31
+ "X-Fern-SDK-Version": "0.14.89",
23
32
  }
33
+ if self._api_version is not None:
34
+ headers["X-API-Version"] = self._api_version
24
35
  headers["X-API-KEY"] = self.api_key
25
36
  return headers
26
37
 
@@ -35,12 +46,13 @@ class SyncClientWrapper(BaseClientWrapper):
35
46
  def __init__(
36
47
  self,
37
48
  *,
49
+ api_version: typing.Optional[ApiVersionEnum] = None,
38
50
  api_key: str,
39
51
  environment: VellumEnvironment,
40
52
  timeout: typing.Optional[float] = None,
41
53
  httpx_client: httpx.Client,
42
54
  ):
43
- super().__init__(api_key=api_key, environment=environment, timeout=timeout)
55
+ super().__init__(api_version=api_version, api_key=api_key, environment=environment, timeout=timeout)
44
56
  self.httpx_client = HttpClient(
45
57
  httpx_client=httpx_client, base_headers=self.get_headers, base_timeout=self.get_timeout
46
58
  )
@@ -50,12 +62,13 @@ class AsyncClientWrapper(BaseClientWrapper):
50
62
  def __init__(
51
63
  self,
52
64
  *,
65
+ api_version: typing.Optional[ApiVersionEnum] = None,
53
66
  api_key: str,
54
67
  environment: VellumEnvironment,
55
68
  timeout: typing.Optional[float] = None,
56
69
  httpx_client: httpx.AsyncClient,
57
70
  ):
58
- super().__init__(api_key=api_key, environment=environment, timeout=timeout)
71
+ super().__init__(api_version=api_version, api_key=api_key, environment=environment, timeout=timeout)
59
72
  self.httpx_client = AsyncHttpClient(
60
73
  httpx_client=httpx_client, base_headers=self.get_headers, base_timeout=self.get_timeout
61
74
  )