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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. vellum/__init__.py +6 -0
  2. vellum/client.py +4 -0
  3. vellum/core/client_wrapper.py +1 -1
  4. vellum/resources/test_suite_runs/client.py +14 -0
  5. vellum/terraform/__init__.py +26 -0
  6. vellum/terraform/_jsii/__init__.py +27 -0
  7. vellum/terraform/_jsii/vellum-ai_vellum@0.0.0.jsii.tgz +0 -0
  8. vellum/terraform/constraints.json +4 -0
  9. vellum/terraform/data_vellum_document_index/__init__.py +409 -0
  10. vellum/terraform/document_index/__init__.py +490 -0
  11. vellum/terraform/provider/__init__.py +237 -0
  12. vellum/terraform/py.typed +1 -0
  13. vellum/terraform/versions.json +3 -0
  14. vellum/types/__init__.py +6 -0
  15. vellum/types/fulfilled_prompt_execution_meta.py +2 -0
  16. vellum/types/fulfilled_workflow_node_result_event.py +1 -1
  17. vellum/types/ml_model_usage.py +33 -0
  18. vellum/types/named_test_case_chat_history_variable_value_request.py +5 -1
  19. vellum/types/named_test_case_error_variable_value_request.py +5 -1
  20. vellum/types/named_test_case_json_variable_value_request.py +5 -1
  21. vellum/types/named_test_case_number_variable_value_request.py +5 -1
  22. vellum/types/named_test_case_search_results_variable_value_request.py +5 -1
  23. vellum/types/named_test_case_string_variable_value_request.py +5 -1
  24. vellum/types/prompt_deployment_expand_meta_request_request.py +5 -0
  25. vellum/types/prompt_execution_meta.py +2 -0
  26. vellum/types/prompt_template_block.py +2 -0
  27. vellum/types/prompt_template_block_request.py +2 -0
  28. vellum/types/prompt_template_block_state.py +22 -0
  29. vellum/types/test_suite_run_execution_chat_history_output.py +6 -1
  30. vellum/types/test_suite_run_execution_error_output.py +6 -1
  31. vellum/types/test_suite_run_execution_json_output.py +6 -1
  32. vellum/types/test_suite_run_execution_metric_definition.py +31 -0
  33. vellum/types/test_suite_run_execution_metric_result.py +3 -0
  34. vellum/types/test_suite_run_execution_number_output.py +6 -1
  35. vellum/types/test_suite_run_execution_search_results_output.py +6 -1
  36. vellum/types/test_suite_run_execution_string_output.py +6 -1
  37. {vellum_ai-0.3.20.dist-info → vellum_ai-0.3.22.dist-info}/METADATA +1 -1
  38. {vellum_ai-0.3.20.dist-info → vellum_ai-0.3.22.dist-info}/RECORD +40 -28
  39. {vellum_ai-0.3.20.dist-info → vellum_ai-0.3.22.dist-info}/LICENSE +0 -0
  40. {vellum_ai-0.3.20.dist-info → vellum_ai-0.3.22.dist-info}/WHEEL +0 -0
