vellum-ai 0.9.12__py3-none-any.whl → 0.9.13__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.
- vellum/__init__.py +2 -2
- vellum/core/client_wrapper.py +1 -1
- vellum/resources/ad_hoc/client.py +37 -0
- vellum/types/__init__.py +2 -2
- vellum/types/{function_definition_prompt_block.py → function_definition.py} +6 -7
- vellum/types/prompt_block.py +1 -4
- {vellum_ai-0.9.12.dist-info → vellum_ai-0.9.13.dist-info}/METADATA +1 -1
- {vellum_ai-0.9.12.dist-info → vellum_ai-0.9.13.dist-info}/RECORD +10 -10
- {vellum_ai-0.9.12.dist-info → vellum_ai-0.9.13.dist-info}/LICENSE +0 -0
- {vellum_ai-0.9.12.dist-info → vellum_ai-0.9.13.dist-info}/WHEEL +0 -0
vellum/__init__.py
CHANGED
@@ -135,7 +135,7 @@ from .types import (
|
|
135
135
|
FunctionCallVariableValue,
|
136
136
|
FunctionCallVellumValue,
|
137
137
|
FunctionCallVellumValueRequest,
|
138
|
-
|
138
|
+
FunctionDefinition,
|
139
139
|
GenerateOptionsRequest,
|
140
140
|
GenerateRequest,
|
141
141
|
GenerateResponse,
|
@@ -650,7 +650,7 @@ __all__ = [
|
|
650
650
|
"FunctionCallVariableValue",
|
651
651
|
"FunctionCallVellumValue",
|
652
652
|
"FunctionCallVellumValueRequest",
|
653
|
-
"
|
653
|
+
"FunctionDefinition",
|
654
654
|
"GenerateOptionsRequest",
|
655
655
|
"GenerateRequest",
|
656
656
|
"GenerateResponse",
|
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,
|
@@ -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,
|
@@ -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
|
),
|
vellum/types/__init__.py
CHANGED
@@ -142,7 +142,7 @@ from .function_call_request import FunctionCallRequest
|
|
142
142
|
from .function_call_variable_value import FunctionCallVariableValue
|
143
143
|
from .function_call_vellum_value import FunctionCallVellumValue
|
144
144
|
from .function_call_vellum_value_request import FunctionCallVellumValueRequest
|
145
|
-
from .
|
145
|
+
from .function_definition import FunctionDefinition
|
146
146
|
from .generate_options_request import GenerateOptionsRequest
|
147
147
|
from .generate_request import GenerateRequest
|
148
148
|
from .generate_response import GenerateResponse
|
@@ -631,7 +631,7 @@ __all__ = [
|
|
631
631
|
"FunctionCallVariableValue",
|
632
632
|
"FunctionCallVellumValue",
|
633
633
|
"FunctionCallVellumValueRequest",
|
634
|
-
"
|
634
|
+
"FunctionDefinition",
|
635
635
|
"GenerateOptionsRequest",
|
636
636
|
"GenerateRequest",
|
637
637
|
"GenerateResponse",
|
@@ -8,19 +8,18 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
8
8
|
import pydantic
|
9
9
|
|
10
10
|
|
11
|
-
class
|
11
|
+
class FunctionDefinition(UniversalBaseModel):
|
12
12
|
"""
|
13
13
|
A block that represents a function definition in a prompt template.
|
14
14
|
"""
|
15
15
|
|
16
16
|
state: typing.Optional[PromptBlockState] = None
|
17
17
|
cache_config: typing.Optional[EphemeralPromptCacheConfig] = None
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
function_strict: typing.Optional[bool] = None
|
18
|
+
name: typing.Optional[str] = None
|
19
|
+
description: typing.Optional[str] = None
|
20
|
+
parameters: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
|
21
|
+
forced: typing.Optional[bool] = None
|
22
|
+
strict: typing.Optional[bool] = None
|
24
23
|
|
25
24
|
if IS_PYDANTIC_V2:
|
26
25
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
vellum/types/prompt_block.py
CHANGED
@@ -3,13 +3,10 @@
|
|
3
3
|
from __future__ import annotations
|
4
4
|
import typing
|
5
5
|
from .jinja_prompt_block import JinjaPromptBlock
|
6
|
-
from .function_definition_prompt_block import FunctionDefinitionPromptBlock
|
7
6
|
from .variable_prompt_block import VariablePromptBlock
|
8
7
|
from .rich_text_prompt_block import RichTextPromptBlock
|
9
8
|
import typing
|
10
9
|
|
11
10
|
if typing.TYPE_CHECKING:
|
12
11
|
from .chat_message_prompt_block import ChatMessagePromptBlock
|
13
|
-
PromptBlock = typing.Union[
|
14
|
-
JinjaPromptBlock, "ChatMessagePromptBlock", FunctionDefinitionPromptBlock, VariablePromptBlock, RichTextPromptBlock
|
15
|
-
]
|
12
|
+
PromptBlock = typing.Union[JinjaPromptBlock, "ChatMessagePromptBlock", VariablePromptBlock, RichTextPromptBlock]
|
@@ -1,8 +1,8 @@
|
|
1
|
-
vellum/__init__.py,sha256=
|
1
|
+
vellum/__init__.py,sha256=m0Vfy02ACEtGf7LlRkVWFCAVF19SDF47PWJrCKIDsgo,34220
|
2
2
|
vellum/client.py,sha256=GtF36JNWxnFRV348M0-YcGd9N6ES-l0Q5b32rwHCR5E,115031
|
3
3
|
vellum/core/__init__.py,sha256=SQ85PF84B9MuKnBwHNHWemSGuy-g_515gFYNFhvEE0I,1438
|
4
4
|
vellum/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
5
|
-
vellum/core/client_wrapper.py,sha256=
|
5
|
+
vellum/core/client_wrapper.py,sha256=NxjpjNNf5AJNEHW0u_g8NqGubMRojQRS0LPjOo3EbKE,1890
|
6
6
|
vellum/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
7
7
|
vellum/core/file.py,sha256=X9IbmkZmB2bB_DpmZAO3crWdXagOakAyn6UCOCImCPg,2322
|
8
8
|
vellum/core/http_client.py,sha256=R0pQpCppnEtxccGvXl4uJ76s7ro_65Fo_erlNNLp_AI,19228
|
@@ -32,7 +32,7 @@ vellum/lib/utils/uuid.py,sha256=nedyhTNQDS2YvrU5gL3PtvG9cgGH87yKOcpGDJAe44E,214
|
|
32
32
|
vellum/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
33
33
|
vellum/resources/__init__.py,sha256=6tqe3AwLJGLW38iua0Tje0n3uz3a4vkqMFxbUJGRs98,1346
|
34
34
|
vellum/resources/ad_hoc/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
35
|
-
vellum/resources/ad_hoc/client.py,sha256=
|
35
|
+
vellum/resources/ad_hoc/client.py,sha256=6rsCw-oaq35-DVrb7NTyptc2WU9L6Eka99H3fNB0jA8,17749
|
36
36
|
vellum/resources/container_images/__init__.py,sha256=FTtvy8EDg9nNNg9WCatVgKTRYV8-_v1roeGPAKoa_pw,65
|
37
37
|
vellum/resources/container_images/client.py,sha256=jK1n-NFsdBKCeEKh-EIqvw7R8AG9PP4GxxcoH9F0GYs,15463
|
38
38
|
vellum/resources/deployments/__init__.py,sha256=m64MNuPx3qVazOnTNwOY8oEeDrAkNwMJvUEe5xoMDvs,239
|
@@ -82,7 +82,7 @@ vellum/terraform/ml_model/__init__.py,sha256=I8h1Ru-Rb-Hi_HusK6G7nJQZEKQGsAAHMmw
|
|
82
82
|
vellum/terraform/provider/__init__.py,sha256=-06xKmAmknpohVzw5TD-t1bnUHta8OrQYqvMd04XM-U,12684
|
83
83
|
vellum/terraform/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
84
84
|
vellum/terraform/versions.json,sha256=45c7jjRD5i4w9DJQHs5ZqLLVXRnQwP9Rirq3mWY-xEo,56
|
85
|
-
vellum/types/__init__.py,sha256=
|
85
|
+
vellum/types/__init__.py,sha256=bkZN7uoG71R0R34OWEp-fjl4XQUiHkUQsp-TIFco_dQ,51700
|
86
86
|
vellum/types/ad_hoc_execute_prompt_event.py,sha256=bCjujA2XsOgyF3bRZbcEqV2rOIymRgsLoIRtZpB14xg,607
|
87
87
|
vellum/types/ad_hoc_expand_meta.py,sha256=1gv-NCsy_6xBYupLvZH979yf2VMdxAU-l0y0ynMKZaw,1331
|
88
88
|
vellum/types/ad_hoc_fulfilled_prompt_execution_meta.py,sha256=Bfvf1d_dkmshxRACVM5vcxbH_7AQY23RmrrnPc0ytYY,939
|
@@ -217,7 +217,7 @@ vellum/types/function_call_request.py,sha256=eJBIN-wLkkkDUIwAy1nMeWHu3MZ5aJpOXyW
|
|
217
217
|
vellum/types/function_call_variable_value.py,sha256=VQKCiEtJsmIK3i7CtFV_2ZpxeX70rqpUViXIvAci8L0,702
|
218
218
|
vellum/types/function_call_vellum_value.py,sha256=lLJb-S_-S_UXm6una1BMyCbqLpMhbbMcaVIYNO45h5o,759
|
219
219
|
vellum/types/function_call_vellum_value_request.py,sha256=oUteuCfWcj7UJbSE_Vywmmva9kyTaeL9iv5WJHabDVs,788
|
220
|
-
vellum/types/
|
220
|
+
vellum/types/function_definition.py,sha256=D6uZTIndSeTT4O6FQjU7jVB6Tn1VWOqlAjCa92qX5cE,1127
|
221
221
|
vellum/types/generate_options_request.py,sha256=TUDqsH0tiPWDZH4T-p5gsvKvwVHEVZ_k6oI3qsjlsk4,782
|
222
222
|
vellum/types/generate_request.py,sha256=gL6ywAJe6YCJ5oKbtYwL2H_TMdC_6PJZAI7-P3UOF3I,1286
|
223
223
|
vellum/types/generate_response.py,sha256=QJmSRsYhZhtDmk2xpE9ueQEkHyXmYsaEQqqlKl9-bS4,699
|
@@ -339,7 +339,7 @@ vellum/types/pdf_search_result_meta_source_request.py,sha256=nUhaD2Kw1paGC6O_ICV
|
|
339
339
|
vellum/types/plain_text_prompt_block.py,sha256=GlzovdRbT6mhunMvIpF94_0apjh_0SZtkdlx5HFrE0k,930
|
340
340
|
vellum/types/price.py,sha256=ewzXDBVLaleuXMVQ-gQ3G1Nl5J2OWOVEMEFfnQIpiTk,610
|
341
341
|
vellum/types/processing_failure_reason_enum.py,sha256=R_KIW7TcQejhc-vLhtNf9SdkYADgoZCn4ch4_RRIvsI,195
|
342
|
-
vellum/types/prompt_block.py,sha256=
|
342
|
+
vellum/types/prompt_block.py,sha256=MIsxxmAmuT0thkkG12xm3THO5dlRLbFeMZBVTSvb788,493
|
343
343
|
vellum/types/prompt_block_state.py,sha256=BRAzTYARoSU36IVZGWMeeqhl5fgFMXCyhJ8rCbfB-f0,163
|
344
344
|
vellum/types/prompt_deployment_expand_meta_request.py,sha256=agsiAaHB6lDoZPlnfJ2nmhB4Ud4EiJJTX05YmduyCPo,1910
|
345
345
|
vellum/types/prompt_deployment_input_request.py,sha256=KrT4-Ew2VvTWXEkYQz2oyHn5EDOgrMW7FzRFaPH3ARg,353
|
@@ -563,7 +563,7 @@ vellum/types/workflow_result_event_output_data_string.py,sha256=tM3kgh6tEhD0dFEb
|
|
563
563
|
vellum/types/workflow_stream_event.py,sha256=Wn3Yzuy9MqWAeo8tEaXDTKDEbJoA8DdYdMVq8EKuhu8,361
|
564
564
|
vellum/types/workspace_secret_read.py,sha256=3CnHDG72IAY0KRNvc31F0xLmhnpwjQHnDYCfQJzCxI0,714
|
565
565
|
vellum/version.py,sha256=jq-1PlAYxN9AXuaZqbYk9ak27SgE2lw9Ia5gx1b1gVI,76
|
566
|
-
vellum_ai-0.9.
|
567
|
-
vellum_ai-0.9.
|
568
|
-
vellum_ai-0.9.
|
569
|
-
vellum_ai-0.9.
|
566
|
+
vellum_ai-0.9.13.dist-info/LICENSE,sha256=CcaljEIoOBaU-wItPH4PmM_mDCGpyuUY0Er1BGu5Ti8,1073
|
567
|
+
vellum_ai-0.9.13.dist-info/METADATA,sha256=iYy5x4J3YCS9_eHg_3GjymUtO-Li8PBCxOOuGjvbFqs,4395
|
568
|
+
vellum_ai-0.9.13.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
569
|
+
vellum_ai-0.9.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|