vellum-ai 0.3.20__py3-none-any.whl → 0.3.21__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
vellum/__init__.py CHANGED
@@ -148,6 +148,7 @@ from .types import (
148
148
  MetadataFilterConfigRequest,
149
149
  MetadataFilterRuleCombinator,
150
150
  MetadataFilterRuleRequest,
151
+ MlModelUsage,
151
152
  ModelVersionBuildConfig,
152
153
  ModelVersionExecConfig,
153
154
  ModelVersionExecConfigParameters,
@@ -641,6 +642,7 @@ __all__ = [
641
642
  "MetadataFilterConfigRequest",
642
643
  "MetadataFilterRuleCombinator",
643
644
  "MetadataFilterRuleRequest",
645
+ "MlModelUsage",
644
646
  "ModelVersionBuildConfig",
645
647
  "ModelVersionExecConfig",
646
648
  "ModelVersionExecConfigParameters",
vellum/client.py CHANGED
@@ -167,6 +167,7 @@ class Vellum:
167
167
  deployment_release_tag=True,
168
168
  prompt_version_id=True,
169
169
  finish_reason=True,
170
+ usage=True,
170
171
  ),
171
172
  raw_overrides=RawPromptExecutionOverridesRequest(
172
173
  body={"string": {"key": "value"}},
@@ -301,6 +302,7 @@ class Vellum:
301
302
  deployment_release_tag=True,
302
303
  prompt_version_id=True,
303
304
  finish_reason=True,
305
+ usage=True,
304
306
  ),
305
307
  raw_overrides=RawPromptExecutionOverridesRequest(
306
308
  body={"string": {"key": "value"}},
@@ -1123,6 +1125,7 @@ class AsyncVellum:
1123
1125
  deployment_release_tag=True,
1124
1126
  prompt_version_id=True,
1125
1127
  finish_reason=True,
1128
+ usage=True,
1126
1129
  ),
1127
1130
  raw_overrides=RawPromptExecutionOverridesRequest(
1128
1131
  body={"string": {"key": "value"}},
@@ -1257,6 +1260,7 @@ class AsyncVellum:
1257
1260
  deployment_release_tag=True,
1258
1261
  prompt_version_id=True,
1259
1262
  finish_reason=True,
1263
+ usage=True,
1260
1264
  ),
1261
1265
  raw_overrides=RawPromptExecutionOverridesRequest(
1262
1266
  body={"string": {"key": "value"}},
@@ -18,7 +18,7 @@ class BaseClientWrapper:
18
18
  headers: typing.Dict[str, str] = {
19
19
  "X-Fern-Language": "Python",
20
20
  "X-Fern-SDK-Name": "vellum-ai",
21
- "X-Fern-SDK-Version": "0.3.20",
21
+ "X-Fern-SDK-Version": "0.3.21",
22
22
  }
23
23
  headers["X_API_KEY"] = self.api_key
24
24
  return headers
vellum/types/__init__.py CHANGED
@@ -165,6 +165,7 @@ from .logprobs_enum import LogprobsEnum
165
165
  from .metadata_filter_config_request import MetadataFilterConfigRequest
166
166
  from .metadata_filter_rule_combinator import MetadataFilterRuleCombinator
167
167
  from .metadata_filter_rule_request import MetadataFilterRuleRequest
168
+ from .ml_model_usage import MlModelUsage
168
169
  from .model_version_build_config import ModelVersionBuildConfig
169
170
  from .model_version_exec_config import ModelVersionExecConfig
170
171
  from .model_version_exec_config_parameters import ModelVersionExecConfigParameters
@@ -673,6 +674,7 @@ __all__ = [
673
674
  "MetadataFilterConfigRequest",
674
675
  "MetadataFilterRuleCombinator",
675
676
  "MetadataFilterRuleRequest",
677
+ "MlModelUsage",
676
678
  "ModelVersionBuildConfig",
677
679
  "ModelVersionExecConfig",
678
680
  "ModelVersionExecConfigParameters",
@@ -5,6 +5,7 @@ import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
7
  from .finish_reason_enum import FinishReasonEnum
8
+ from .ml_model_usage import MlModelUsage
8
9
 
9
10
  try:
10
11
  import pydantic.v1 as pydantic # type: ignore
@@ -19,6 +20,7 @@ class FulfilledPromptExecutionMeta(pydantic.BaseModel):
19
20
 
20
21
  latency: typing.Optional[int] = None
21
22
  finish_reason: typing.Optional[FinishReasonEnum] = None
23
+ usage: typing.Optional[MlModelUsage] = None
22
24
 
23
25
  def json(self, **kwargs: typing.Any) -> str:
24
26
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -0,0 +1,33 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ from ..core.datetime_utils import serialize_datetime
7
+
8
+ try:
9
+ import pydantic.v1 as pydantic # type: ignore
10
+ except ImportError:
11
+ import pydantic # type: ignore
12
+
13
+
14
+ class MlModelUsage(pydantic.BaseModel):
15
+ output_token_count: typing.Optional[int] = None
16
+ input_token_count: typing.Optional[int] = None
17
+ input_char_count: typing.Optional[int] = None
18
+ output_char_count: typing.Optional[int] = None
19
+ compute_nanos: typing.Optional[int] = None
20
+
21
+ def json(self, **kwargs: typing.Any) -> str:
22
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
23
+ return super().json(**kwargs_with_defaults)
24
+
25
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
26
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
27
+ return super().dict(**kwargs_with_defaults)
28
+
29
+ class Config:
30
+ frozen = True
31
+ smart_union = True
32
+ extra = pydantic.Extra.allow
33
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -37,6 +37,11 @@ class PromptDeploymentExpandMetaRequestRequest(pydantic.BaseModel):
37
37
  If enabled, the response will include the reason provided by the model for why the execution finished.
38
38
  """
39
39
 
40
+ usage: typing.Optional[bool] = pydantic.Field(default=None)
41
+ """
42
+ If enabled, the response will include model host usage tracking. This may increase latency for some model hosts.
43
+ """
44
+
40
45
  def json(self, **kwargs: typing.Any) -> str:
41
46
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
42
47
  return super().json(**kwargs_with_defaults)
@@ -5,6 +5,7 @@ import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
7
  from .finish_reason_enum import FinishReasonEnum
8
+ from .ml_model_usage import MlModelUsage
8
9
 
9
10
  try:
10
11
  import pydantic.v1 as pydantic # type: ignore
@@ -17,6 +18,7 @@ class PromptExecutionMeta(pydantic.BaseModel):
17
18
  The subset of the metadata tracked by Vellum during prompt execution that the request opted into with `expand_meta`.
18
19
  """
19
20
 
21
+ usage: typing.Optional[MlModelUsage] = None
20
22
  model_name: typing.Optional[str] = None
21
23
  latency: typing.Optional[int] = None
22
24
  deployment_release_tag: typing.Optional[str] = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vellum-ai
3
- Version: 0.3.20
3
+ Version: 0.3.21
4
4
  Summary:
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1,8 +1,8 @@
1
- vellum/__init__.py,sha256=S-isP5rieWJQq1Bf7EcvFjLzGVfEaxtBJcgiMJcnSXE,33941
2
- vellum/client.py,sha256=XB_tltKpWwPoZpsm4g0ftLPKFYjZSLjLAteJwp-xSWA,96636
1
+ vellum/__init__.py,sha256=h2QBLHkAs9OTsNI_W0fYfaUrQUmLd37wNbkK63TQcGY,33979
2
+ vellum/client.py,sha256=ViOMnbiP_kKm3ayXW6DY1wC7Ge8tnI389qC8XVffyB8,96748
3
3
  vellum/core/__init__.py,sha256=RWfyDqkzWsf8e3VGc3NV60MovfJbg5XWzNFGB2DZ0hA,790
4
4
  vellum/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
5
- vellum/core/client_wrapper.py,sha256=uMDH7uKGgjUsZeA_L_bmnHsCUdhpqhH-dlHoV1B71Jo,1698
5
+ vellum/core/client_wrapper.py,sha256=zOXh9ZnRKMmvfCIpadlblmkfFSVgnNdLnEaRVillKps,1698
6
6
  vellum/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
7
7
  vellum/core/file.py,sha256=sy1RUGZ3aJYuw998bZytxxo6QdgKmlnlgBaMvwEKCGg,1480
8
8
  vellum/core/http_client.py,sha256=5ok6hqgZDJhg57EHvMnr0BBaHdG50QxFPKaCZ9aVWTc,5059
@@ -44,7 +44,7 @@ vellum/resources/workflow_deployments/__init__.py,sha256=-5BCA0kSmW6WUh4gqLuQtHv
44
44
  vellum/resources/workflow_deployments/client.py,sha256=DUY1h8mvXqwP-zilmwoek_XbLNTFeeVbxgd7M-k2IzA,11164
45
45
  vellum/resources/workflow_deployments/types/__init__.py,sha256=rmS_4dtbgLHGNQJ_pOloygrjl4sNbKZjTEKBxbMyz6E,208
46
46
  vellum/resources/workflow_deployments/types/workflow_deployments_list_request_status.py,sha256=8-G1SalBR6-AfRnb6POOR9M3tvZa3CGwFIs1ArZb6uw,542
47
- vellum/types/__init__.py,sha256=8PerhxFNQHQwWDScY8jYUQySE3qHluQhXjT9iiEnbZs,45251
47
+ vellum/types/__init__.py,sha256=aXYiDbcBGEypul3Ae4DcgwNT55UtGftQsVxTPRpVAZU,45312
48
48
  vellum/types/api_node_result.py,sha256=aLOooryBCfglTeZwOuyyqRoHz5oPTja2mYYY7Gj8XxA,1040
49
49
  vellum/types/api_node_result_data.py,sha256=cQcZiwI1hjRvQFlkVEGxyaD360vEklIfjBmhBAeI75U,1215
50
50
  vellum/types/array_chat_message_content.py,sha256=Z7nKH8RNgot0i4-159w95OHywLjc-376gBPOovbw2hk,1087
@@ -108,7 +108,7 @@ vellum/types/fulfilled_execute_prompt_event.py,sha256=2_jNUOaSg12WKggFiczulVoHFM
108
108
  vellum/types/fulfilled_execute_prompt_response.py,sha256=LyVpUlphfBrqSWzo1QyIzdTjAJ8cgW60U98VnMd83ws,1508
109
109
  vellum/types/fulfilled_execute_workflow_workflow_result_event.py,sha256=ROLCpeU2FoqyisPDvgumUlYFDUbwOr93pEfII-ST3NI,1146
110
110
  vellum/types/fulfilled_function_call.py,sha256=wIk8JVy9HyjSbY7rPOhrXPh3OuKy3mtpUvPSOx2FcUc,1056
111
- vellum/types/fulfilled_prompt_execution_meta.py,sha256=_cDf859bAtbKHRt3cvdLHeuQi44CUqjUSYWITLBeubk,1196
111
+ vellum/types/fulfilled_prompt_execution_meta.py,sha256=FHivWXQbtMMoud9vMC4rc_ik1JWPZG6HfJOkuevCnCs,1285
112
112
  vellum/types/fulfilled_workflow_node_result_event.py,sha256=MGxts5L-VBaYP7xbL5ojjtKWEXUv45XSPqT7Y2RtvjI,1454
113
113
  vellum/types/function_call.py,sha256=U1_fLhZ_VGnHYPX8rb7iqyyUhBzzbRAGR-ai4wLDrs4,813
114
114
  vellum/types/function_call_chat_message_content.py,sha256=z9bTybrPXuhztOUw65PXGws-obJkCJWhc0Zfv1ZwA-k,1122
@@ -144,6 +144,7 @@ vellum/types/logprobs_enum.py,sha256=cw9yroKgrZzpPHniPV4hg7_21PM9_FSX1GArHHC_-_o
144
144
  vellum/types/metadata_filter_config_request.py,sha256=JH5EBNES30DuRIhgad6IYwXZcuAW6bRajSnWUqs4hG4,1412
145
145
  vellum/types/metadata_filter_rule_combinator.py,sha256=hmfQ3drGlGYqRA78iZr7ek8qZTFN-WENrwL3_OlexMM,528
146
146
  vellum/types/metadata_filter_rule_request.py,sha256=JGPkjXzMS9I3dlEQUAJ0HllJ3F-Znp-0x-4hp06miPs,1428
147
+ vellum/types/ml_model_usage.py,sha256=2o6Yy9lMDTqRHQNpUzQSoQMfA5_my79LA1pBZDcGLV0,1143
147
148
  vellum/types/model_version_build_config.py,sha256=0dOGfizN30eYJtjs-fJc32TUBGdpYuMFo57a_tEutSg,1400
148
149
  vellum/types/model_version_exec_config.py,sha256=tJJ1Kb8rBdbkD4z9fVwP94bjR9gee4I9N-i9o9w8vVs,1677
149
150
  vellum/types/model_version_exec_config_parameters.py,sha256=jF4wm_GIeITFavMNGSvBd-fa5v9fEjWxoHaZhVFx0CI,1326
@@ -187,9 +188,9 @@ vellum/types/paginated_test_suite_run_execution_list.py,sha256=pwT-FeIxOBnP_S3kp
187
188
  vellum/types/paginated_test_suite_test_case_list.py,sha256=0XlghGkiSubI41oR1UGSdYOKDUM4XLCgmcElKaYFdkA,1101
188
189
  vellum/types/processing_failure_reason_enum.py,sha256=MDj2vNyO1Y-2WHuolkrGez8F1cZqS6ultfsqvGI4Fg8,752
189
190
  vellum/types/processing_state_enum.py,sha256=rMhw5oLZNfhR4QkIgFfLMWRSLXgHt9qhiguEqWQNz5k,962
190
- vellum/types/prompt_deployment_expand_meta_request_request.py,sha256=jvi3NW0nJxyLwNEhk35oEdAm_aDOuy48eNy5LqvkkRs,1885
191
+ vellum/types/prompt_deployment_expand_meta_request_request.py,sha256=bpA4eO3wIwg5fZK89eoC8B8QsRrKFddIN69o04YEBPk,2083
191
192
  vellum/types/prompt_deployment_input_request.py,sha256=o8PCi7TsitddNxiAfDblxaXkJ1-WjuDTAW0LnKbMDY4,1233
192
- vellum/types/prompt_execution_meta.py,sha256=ix_1Wscqv3kthyyirFEjwY6xXYD5wuw0sdypyfb8hAo,1338
193
+ vellum/types/prompt_execution_meta.py,sha256=4RNkaZ2QjUtZwGUc9574Y4KuoZnzW2UCWj2RNiNiGKQ,1427
193
194
  vellum/types/prompt_node_result.py,sha256=s6jusFXMD1calmDVdL0lWO0NIqILWpdLP8xFRqf-5-k,1054
194
195
  vellum/types/prompt_node_result_data.py,sha256=q6y32EyaaAoIxM1od6-5RQAmPTitBQ-Hlkw5QNdeo6g,1045
195
196
  vellum/types/prompt_output.py,sha256=Df5UnLyBRf79_oUnYiMl9vi_h41yKEDLw1KgkgiX1Uk,1442
@@ -362,7 +363,7 @@ vellum/types/workflow_result_event_output_data_search_results.py,sha256=wYc76-DW
362
363
  vellum/types/workflow_result_event_output_data_string.py,sha256=7SR46tKt-I_cGd_eVeKU8ymQ7R3vKkA_dFHCgAU1GcQ,1533
363
364
  vellum/types/workflow_stream_event.py,sha256=KA6Bkk_XA6AIPWR-1vKnwF1A8l_Bm5y0arQCWWWRpsk,911
364
365
  vellum/version.py,sha256=neLt8HBHHUtDF9M5fsyUzHT-pKooEPvceaLDqqIGb0s,77
365
- vellum_ai-0.3.20.dist-info/LICENSE,sha256=CcaljEIoOBaU-wItPH4PmM_mDCGpyuUY0Er1BGu5Ti8,1073
366
- vellum_ai-0.3.20.dist-info/METADATA,sha256=lYn0SJcCZkYtLCFoarsT7BVerGQAFRPoWnzdCZsBlDY,3550
367
- vellum_ai-0.3.20.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
368
- vellum_ai-0.3.20.dist-info/RECORD,,
366
+ vellum_ai-0.3.21.dist-info/LICENSE,sha256=CcaljEIoOBaU-wItPH4PmM_mDCGpyuUY0Er1BGu5Ti8,1073
367
+ vellum_ai-0.3.21.dist-info/METADATA,sha256=BPMxESrgGDvdc1CRhBOdYCRugknRd_NwOR5D5NzmRI4,3550
368
+ vellum_ai-0.3.21.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
369
+ vellum_ai-0.3.21.dist-info/RECORD,,