@@ -0,0 +1,237 @@
1
+ '''
2
+ # `provider`
3
+
4
+ Refer to the Terraform Registry for docs: [`vellum`](https://registry.terraform.io/providers/vellum-ai/vellum/0.0.2/docs).
5
+ '''
6
+ from pkgutil import extend_path
7
+ __path__ = extend_path(__path__, __name__)
8
+
9
+ import abc
10
+ import builtins
11
+ import datetime
12
+ import enum
13
+ import typing
14
+
15
+ import jsii
16
+ import publication
17
+ import typing_extensions
18
+
19
+ from typeguard import check_type
20
+
21
+ from .._jsii import *
22
+
23
+ import cdktf as _cdktf_9a9027ec
24
+ import constructs as _constructs_77d1e7e8
25
+
26
+
27
+ class VellumProvider(
28
+ _cdktf_9a9027ec.TerraformProvider,
29
+ metaclass=jsii.JSIIMeta,
30
+ jsii_type="vellum-ai_vellum.provider.VellumProvider",
31
+ ):
32
+ '''Represents a {@link https://registry.terraform.io/providers/vellum-ai/vellum/0.0.2/docs vellum}.'''
33
+
34
+ def __init__(
35
+ self,
36
+ scope: _constructs_77d1e7e8.Construct,
37
+ id: builtins.str,
38
+ *,
39
+ alias: typing.Optional[builtins.str] = None,
40
+ api_key: typing.Optional[builtins.str] = None,
41
+ ) -> None:
42
+ '''Create a new {@link https://registry.terraform.io/providers/vellum-ai/vellum/0.0.2/docs vellum} Resource.
43
+
44
+ :param scope: The scope in which to define this construct.
45
+ :param id: The scoped construct ID. Must be unique amongst siblings in the same scope
46
+ :param alias: Alias name. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/vellum-ai/vellum/0.0.2/docs#alias VellumProvider#alias}
47
+ :param api_key: API Key to authenticate with the Vellum API. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/vellum-ai/vellum/0.0.2/docs#api_key VellumProvider#api_key}
48
+ '''
49
+ if __debug__:
50
+ type_hints = typing.get_type_hints(_typecheckingstub__8f332a1b6664893e57a3554abbbfd334296d68a0c02222521351772fec263177)
51
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
52
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
53
+ config = VellumProviderConfig(alias=alias, api_key=api_key)
54
+
55
+ jsii.create(self.__class__, self, [scope, id, config])
56
+
57
+ @jsii.member(jsii_name="generateConfigForImport")
58
+ @builtins.classmethod
59
+ def generate_config_for_import(
60
+ cls,
61
+ scope: _constructs_77d1e7e8.Construct,
62
+ import_to_id: builtins.str,
63
+ import_from_id: builtins.str,
64
+ provider: typing.Optional[_cdktf_9a9027ec.TerraformProvider] = None,
65
+ ) -> _cdktf_9a9027ec.ImportableResource:
66
+ '''Generates CDKTF code for importing a VellumProvider resource upon running "cdktf plan ".
67
+
68
+ :param scope: The scope in which to define this construct.
69
+ :param import_to_id: The construct id used in the generated config for the VellumProvider to import.
70
+ :param import_from_id: The id of the existing VellumProvider that should be imported. Refer to the {@link https://registry.terraform.io/providers/vellum-ai/vellum/0.0.2/docs#import import section} in the documentation of this resource for the id to use
71
+ :param provider: ? Optional instance of the provider where the VellumProvider to import is found.
72
+ '''
73
+ if __debug__:
74
+ type_hints = typing.get_type_hints(_typecheckingstub__43f598a9f664a05d63c3b7644f2981a0397df03284b98ca077e6d7265f6aebcb)
75
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
76
+ check_type(argname="argument import_to_id", value=import_to_id, expected_type=type_hints["import_to_id"])
77
+ check_type(argname="argument import_from_id", value=import_from_id, expected_type=type_hints["import_from_id"])
78
+ check_type(argname="argument provider", value=provider, expected_type=type_hints["provider"])
79
+ return typing.cast(_cdktf_9a9027ec.ImportableResource, jsii.sinvoke(cls, "generateConfigForImport", [scope, import_to_id, import_from_id, provider]))
80
+
81
+ @jsii.member(jsii_name="resetAlias")
82
+ def reset_alias(self) -> None:
83
+ return typing.cast(None, jsii.invoke(self, "resetAlias", []))
84
+
85
+ @jsii.member(jsii_name="resetApiKey")
86
+ def reset_api_key(self) -> None:
87
+ return typing.cast(None, jsii.invoke(self, "resetApiKey", []))
88
+
89
+ @jsii.member(jsii_name="synthesizeAttributes")
90
+ def _synthesize_attributes(self) -> typing.Mapping[builtins.str, typing.Any]:
91
+ return typing.cast(typing.Mapping[builtins.str, typing.Any], jsii.invoke(self, "synthesizeAttributes", []))
92
+
93
+ @jsii.member(jsii_name="synthesizeHclAttributes")
94
+ def _synthesize_hcl_attributes(self) -> typing.Mapping[builtins.str, typing.Any]:
95
+ return typing.cast(typing.Mapping[builtins.str, typing.Any], jsii.invoke(self, "synthesizeHclAttributes", []))
96
+
97
+ @jsii.python.classproperty
98
+ @jsii.member(jsii_name="tfResourceType")
99
+ def TF_RESOURCE_TYPE(cls) -> builtins.str:
100
+ return typing.cast(builtins.str, jsii.sget(cls, "tfResourceType"))
101
+
102
+ @builtins.property
103
+ @jsii.member(jsii_name="aliasInput")
104
+ def alias_input(self) -> typing.Optional[builtins.str]:
105
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "aliasInput"))
106
+
107
+ @builtins.property
108
+ @jsii.member(jsii_name="apiKeyInput")
109
+ def api_key_input(self) -> typing.Optional[builtins.str]:
110
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "apiKeyInput"))
111
+
112
+ @builtins.property
113
+ @jsii.member(jsii_name="alias")
114
+ def alias(self) -> typing.Optional[builtins.str]:
115
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "alias"))
116
+
117
+ @alias.setter
118
+ def alias(self, value: typing.Optional[builtins.str]) -> None:
119
+ if __debug__:
120
+ type_hints = typing.get_type_hints(_typecheckingstub__15a78e7b117167a258d082de10d77ec8038e1f5fcc5ff5ef0caadbce4dec2c02)
121
+ check_type(argname="argument value", value=value, expected_type=type_hints["value"])
122
+ jsii.set(self, "alias", value)
123
+
124
+ @builtins.property
125
+ @jsii.member(jsii_name="apiKey")
126
+ def api_key(self) -> typing.Optional[builtins.str]:
127
+ return typing.cast(typing.Optional[builtins.str], jsii.get(self, "apiKey"))
128
+
129
+ @api_key.setter
130
+ def api_key(self, value: typing.Optional[builtins.str]) -> None:
131
+ if __debug__:
132
+ type_hints = typing.get_type_hints(_typecheckingstub__402b9018cf60ba05eb9ab72153d7f52235bd10a5f5615a074a53880068a8779b)
133
+ check_type(argname="argument value", value=value, expected_type=type_hints["value"])
134
+ jsii.set(self, "apiKey", value)
135
+
136
+
137
+ @jsii.data_type(
138
+ jsii_type="vellum-ai_vellum.provider.VellumProviderConfig",
139
+ jsii_struct_bases=[],
140
+ name_mapping={"alias": "alias", "api_key": "apiKey"},
141
+ )
142
+ class VellumProviderConfig:
143
+ def __init__(
144
+ self,
145
+ *,
146
+ alias: typing.Optional[builtins.str] = None,
147
+ api_key: typing.Optional[builtins.str] = None,
148
+ ) -> None:
149
+ '''
150
+ :param alias: Alias name. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/vellum-ai/vellum/0.0.2/docs#alias VellumProvider#alias}
151
+ :param api_key: API Key to authenticate with the Vellum API. Docs at Terraform Registry: {@link https://registry.terraform.io/providers/vellum-ai/vellum/0.0.2/docs#api_key VellumProvider#api_key}
152
+ '''
153
+ if __debug__:
154
+ type_hints = typing.get_type_hints(_typecheckingstub__bb8c32f1d43f1344224f7a690abc6e2489c4dff67cb93921483ed2cc4b5410e1)
155
+ check_type(argname="argument alias", value=alias, expected_type=type_hints["alias"])
156
+ check_type(argname="argument api_key", value=api_key, expected_type=type_hints["api_key"])
157
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
158
+ if alias is not None:
159
+ self._values["alias"] = alias
160
+ if api_key is not None:
161
+ self._values["api_key"] = api_key
162
+
163
+ @builtins.property
164
+ def alias(self) -> typing.Optional[builtins.str]:
165
+ '''Alias name.
166
+
167
+ Docs at Terraform Registry: {@link https://registry.terraform.io/providers/vellum-ai/vellum/0.0.2/docs#alias VellumProvider#alias}
168
+ '''
169
+ result = self._values.get("alias")
170
+ return typing.cast(typing.Optional[builtins.str], result)
171
+
172
+ @builtins.property
173
+ def api_key(self) -> typing.Optional[builtins.str]:
174
+ '''API Key to authenticate with the Vellum API.
175
+
176
+ Docs at Terraform Registry: {@link https://registry.terraform.io/providers/vellum-ai/vellum/0.0.2/docs#api_key VellumProvider#api_key}
177
+ '''
178
+ result = self._values.get("api_key")
179
+ return typing.cast(typing.Optional[builtins.str], result)
180
+
181
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
182
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
183
+
184
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
185
+ return not (rhs == self)
186
+
187
+ def __repr__(self) -> str:
188
+ return "VellumProviderConfig(%s)" % ", ".join(
189
+ k + "=" + repr(v) for k, v in self._values.items()
190
+ )
191
+
192
+
193
+ __all__ = [
194
+ "VellumProvider",
195
+ "VellumProviderConfig",
196
+ ]
197
+
198
+ publication.publish()
199
+
200
+ def _typecheckingstub__8f332a1b6664893e57a3554abbbfd334296d68a0c02222521351772fec263177(
201
+ scope: _constructs_77d1e7e8.Construct,
202
+ id: builtins.str,
203
+ *,
204
+ alias: typing.Optional[builtins.str] = None,
205
+ api_key: typing.Optional[builtins.str] = None,
206
+ ) -> None:
207
+ """Type checking stubs"""
208
+ pass
209
+
210
+ def _typecheckingstub__43f598a9f664a05d63c3b7644f2981a0397df03284b98ca077e6d7265f6aebcb(
211
+ scope: _constructs_77d1e7e8.Construct,
212
+ import_to_id: builtins.str,
213
+ import_from_id: builtins.str,
214
+ provider: typing.Optional[_cdktf_9a9027ec.TerraformProvider] = None,
215
+ ) -> None:
216
+ """Type checking stubs"""
217
+ pass
218
+
219
+ def _typecheckingstub__15a78e7b117167a258d082de10d77ec8038e1f5fcc5ff5ef0caadbce4dec2c02(
220
+ value: typing.Optional[builtins.str],
221
+ ) -> None:
222
+ """Type checking stubs"""
223
+ pass
224
+
225
+ def _typecheckingstub__402b9018cf60ba05eb9ab72153d7f52235bd10a5f5615a074a53880068a8779b(
226
+ value: typing.Optional[builtins.str],
227
+ ) -> None:
228
+ """Type checking stubs"""
229
+ pass
230
+
231
+ def _typecheckingstub__bb8c32f1d43f1344224f7a690abc6e2489c4dff67cb93921483ed2cc4b5410e1(
232
+ *,
233
+ alias: typing.Optional[builtins.str] = None,
234
+ api_key: typing.Optional[builtins.str] = None,
235
+ ) -> None:
236
+ """Type checking stubs"""
237
+ pass
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,3 @@
1
+ {
2
+ "registry.terraform.io/vellum-ai/vellum": "0.0.2"
3
+ }
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
@@ -259,6 +260,7 @@ from .prompt_template_block_data_request import PromptTemplateBlockDataRequest
259
260
  from .prompt_template_block_properties import PromptTemplateBlockProperties
