vellum-ai 0.9.11__py3-none-any.whl → 0.9.13__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- vellum/__init__.py +28 -22
- vellum/client.py +20 -20
- vellum/core/client_wrapper.py +1 -1
- vellum/resources/ad_hoc/client.py +39 -2
- vellum/resources/metric_definitions/client.py +11 -11
- vellum/types/__init__.py +28 -22
- vellum/types/{array_input_request.py → array_input.py} +5 -5
- vellum/types/chat_history_input.py +30 -0
- vellum/types/{code_execution_package_request.py → code_execution_package.py} +1 -1
- vellum/types/code_executor_input.py +24 -0
- vellum/types/{code_executor_secret_input_request.py → code_executor_secret_input.py} +1 -1
- vellum/types/document_processing_state.py +7 -0
- vellum/types/document_read.py +2 -11
- vellum/types/{error_input_request.py → error_input.py} +3 -3
- vellum/types/{function_call_input_request.py → function_call_input.py} +3 -3
- vellum/types/{function_definition_prompt_block.py → function_definition.py} +6 -7
- vellum/types/json_input.py +29 -0
- vellum/types/metric_definition_input.py +9 -0
- vellum/types/{number_input_request.py → number_input.py} +1 -1
- vellum/types/prompt_block.py +1 -4
- vellum/types/{search_results_input_request.py → search_results_input.py} +3 -3
- vellum/types/slim_document.py +2 -11
- vellum/types/string_input.py +29 -0
- vellum/types/vellum_error_code_enum.py +6 -1
- {vellum_ai-0.9.11.dist-info → vellum_ai-0.9.13.dist-info}/METADATA +1 -1
- {vellum_ai-0.9.11.dist-info → vellum_ai-0.9.13.dist-info}/RECORD +28 -25
- vellum/types/code_executor_input_request.py +0 -24
- vellum/types/metric_definition_input_request.py +0 -11
- vellum/types/processing_state_enum.py +0 -5
- {vellum_ai-0.9.11.dist-info → vellum_ai-0.9.13.dist-info}/LICENSE +0 -0
- {vellum_ai-0.9.11.dist-info → vellum_ai-0.9.13.dist-info}/WHEEL +0 -0
vellum/__init__.py
CHANGED
@@ -14,7 +14,7 @@ from .types import (
|
|
14
14
|
ArrayChatMessageContentItem,
|
15
15
|
ArrayChatMessageContentItemRequest,
|
16
16
|
ArrayChatMessageContentRequest,
|
17
|
-
|
17
|
+
ArrayInput,
|
18
18
|
ArrayVariableValue,
|
19
19
|
ArrayVariableValueItem,
|
20
20
|
ArrayVellumValue,
|
@@ -30,6 +30,7 @@ from .types import (
|
|
30
30
|
BasicVectorizerSentenceTransformersMultiQaMpnetBaseCosV1Request,
|
31
31
|
BasicVectorizerSentenceTransformersMultiQaMpnetBaseDotV1,
|
32
32
|
BasicVectorizerSentenceTransformersMultiQaMpnetBaseDotV1Request,
|
33
|
+
ChatHistoryInput,
|
33
34
|
ChatHistoryInputRequest,
|
34
35
|
ChatHistoryVariableValue,
|
35
36
|
ChatHistoryVellumValue,
|
@@ -51,11 +52,11 @@ from .types import (
|
|
51
52
|
CodeExecutionNodeResultOutput,
|
52
53
|
CodeExecutionNodeSearchResultsResult,
|
53
54
|
CodeExecutionNodeStringResult,
|
54
|
-
|
55
|
+
CodeExecutionPackage,
|
55
56
|
CodeExecutionRuntime,
|
56
|
-
|
57
|
+
CodeExecutorInput,
|
57
58
|
CodeExecutorResponse,
|
58
|
-
|
59
|
+
CodeExecutorSecretInput,
|
59
60
|
CompilePromptDeploymentExpandMetaRequest,
|
60
61
|
CompilePromptMeta,
|
61
62
|
ComponentsSchemasPdfSearchResultMetaSource,
|
@@ -77,6 +78,7 @@ from .types import (
|
|
77
78
|
DocumentIndexIndexingConfig,
|
78
79
|
DocumentIndexIndexingConfigRequest,
|
79
80
|
DocumentIndexRead,
|
81
|
+
DocumentProcessingState,
|
80
82
|
DocumentRead,
|
81
83
|
DocumentStatus,
|
82
84
|
EnrichedNormalizedCompletion,
|
@@ -85,7 +87,7 @@ from .types import (
|
|
85
87
|
EnvironmentEnum,
|
86
88
|
EphemeralPromptCacheConfig,
|
87
89
|
EphemeralPromptCacheConfigTypeEnum,
|
88
|
-
|
90
|
+
ErrorInput,
|
89
91
|
ErrorVariableValue,
|
90
92
|
ErrorVellumValue,
|
91
93
|
ErrorVellumValueRequest,
|
@@ -128,12 +130,12 @@ from .types import (
|
|
128
130
|
FunctionCallChatMessageContentRequest,
|
129
131
|
FunctionCallChatMessageContentValue,
|
130
132
|
FunctionCallChatMessageContentValueRequest,
|
131
|
-
|
133
|
+
FunctionCallInput,
|
132
134
|
FunctionCallRequest,
|
133
135
|
FunctionCallVariableValue,
|
134
136
|
FunctionCallVellumValue,
|
135
137
|
FunctionCallVellumValueRequest,
|
136
|
-
|
138
|
+
FunctionDefinition,
|
137
139
|
GenerateOptionsRequest,
|
138
140
|
GenerateRequest,
|
139
141
|
GenerateResponse,
|
@@ -167,6 +169,7 @@ from .types import (
|
|
167
169
|
InstructorVectorizerConfigRequest,
|
168
170
|
IterationStateEnum,
|
169
171
|
JinjaPromptBlock,
|
172
|
+
JsonInput,
|
170
173
|
JsonInputRequest,
|
171
174
|
JsonVariableValue,
|
172
175
|
JsonVellumValue,
|
@@ -182,7 +185,7 @@ from .types import (
|
|
182
185
|
MetadataFilterRuleRequest,
|
183
186
|
MetadataFiltersRequest,
|
184
187
|
MetricDefinitionExecution,
|
185
|
-
|
188
|
+
MetricDefinitionInput,
|
186
189
|
MetricNodeResult,
|
187
190
|
MlModelUsage,
|
188
191
|
NamedScenarioInputChatHistoryVariableValueRequest,
|
@@ -227,7 +230,7 @@ from .types import (
|
|
227
230
|
NodeOutputCompiledValue,
|
228
231
|
NormalizedLogProbs,
|
229
232
|
NormalizedTokenLogProbs,
|
230
|
-
|
233
|
+
NumberInput,
|
231
234
|
NumberVariableValue,
|
232
235
|
NumberVellumValue,
|
233
236
|
NumberVellumValueRequest,
|
@@ -254,7 +257,6 @@ from .types import (
|
|
254
257
|
PlainTextPromptBlock,
|
255
258
|
Price,
|
256
259
|
ProcessingFailureReasonEnum,
|
257
|
-
ProcessingStateEnum,
|
258
260
|
PromptBlock,
|
259
261
|
PromptBlockState,
|
260
262
|
PromptDeploymentExpandMetaRequest,
|
@@ -302,7 +304,7 @@ from .types import (
|
|
302
304
|
SearchResultMeta,
|
303
305
|
SearchResultMetaRequest,
|
304
306
|
SearchResultRequest,
|
305
|
-
|
307
|
+
SearchResultsInput,
|
306
308
|
SearchResultsVariableValue,
|
307
309
|
SearchResultsVellumValue,
|
308
310
|
SearchResultsVellumValueRequest,
|
@@ -321,6 +323,7 @@ from .types import (
|
|
321
323
|
StreamingWorkflowNodeResultEvent,
|
322
324
|
StringChatMessageContent,
|
323
325
|
StringChatMessageContentRequest,
|
326
|
+
StringInput,
|
324
327
|
StringInputRequest,
|
325
328
|
StringVariableValue,
|
326
329
|
StringVellumValue,
|
@@ -520,7 +523,7 @@ __all__ = [
|
|
520
523
|
"ArrayChatMessageContentItem",
|
521
524
|
"ArrayChatMessageContentItemRequest",
|
522
525
|
"ArrayChatMessageContentRequest",
|
523
|
-
"
|
526
|
+
"ArrayInput",
|
524
527
|
"ArrayVariableValue",
|
525
528
|
"ArrayVariableValueItem",
|
526
529
|
"ArrayVellumValue",
|
@@ -538,6 +541,7 @@ __all__ = [
|
|
538
541
|
"BasicVectorizerSentenceTransformersMultiQaMpnetBaseCosV1Request",
|
539
542
|
"BasicVectorizerSentenceTransformersMultiQaMpnetBaseDotV1",
|
540
543
|
"BasicVectorizerSentenceTransformersMultiQaMpnetBaseDotV1Request",
|
544
|
+
"ChatHistoryInput",
|
541
545
|
"ChatHistoryInputRequest",
|
542
546
|
"ChatHistoryVariableValue",
|
543
547
|
"ChatHistoryVellumValue",
|
@@ -559,11 +563,11 @@ __all__ = [
|
|
559
563
|
"CodeExecutionNodeResultOutput",
|
560
564
|
"CodeExecutionNodeSearchResultsResult",
|
561
565
|
"CodeExecutionNodeStringResult",
|
562
|
-
"
|
566
|
+
"CodeExecutionPackage",
|
563
567
|
"CodeExecutionRuntime",
|
564
|
-
"
|
568
|
+
"CodeExecutorInput",
|
565
569
|
"CodeExecutorResponse",
|
566
|
-
"
|
570
|
+
"CodeExecutorSecretInput",
|
567
571
|
"CompilePromptDeploymentExpandMetaRequest",
|
568
572
|
"CompilePromptMeta",
|
569
573
|
"ComponentsSchemasPdfSearchResultMetaSource",
|
@@ -587,6 +591,7 @@ __all__ = [
|
|
587
591
|
"DocumentIndexIndexingConfigRequest",
|
588
592
|
"DocumentIndexRead",
|
589
593
|
"DocumentIndexesListRequestStatus",
|
594
|
+
"DocumentProcessingState",
|
590
595
|
"DocumentRead",
|
591
596
|
"DocumentStatus",
|
592
597
|
"EnrichedNormalizedCompletion",
|
@@ -595,7 +600,7 @@ __all__ = [
|
|
595
600
|
"EnvironmentEnum",
|
596
601
|
"EphemeralPromptCacheConfig",
|
597
602
|
"EphemeralPromptCacheConfigTypeEnum",
|
598
|
-
"
|
603
|
+
"ErrorInput",
|
599
604
|
"ErrorVariableValue",
|
600
605
|
"ErrorVellumValue",
|
601
606
|
"ErrorVellumValueRequest",
|
@@ -640,12 +645,12 @@ __all__ = [
|
|
640
645
|
"FunctionCallChatMessageContentRequest",
|
641
646
|
"FunctionCallChatMessageContentValue",
|
642
647
|
"FunctionCallChatMessageContentValueRequest",
|
643
|
-
"
|
648
|
+
"FunctionCallInput",
|
644
649
|
"FunctionCallRequest",
|
645
650
|
"FunctionCallVariableValue",
|
646
651
|
"FunctionCallVellumValue",
|
647
652
|
"FunctionCallVellumValueRequest",
|
648
|
-
"
|
653
|
+
"FunctionDefinition",
|
649
654
|
"GenerateOptionsRequest",
|
650
655
|
"GenerateRequest",
|
651
656
|
"GenerateResponse",
|
@@ -680,6 +685,7 @@ __all__ = [
|
|
680
685
|
"InternalServerError",
|
681
686
|
"IterationStateEnum",
|
682
687
|
"JinjaPromptBlock",
|
688
|
+
"JsonInput",
|
683
689
|
"JsonInputRequest",
|
684
690
|
"JsonVariableValue",
|
685
691
|
"JsonVellumValue",
|
@@ -697,7 +703,7 @@ __all__ = [
|
|
697
703
|
"MetadataFilterRuleRequest",
|
698
704
|
"MetadataFiltersRequest",
|
699
705
|
"MetricDefinitionExecution",
|
700
|
-
"
|
706
|
+
"MetricDefinitionInput",
|
701
707
|
"MetricNodeResult",
|
702
708
|
"MlModelUsage",
|
703
709
|
"NamedScenarioInputChatHistoryVariableValueRequest",
|
@@ -743,7 +749,7 @@ __all__ = [
|
|
743
749
|
"NormalizedLogProbs",
|
744
750
|
"NormalizedTokenLogProbs",
|
745
751
|
"NotFoundError",
|
746
|
-
"
|
752
|
+
"NumberInput",
|
747
753
|
"NumberVariableValue",
|
748
754
|
"NumberVellumValue",
|
749
755
|
"NumberVellumValueRequest",
|
@@ -770,7 +776,6 @@ __all__ = [
|
|
770
776
|
"PlainTextPromptBlock",
|
771
777
|
"Price",
|
772
778
|
"ProcessingFailureReasonEnum",
|
773
|
-
"ProcessingStateEnum",
|
774
779
|
"PromptBlock",
|
775
780
|
"PromptBlockState",
|
776
781
|
"PromptDeploymentExpandMetaRequest",
|
@@ -818,7 +823,7 @@ __all__ = [
|
|
818
823
|
"SearchResultMeta",
|
819
824
|
"SearchResultMetaRequest",
|
820
825
|
"SearchResultRequest",
|
821
|
-
"
|
826
|
+
"SearchResultsInput",
|
822
827
|
"SearchResultsVariableValue",
|
823
828
|
"SearchResultsVellumValue",
|
824
829
|
"SearchResultsVellumValueRequest",
|
@@ -837,6 +842,7 @@ __all__ = [
|
|
837
842
|
"StreamingWorkflowNodeResultEvent",
|
838
843
|
"StringChatMessageContent",
|
839
844
|
"StringChatMessageContentRequest",
|
845
|
+
"StringInput",
|
840
846
|
"StringInputRequest",
|
841
847
|
"StringVariableValue",
|
842
848
|
"StringVellumValue",
|
vellum/client.py
CHANGED
@@ -19,8 +19,8 @@ from .resources.workflow_sandboxes.client import WorkflowSandboxesClient
|
|
19
19
|
from .resources.workflows.client import WorkflowsClient
|
20
20
|
from .resources.workspace_secrets.client import WorkspaceSecretsClient
|
21
21
|
from .types.code_execution_runtime import CodeExecutionRuntime
|
22
|
-
from .types.
|
23
|
-
from .types.
|
22
|
+
from .types.code_executor_input import CodeExecutorInput
|
23
|
+
from .types.code_execution_package import CodeExecutionPackage
|
24
24
|
from .types.vellum_variable_type import VellumVariableType
|
25
25
|
from .core.request_options import RequestOptions
|
26
26
|
from .types.code_executor_response import CodeExecutorResponse
|
@@ -145,8 +145,8 @@ class Vellum:
|
|
145
145
|
*,
|
146
146
|
code: str,
|
147
147
|
runtime: CodeExecutionRuntime,
|
148
|
-
input_values: typing.Sequence[
|
149
|
-
packages: typing.Sequence[
|
148
|
+
input_values: typing.Sequence[CodeExecutorInput],
|
149
|
+
packages: typing.Sequence[CodeExecutionPackage],
|
150
150
|
output_type: VellumVariableType,
|
151
151
|
request_options: typing.Optional[RequestOptions] = None,
|
152
152
|
) -> CodeExecutorResponse:
|
@@ -159,9 +159,9 @@ class Vellum:
|
|
159
159
|
|
160
160
|
runtime : CodeExecutionRuntime
|
161
161
|
|
162
|
-
input_values : typing.Sequence[
|
162
|
+
input_values : typing.Sequence[CodeExecutorInput]
|
163
163
|
|
164
|
-
packages : typing.Sequence[
|
164
|
+
packages : typing.Sequence[CodeExecutionPackage]
|
165
165
|
|
166
166
|
output_type : VellumVariableType
|
167
167
|
|
@@ -175,7 +175,7 @@ class Vellum:
|
|
175
175
|
|
176
176
|
Examples
|
177
177
|
--------
|
178
|
-
from vellum import
|
178
|
+
from vellum import CodeExecutionPackage, StringInput, Vellum
|
179
179
|
|
180
180
|
client = Vellum(
|
181
181
|
api_key="YOUR_API_KEY",
|
@@ -184,13 +184,13 @@ class Vellum:
|
|
184
184
|
code="code",
|
185
185
|
runtime="PYTHON_3_11_6",
|
186
186
|
input_values=[
|
187
|
-
|
187
|
+
StringInput(
|
188
188
|
name="name",
|
189
189
|
value="value",
|
190
190
|
)
|
191
191
|
],
|
192
192
|
packages=[
|
193
|
-
|
193
|
+
CodeExecutionPackage(
|
194
194
|
version="version",
|
195
195
|
name="name",
|
196
196
|
)
|
@@ -206,10 +206,10 @@ class Vellum:
|
|
206
206
|
"code": code,
|
207
207
|
"runtime": runtime,
|
208
208
|
"input_values": convert_and_respect_annotation_metadata(
|
209
|
-
object_=input_values, annotation=typing.Sequence[
|
209
|
+
object_=input_values, annotation=typing.Sequence[CodeExecutorInput], direction="write"
|
210
210
|
),
|
211
211
|
"packages": convert_and_respect_annotation_metadata(
|
212
|
-
object_=packages, annotation=typing.Sequence[
|
212
|
+
object_=packages, annotation=typing.Sequence[CodeExecutionPackage], direction="write"
|
213
213
|
),
|
214
214
|
"output_type": output_type,
|
215
215
|
},
|
@@ -1464,8 +1464,8 @@ class AsyncVellum:
|
|
1464
1464
|
*,
|
1465
1465
|
code: str,
|
1466
1466
|
runtime: CodeExecutionRuntime,
|
1467
|
-
input_values: typing.Sequence[
|
1468
|
-
packages: typing.Sequence[
|
1467
|
+
input_values: typing.Sequence[CodeExecutorInput],
|
1468
|
+
packages: typing.Sequence[CodeExecutionPackage],
|
1469
1469
|
output_type: VellumVariableType,
|
1470
1470
|
request_options: typing.Optional[RequestOptions] = None,
|
1471
1471
|
) -> CodeExecutorResponse:
|
@@ -1478,9 +1478,9 @@ class AsyncVellum:
|
|
1478
1478
|
|
1479
1479
|
runtime : CodeExecutionRuntime
|
1480
1480
|
|
1481
|
-
input_values : typing.Sequence[
|
1481
|
+
input_values : typing.Sequence[CodeExecutorInput]
|
1482
1482
|
|
1483
|
-
packages : typing.Sequence[
|
1483
|
+
packages : typing.Sequence[CodeExecutionPackage]
|
1484
1484
|
|
1485
1485
|
output_type : VellumVariableType
|
1486
1486
|
|
@@ -1496,7 +1496,7 @@ class AsyncVellum:
|
|
1496
1496
|
--------
|
1497
1497
|
import asyncio
|
1498
1498
|
|
1499
|
-
from vellum import AsyncVellum,
|
1499
|
+
from vellum import AsyncVellum, CodeExecutionPackage, StringInput
|
1500
1500
|
|
1501
1501
|
client = AsyncVellum(
|
1502
1502
|
api_key="YOUR_API_KEY",
|
@@ -1508,13 +1508,13 @@ class AsyncVellum:
|
|
1508
1508
|
code="code",
|
1509
1509
|
runtime="PYTHON_3_11_6",
|
1510
1510
|
input_values=[
|
1511
|
-
|
1511
|
+
StringInput(
|
1512
1512
|
name="name",
|
1513
1513
|
value="value",
|
1514
1514
|
)
|
1515
1515
|
],
|
1516
1516
|
packages=[
|
1517
|
-
|
1517
|
+
CodeExecutionPackage(
|
1518
1518
|
version="version",
|
1519
1519
|
name="name",
|
1520
1520
|
)
|
@@ -1533,10 +1533,10 @@ class AsyncVellum:
|
|
1533
1533
|
"code": code,
|
1534
1534
|
"runtime": runtime,
|
1535
1535
|
"input_values": convert_and_respect_annotation_metadata(
|
1536
|
-
object_=input_values, annotation=typing.Sequence[
|
1536
|
+
object_=input_values, annotation=typing.Sequence[CodeExecutorInput], direction="write"
|
1537
1537
|
),
|
1538
1538
|
"packages": convert_and_respect_annotation_metadata(
|
1539
|
-
object_=packages, annotation=typing.Sequence[
|
1539
|
+
object_=packages, annotation=typing.Sequence[CodeExecutionPackage], direction="write"
|
1540
1540
|
),
|
1541
1541
|
"output_type": output_type,
|
1542
1542
|
},
|
vellum/core/client_wrapper.py
CHANGED
@@ -17,7 +17,7 @@ class BaseClientWrapper:
|
|
17
17
|
headers: typing.Dict[str, str] = {
|
18
18
|
"X-Fern-Language": "Python",
|
19
19
|
"X-Fern-SDK-Name": "vellum-ai",
|
20
|
-
"X-Fern-SDK-Version": "0.9.
|
20
|
+
"X-Fern-SDK-Version": "0.9.13",
|
21
21
|
}
|
22
22
|
headers["X_API_KEY"] = self.api_key
|
23
23
|
return headers
|
@@ -7,6 +7,7 @@ from ...types.vellum_variable import VellumVariable
|
|
7
7
|
from ...types.prompt_parameters import PromptParameters
|
8
8
|
from ...types.prompt_block import PromptBlock
|
9
9
|
from ...types.prompt_settings import PromptSettings
|
10
|
+
from ...types.function_definition import FunctionDefinition
|
10
11
|
from ...types.ad_hoc_expand_meta import AdHocExpandMeta
|
11
12
|
from ...core.request_options import RequestOptions
|
12
13
|
from ...types.ad_hoc_execute_prompt_event import AdHocExecutePromptEvent
|
@@ -37,6 +38,7 @@ class AdHocClient:
|
|
37
38
|
parameters: PromptParameters,
|
38
39
|
blocks: typing.Sequence[PromptBlock],
|
39
40
|
settings: typing.Optional[PromptSettings] = OMIT,
|
41
|
+
functions: typing.Optional[typing.Sequence[FunctionDefinition]] = OMIT,
|
40
42
|
expand_meta: typing.Optional[AdHocExpandMeta] = OMIT,
|
41
43
|
request_options: typing.Optional[RequestOptions] = None,
|
42
44
|
) -> typing.Iterator[AdHocExecutePromptEvent]:
|
@@ -57,6 +59,8 @@ class AdHocClient:
|
|
57
59
|
|
58
60
|
settings : typing.Optional[PromptSettings]
|
59
61
|
|
62
|
+
functions : typing.Optional[typing.Sequence[FunctionDefinition]]
|
63
|
+
|
60
64
|
expand_meta : typing.Optional[AdHocExpandMeta]
|
61
65
|
|
62
66
|
request_options : typing.Optional[RequestOptions]
|
@@ -72,6 +76,7 @@ class AdHocClient:
|
|
72
76
|
from vellum import (
|
73
77
|
AdHocExpandMeta,
|
74
78
|
EphemeralPromptCacheConfig,
|
79
|
+
FunctionDefinition,
|
75
80
|
JinjaPromptBlock,
|
76
81
|
PromptParameters,
|
77
82
|
PromptRequestStringInput,
|
@@ -100,7 +105,7 @@ class AdHocClient:
|
|
100
105
|
type="STRING",
|
101
106
|
required=True,
|
102
107
|
default=StringVellumValue(
|
103
|
-
value=
|
108
|
+
value="string",
|
104
109
|
),
|
105
110
|
extensions=VellumVariableExtensions(
|
106
111
|
color={"key": "value"},
|
@@ -128,6 +133,17 @@ class AdHocClient:
|
|
128
133
|
template="string",
|
129
134
|
)
|
130
135
|
],
|
136
|
+
functions=[
|
137
|
+
FunctionDefinition(
|
138
|
+
state="ENABLED",
|
139
|
+
cache_config=EphemeralPromptCacheConfig(),
|
140
|
+
name="string",
|
141
|
+
description="string",
|
142
|
+
parameters={"string": {"key": "value"}},
|
143
|
+
forced=True,
|
144
|
+
strict=True,
|
145
|
+
)
|
146
|
+
],
|
131
147
|
expand_meta=AdHocExpandMeta(
|
132
148
|
cost=True,
|
133
149
|
model_name=True,
|
@@ -159,6 +175,9 @@ class AdHocClient:
|
|
159
175
|
"blocks": convert_and_respect_annotation_metadata(
|
160
176
|
object_=blocks, annotation=typing.Sequence[PromptBlock], direction="write"
|
161
177
|
),
|
178
|
+
"functions": convert_and_respect_annotation_metadata(
|
179
|
+
object_=functions, annotation=typing.Sequence[FunctionDefinition], direction="write"
|
180
|
+
),
|
162
181
|
"expand_meta": convert_and_respect_annotation_metadata(
|
163
182
|
object_=expand_meta, annotation=AdHocExpandMeta, direction="write"
|
164
183
|
),
|
@@ -232,6 +251,7 @@ class AsyncAdHocClient:
|
|
232
251
|
parameters: PromptParameters,
|
233
252
|
blocks: typing.Sequence[PromptBlock],
|
234
253
|
settings: typing.Optional[PromptSettings] = OMIT,
|
254
|
+
functions: typing.Optional[typing.Sequence[FunctionDefinition]] = OMIT,
|
235
255
|
expand_meta: typing.Optional[AdHocExpandMeta] = OMIT,
|
236
256
|
request_options: typing.Optional[RequestOptions] = None,
|
237
257
|
) -> typing.AsyncIterator[AdHocExecutePromptEvent]:
|
@@ -252,6 +272,8 @@ class AsyncAdHocClient:
|
|
252
272
|
|
253
273
|
settings : typing.Optional[PromptSettings]
|
254
274
|
|
275
|
+
functions : typing.Optional[typing.Sequence[FunctionDefinition]]
|
276
|
+
|
255
277
|
expand_meta : typing.Optional[AdHocExpandMeta]
|
256
278
|
|
257
279
|
request_options : typing.Optional[RequestOptions]
|
@@ -270,6 +292,7 @@ class AsyncAdHocClient:
|
|
270
292
|
AdHocExpandMeta,
|
271
293
|
AsyncVellum,
|
272
294
|
EphemeralPromptCacheConfig,
|
295
|
+
FunctionDefinition,
|
273
296
|
JinjaPromptBlock,
|
274
297
|
PromptParameters,
|
275
298
|
PromptRequestStringInput,
|
@@ -300,7 +323,7 @@ class AsyncAdHocClient:
|
|
300
323
|
type="STRING",
|
301
324
|
required=True,
|
302
325
|
default=StringVellumValue(
|
303
|
-
value=
|
326
|
+
value="string",
|
304
327
|
),
|
305
328
|
extensions=VellumVariableExtensions(
|
306
329
|
color={"key": "value"},
|
@@ -328,6 +351,17 @@ class AsyncAdHocClient:
|
|
328
351
|
template="string",
|
329
352
|
)
|
330
353
|
],
|
354
|
+
functions=[
|
355
|
+
FunctionDefinition(
|
356
|
+
state="ENABLED",
|
357
|
+
cache_config=EphemeralPromptCacheConfig(),
|
358
|
+
name="string",
|
359
|
+
description="string",
|
360
|
+
parameters={"string": {"key": "value"}},
|
361
|
+
forced=True,
|
362
|
+
strict=True,
|
363
|
+
)
|
364
|
+
],
|
331
365
|
expand_meta=AdHocExpandMeta(
|
332
366
|
cost=True,
|
333
367
|
model_name=True,
|
@@ -362,6 +396,9 @@ class AsyncAdHocClient:
|
|
362
396
|
"blocks": convert_and_respect_annotation_metadata(
|
363
397
|
object_=blocks, annotation=typing.Sequence[PromptBlock], direction="write"
|
364
398
|
),
|
399
|
+
"functions": convert_and_respect_annotation_metadata(
|
400
|
+
object_=functions, annotation=typing.Sequence[FunctionDefinition], direction="write"
|
401
|
+
),
|
365
402
|
"expand_meta": convert_and_respect_annotation_metadata(
|
366
403
|
object_=expand_meta, annotation=AdHocExpandMeta, direction="write"
|
367
404
|
),
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
import typing
|
4
4
|
from ...core.client_wrapper import SyncClientWrapper
|
5
|
-
from ...types.
|
5
|
+
from ...types.metric_definition_input import MetricDefinitionInput
|
6
6
|
from ...core.request_options import RequestOptions
|
7
7
|
from ...types.metric_definition_execution import MetricDefinitionExecution
|
8
8
|
from ...core.jsonable_encoder import jsonable_encoder
|
@@ -24,7 +24,7 @@ class MetricDefinitionsClient:
|
|
24
24
|
self,
|
25
25
|
id: str,
|
26
26
|
*,
|
27
|
-
inputs: typing.Sequence[
|
27
|
+
inputs: typing.Sequence[MetricDefinitionInput],
|
28
28
|
release_tag: typing.Optional[str] = OMIT,
|
29
29
|
request_options: typing.Optional[RequestOptions] = None,
|
30
30
|
) -> MetricDefinitionExecution:
|
@@ -36,7 +36,7 @@ class MetricDefinitionsClient:
|
|
36
36
|
id : str
|
37
37
|
Either the Metric Definition's ID or its unique name
|
38
38
|
|
39
|
-
inputs : typing.Sequence[
|
39
|
+
inputs : typing.Sequence[MetricDefinitionInput]
|
40
40
|
|
41
41
|
release_tag : typing.Optional[str]
|
42
42
|
|
@@ -50,7 +50,7 @@ class MetricDefinitionsClient:
|
|
50
50
|
|
51
51
|
Examples
|
52
52
|
--------
|
53
|
-
from vellum import
|
53
|
+
from vellum import StringInput, Vellum
|
54
54
|
|
55
55
|
client = Vellum(
|
56
56
|
api_key="YOUR_API_KEY",
|
@@ -58,7 +58,7 @@ class MetricDefinitionsClient:
|
|
58
58
|
client.metric_definitions.execute_metric_definition(
|
59
59
|
id="id",
|
60
60
|
inputs=[
|
61
|
-
|
61
|
+
StringInput(
|
62
62
|
name="name",
|
63
63
|
value="value",
|
64
64
|
)
|
@@ -71,7 +71,7 @@ class MetricDefinitionsClient:
|
|
71
71
|
method="POST",
|
72
72
|
json={
|
73
73
|
"inputs": convert_and_respect_annotation_metadata(
|
74
|
-
object_=inputs, annotation=typing.Sequence[
|
74
|
+
object_=inputs, annotation=typing.Sequence[MetricDefinitionInput], direction="write"
|
75
75
|
),
|
76
76
|
"release_tag": release_tag,
|
77
77
|
},
|
@@ -101,7 +101,7 @@ class AsyncMetricDefinitionsClient:
|
|
101
101
|
self,
|
102
102
|
id: str,
|
103
103
|
*,
|
104
|
-
inputs: typing.Sequence[
|
104
|
+
inputs: typing.Sequence[MetricDefinitionInput],
|
105
105
|
release_tag: typing.Optional[str] = OMIT,
|
106
106
|
request_options: typing.Optional[RequestOptions] = None,
|
107
107
|
) -> MetricDefinitionExecution:
|
@@ -113,7 +113,7 @@ class AsyncMetricDefinitionsClient:
|
|
113
113
|
id : str
|
114
114
|
Either the Metric Definition's ID or its unique name
|
115
115
|
|
116
|
-
inputs : typing.Sequence[
|
116
|
+
inputs : typing.Sequence[MetricDefinitionInput]
|
117
117
|
|
118
118
|
release_tag : typing.Optional[str]
|
119
119
|
|
@@ -129,7 +129,7 @@ class AsyncMetricDefinitionsClient:
|
|
129
129
|
--------
|
130
130
|
import asyncio
|
131
131
|
|
132
|
-
from vellum import AsyncVellum,
|
132
|
+
from vellum import AsyncVellum, StringInput
|
133
133
|
|
134
134
|
client = AsyncVellum(
|
135
135
|
api_key="YOUR_API_KEY",
|
@@ -140,7 +140,7 @@ class AsyncMetricDefinitionsClient:
|
|
140
140
|
await client.metric_definitions.execute_metric_definition(
|
141
141
|
id="id",
|
142
142
|
inputs=[
|
143
|
-
|
143
|
+
StringInput(
|
144
144
|
name="name",
|
145
145
|
value="value",
|
146
146
|
)
|
@@ -156,7 +156,7 @@ class AsyncMetricDefinitionsClient:
|
|
156
156
|
method="POST",
|
157
157
|
json={
|
158
158
|
"inputs": convert_and_respect_annotation_metadata(
|
159
|
-
object_=inputs, annotation=typing.Sequence[
|
159
|
+
object_=inputs, annotation=typing.Sequence[MetricDefinitionInput], direction="write"
|
160
160
|
),
|
161
161
|
"release_tag": release_tag,
|
162
162
|
},
|