260
261
  from .prompt_template_block_properties_request import PromptTemplateBlockPropertiesRequest
261
262
  from .prompt_template_block_request import PromptTemplateBlockRequest
263
+ from .prompt_template_block_state import PromptTemplateBlockState
262
264
  from .provider_enum import ProviderEnum
263
265
  from .raw_prompt_execution_overrides_request import RawPromptExecutionOverridesRequest
264
266
  from .register_prompt_error_response import RegisterPromptErrorResponse
@@ -398,6 +400,7 @@ from .test_suite_run_execution import TestSuiteRunExecution
398
400
  from .test_suite_run_execution_chat_history_output import TestSuiteRunExecutionChatHistoryOutput
399
401
  from .test_suite_run_execution_error_output import TestSuiteRunExecutionErrorOutput
400
402
  from .test_suite_run_execution_json_output import TestSuiteRunExecutionJsonOutput
403
+ from .test_suite_run_execution_metric_definition import TestSuiteRunExecutionMetricDefinition
401
404
  from .test_suite_run_execution_metric_result import TestSuiteRunExecutionMetricResult
402
405
  from .test_suite_run_execution_number_output import TestSuiteRunExecutionNumberOutput
403
406
  from .test_suite_run_execution_output import (
@@ -673,6 +676,7 @@ __all__ = [
673
676
  "MetadataFilterConfigRequest",
674
677
  "MetadataFilterRuleCombinator",
675
678
  "MetadataFilterRuleRequest",
679
+ "MlModelUsage",
676
680
  "ModelVersionBuildConfig",
677
681
  "ModelVersionExecConfig",
678
682
  "ModelVersionExecConfigParameters",
@@ -757,6 +761,7 @@ __all__ = [
757
761
  "PromptTemplateBlockProperties",
758
762
  "PromptTemplateBlockPropertiesRequest",
759
763
  "PromptTemplateBlockRequest",
764
+ "PromptTemplateBlockState",
760
765
  "ProviderEnum",
761
766
  "RawPromptExecutionOverridesRequest",
762
767
  "RegisterPromptErrorResponse",
@@ -880,6 +885,7 @@ __all__ = [
880
885
  "TestSuiteRunExecutionChatHistoryOutput",
881
886
  "TestSuiteRunExecutionErrorOutput",
882
887
  "TestSuiteRunExecutionJsonOutput",
888
+ "TestSuiteRunExecutionMetricDefinition",
883
889
  "TestSuiteRunExecutionMetricResult",
884
890
  "TestSuiteRunExecutionNumberOutput",
885
891
  "TestSuiteRunExecutionOutput",
@@ -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}
@@ -24,7 +24,7 @@ class FulfilledWorkflowNodeResultEvent(pydantic.BaseModel):
24
24
  ts: typing.Optional[dt.datetime] = None
25
25
  data: typing.Optional[WorkflowNodeResultData] = None
26
26
  source_execution_id: typing.Optional[str] = None
27
- output_values: typing.Optional[typing.List[NodeOutputCompiledValue]] = None
27
+ output_values: typing.List[NodeOutputCompiledValue]
28
28
  mocked: typing.Optional[bool] = None
29
29
 
30
30
  def json(self, **kwargs: typing.Any) -> str:
@@ -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}
@@ -13,8 +13,12 @@ except ImportError:
13
13
 
14
14
 
15
15
  class NamedTestCaseChatHistoryVariableValueRequest(pydantic.BaseModel):
16
- name: str
16
+ """
17
+ Named Test Case value that is of type CHAT_HISTORY
18
+ """
19
+
17
20
  value: typing.Optional[typing.List[ChatMessageRequest]] = None
21
+ name: str
18
22
 
19
23
  def json(self, **kwargs: typing.Any) -> str:
20
24
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -13,8 +13,12 @@ except ImportError:
13
13
 
14
14
 
15
15
  class NamedTestCaseErrorVariableValueRequest(pydantic.BaseModel):
16
- name: str
16
+ """
17
+ Named Test Case value that is of type ERROR
18
+ """
19
+
17
20
  value: typing.Optional[VellumErrorRequest] = None
21
+ name: str
18
22
 
19
23
  def json(self, **kwargs: typing.Any) -> str:
20
24
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -12,8 +12,12 @@ except ImportError:
12
12
 
13
13
 
14
14
  class NamedTestCaseJsonVariableValueRequest(pydantic.BaseModel):
15
- name: str
15
+ """
16
+ Named Test Case value that is of type JSON
17
+ """
18
+
16
19
  value: typing.Optional[typing.Dict[str, typing.Any]] = None
20
+ name: str
17
21
 
18
22
  def json(self, **kwargs: typing.Any) -> str:
19
23
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -12,8 +12,12 @@ except ImportError:
12
12
 
13
13
 
14
14
  class NamedTestCaseNumberVariableValueRequest(pydantic.BaseModel):
15
- name: str
15
+ """
16
+ Named Test Case value that is of type NUMBER
17
+ """
18
+
16
19
  value: typing.Optional[float] = None
20
+ name: str
17
21
 
18
22
  def json(self, **kwargs: typing.Any) -> str:
19
23
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -13,8 +13,12 @@ except ImportError:
13
13
 
14
14
 
15
15
  class NamedTestCaseSearchResultsVariableValueRequest(pydantic.BaseModel):
16
- name: str
16
+ """
17
+ Named Test Case value that is of type SEARCH_RESULTS
18
+ """
19
+
17
20
  value: typing.Optional[typing.List[SearchResultRequest]] = None
21
+ name: str
18
22
 
19
23
  def json(self, **kwargs: typing.Any) -> str:
20
24
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -12,8 +12,12 @@ except ImportError:
12
12
 
13
13
 
14
14
  class NamedTestCaseStringVariableValueRequest(pydantic.BaseModel):
15
- name: str
15
+ """
16
+ Named Test Case value that is of type STRING
17
+ """
18
+
16
19
  value: typing.Optional[str] = None
20
+ name: str
17
21
 
18
22
  def json(self, **kwargs: typing.Any) -> str:
19
23
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -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
@@ -7,6 +7,7 @@ import typing
7
7
 
8
8
  from ..core.datetime_utils import serialize_datetime
9
9
  from .block_type_enum import BlockTypeEnum
10
+ from .prompt_template_block_state import PromptTemplateBlockState
10
11
 
11
12
  try:
12
13
  import pydantic.v1 as pydantic # type: ignore
@@ -18,6 +19,7 @@ class PromptTemplateBlock(pydantic.BaseModel):
18
19
  id: str
19
20
  block_type: BlockTypeEnum
20
21
  properties: PromptTemplateBlockProperties
22
+ state: typing.Optional[PromptTemplateBlockState] = None
21
23
 
22
24
  def json(self, **kwargs: typing.Any) -> str:
23
25
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -7,6 +7,7 @@ import typing
7
7
 
8
8
  from ..core.datetime_utils import serialize_datetime
9
9
  from .block_type_enum import BlockTypeEnum
10
+ from .prompt_template_block_state import PromptTemplateBlockState
10
11
 
11
12
  try:
12
13
  import pydantic.v1 as pydantic # type: ignore
@@ -18,6 +19,7 @@ class PromptTemplateBlockRequest(pydantic.BaseModel):
18
19
  id: str
19
20
  block_type: BlockTypeEnum
20
21
  properties: PromptTemplateBlockPropertiesRequest
22
+ state: typing.Optional[PromptTemplateBlockState] = None
21
23
 
22
24
  def json(self, **kwargs: typing.Any) -> str:
23
25
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -0,0 +1,22 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import enum
4
+ import typing
5
+
6
+ T_Result = typing.TypeVar("T_Result")
7
+
8
+
9
+ class PromptTemplateBlockState(str, enum.Enum):
10
+ """
11
+ - `ENABLED` - ENABLED
12
+ - `DISABLED` - DISABLED
13
+ """
14
+
15
+ ENABLED = "ENABLED"
16
+ DISABLED = "DISABLED"
17
+
18
+ def visit(self, enabled: typing.Callable[[], T_Result], disabled: typing.Callable[[], T_Result]) -> T_Result:
19
+ if self is PromptTemplateBlockState.ENABLED:
20
+ return enabled()
21
+ if self is PromptTemplateBlockState.DISABLED:
22
+ return disabled()
@@ -13,8 +13,13 @@ except ImportError:
13
13
 
14
14
 
15
15
  class TestSuiteRunExecutionChatHistoryOutput(pydantic.BaseModel):
16
- output_variable_id: str
16
+ """
17
+ Execution output of an entity evaluated during a Test Suite Run that is of type CHAT_HISTORY
18
+ """
19
+
20
+ name: str
17
21
  value: typing.Optional[typing.List[ChatMessage]] = None
22
+ output_variable_id: str
18
23
 
19
24
  def json(self, **kwargs: typing.Any) -> str:
20
25
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -13,8 +13,13 @@ except ImportError:
13
13
 
14
14
 
15
15
  class TestSuiteRunExecutionErrorOutput(pydantic.BaseModel):
16
- output_variable_id: str
16
+ """
17
+ Execution output of an entity evaluated during a Test Suite Run that is of type ERROR
18
+ """
19
+
20
+ name: str
17
21
  value: typing.Optional[VellumError] = None
22
+ output_variable_id: str
18
23
 
19
24
  def json(self, **kwargs: typing.Any) -> str:
20
25
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -12,8 +12,13 @@ except ImportError:
12
12
 
13
13
 
14
14
  class TestSuiteRunExecutionJsonOutput(pydantic.BaseModel):
15
- output_variable_id: str
15
+ """
16
+ Execution output of an entity evaluated during a Test Suite Run that is of type JSON
17
+ """
18
+
19
+ name: str
16
20
  value: typing.Optional[typing.Dict[str, typing.Any]] = None
21
+ output_variable_id: str
17
22
 
18
23
  def json(self, **kwargs: typing.Any) -> str:
19
24
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -0,0 +1,31 @@
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 TestSuiteRunExecutionMetricDefinition(pydantic.BaseModel):
15
+ id: typing.Optional[str] = None
16
+ label: typing.Optional[str] = None
17
+ name: typing.Optional[str] = None
18
+
19
+ def json(self, **kwargs: typing.Any) -> str:
20
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
21
+ return super().json(**kwargs_with_defaults)
22
+
23
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
24
+ kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
25
+ return super().dict(**kwargs_with_defaults)
26
+
27
+ class Config:
28
+ frozen = True
29
+ smart_union = True
30
+ extra = pydantic.Extra.allow
31
+ json_encoders = {dt.datetime: serialize_datetime}
@@ -4,6 +4,7 @@ import datetime as dt
4
4
  import typing
5
5
 
6
6
  from ..core.datetime_utils import serialize_datetime
7
+ from .test_suite_run_execution_metric_definition import TestSuiteRunExecutionMetricDefinition
7
8
  from .test_suite_run_metric_output import TestSuiteRunMetricOutput
8
9
 
9
10
  try:
@@ -15,6 +16,8 @@ except ImportError:
15
16
  class TestSuiteRunExecutionMetricResult(pydantic.BaseModel):
16
17
  metric_id: str
17
18
  outputs: typing.List[TestSuiteRunMetricOutput]
19
+ metric_label: typing.Optional[str] = None
20
+ metric_definition: typing.Optional[TestSuiteRunExecutionMetricDefinition] = None
18
21
 
19
22
  def json(self, **kwargs: typing.Any) -> str:
20
23
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -12,8 +12,13 @@ except ImportError:
12
12
 
13
13
 
14
14
  class TestSuiteRunExecutionNumberOutput(pydantic.BaseModel):
15
- output_variable_id: str
15
+ """
16
+ Execution output of an entity evaluated during a Test Suite Run that is of type NUMBER
17
+ """
18
+
19
+ name: str
16
20
  value: typing.Optional[float] = None
21
+ output_variable_id: str
17
22
 
18
23
  def json(self, **kwargs: typing.Any) -> str:
19
24
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
@@ -13,8 +13,13 @@ except ImportError:
13
13
 
14
14
 
15
15
  class TestSuiteRunExecutionSearchResultsOutput(pydantic.BaseModel):
16
- output_variable_id: str
16
+ """
17
+ Execution output of an entity evaluated during a Test Suite Run that is of type SEARCH_RESULTS
18
+ """
19
+
20
+ name: str
17
21
  value: typing.Optional[typing.List[SearchResult]] = None
22
+ output_variable_id: str
18
23
 
19
24
  def json(self, **kwargs: typing.Any) -> str:
20
25
  kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}