vellum-ai 0.9.7__py3-none-any.whl → 0.9.9__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
@@ -37,6 +37,7 @@ from .types import (
37
37
  ChatMessage,
38
38
  ChatMessageContent,
39
39
  ChatMessageContentRequest,
40
+ ChatMessagePromptBlock,
40
41
  ChatMessageRequest,
41
42
  ChatMessageRole,
42
43
  CodeExecutionNodeArrayResult,
@@ -82,6 +83,8 @@ from .types import (
82
83
  EntityStatus,
83
84
  EntityVisibility,
84
85
  EnvironmentEnum,
86
+ EphemeralPromptCacheConfig,
87
+ EphemeralPromptCacheConfigTypeEnum,
85
88
  ErrorInputRequest,
86
89
  ErrorVariableValue,
87
90
  ErrorVellumValue,
@@ -130,6 +133,7 @@ from .types import (
130
133
  FunctionCallVariableValue,
131
134
  FunctionCallVellumValue,
132
135
  FunctionCallVellumValueRequest,
136
+ FunctionDefinitionPromptBlock,
133
137
  GenerateOptionsRequest,
134
138
  GenerateRequest,
135
139
  GenerateResponse,
@@ -162,6 +166,7 @@ from .types import (
162
166
  InstructorVectorizerConfig,
163
167
  InstructorVectorizerConfigRequest,
164
168
  IterationStateEnum,
169
+ JinjaPromptBlock,
165
170
  JsonInputRequest,
166
171
  JsonVariableValue,
167
172
  JsonVellumValue,
@@ -246,9 +251,12 @@ from .types import (
246
251
  PaginatedWorkflowReleaseTagReadList,
247
252
  PdfSearchResultMetaSource,
248
253
  PdfSearchResultMetaSourceRequest,
254
+ PlainTextPromptBlock,
249
255
  Price,
250
256
  ProcessingFailureReasonEnum,
251
257
  ProcessingStateEnum,
258
+ PromptBlock,
259
+ PromptBlockState,
252
260
  PromptDeploymentExpandMetaRequest,
253
261
  PromptDeploymentInputRequest,
254
262
  PromptExecutionMeta,
@@ -275,6 +283,8 @@ from .types import (
275
283
  RejectedWorkflowNodeResultEvent,
276
284
  ReleaseTagSource,
277
285
  ReplaceTestSuiteTestCaseRequest,
286
+ RichTextChildBlock,
287
+ RichTextPromptBlock,
278
288
  SandboxScenario,
279
289
  ScenarioInput,
280
290
  ScenarioInputChatHistoryVariableValue,
@@ -406,6 +416,7 @@ from .types import (
406
416
  UnitEnum,
407
417
  UploadDocumentResponse,
408
418
  UpsertTestSuiteTestCaseRequest,
419
+ VariablePromptBlock,
409
420
  VellumAudio,
410
421
  VellumAudioRequest,
411
422
  VellumError,
@@ -534,6 +545,7 @@ __all__ = [
534
545
  "ChatMessage",
535
546
  "ChatMessageContent",
536
547
  "ChatMessageContentRequest",
548
+ "ChatMessagePromptBlock",
537
549
  "ChatMessageRequest",
538
550
  "ChatMessageRole",
539
551
  "CodeExecutionNodeArrayResult",
@@ -581,6 +593,8 @@ __all__ = [
581
593
  "EntityStatus",
582
594
  "EntityVisibility",
583
595
  "EnvironmentEnum",
596
+ "EphemeralPromptCacheConfig",
597
+ "EphemeralPromptCacheConfigTypeEnum",
584
598
  "ErrorInputRequest",
585
599
  "ErrorVariableValue",
586
600
  "ErrorVellumValue",
@@ -631,6 +645,7 @@ __all__ = [
631
645
  "FunctionCallVariableValue",
632
646
  "FunctionCallVellumValue",
633
647
  "FunctionCallVellumValueRequest",
648
+ "FunctionDefinitionPromptBlock",
634
649
  "GenerateOptionsRequest",
635
650
  "GenerateRequest",
636
651
  "GenerateResponse",
@@ -664,6 +679,7 @@ __all__ = [
664
679
  "InstructorVectorizerConfigRequest",
665
680
  "InternalServerError",
666
681
  "IterationStateEnum",
682
+ "JinjaPromptBlock",
667
683
  "JsonInputRequest",
668
684
  "JsonVariableValue",
669
685
  "JsonVellumValue",
@@ -751,9 +767,12 @@ __all__ = [
751
767
  "PaginatedWorkflowReleaseTagReadList",
752
768
  "PdfSearchResultMetaSource",
753
769
  "PdfSearchResultMetaSourceRequest",
770
+ "PlainTextPromptBlock",
754
771
  "Price",
755
772
  "ProcessingFailureReasonEnum",
756
773
  "ProcessingStateEnum",
774
+ "PromptBlock",
775
+ "PromptBlockState",
757
776
  "PromptDeploymentExpandMetaRequest",
758
777
  "PromptDeploymentInputRequest",
759
778
  "PromptExecutionMeta",
@@ -780,6 +799,8 @@ __all__ = [
780
799
  "RejectedWorkflowNodeResultEvent",
781
800
  "ReleaseTagSource",
782
801
  "ReplaceTestSuiteTestCaseRequest",
802
+ "RichTextChildBlock",
803
+ "RichTextPromptBlock",
783
804
  "SandboxScenario",
784
805
  "ScenarioInput",
785
806
  "ScenarioInputChatHistoryVariableValue",
@@ -911,6 +932,7 @@ __all__ = [
911
932
  "UnitEnum",
912
933
  "UploadDocumentResponse",
913
934
  "UpsertTestSuiteTestCaseRequest",
935
+ "VariablePromptBlock",
914
936
  "Vellum",
915
937
  "VellumAudio",
916
938
  "VellumAudioRequest",
@@ -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.7",
20
+ "X-Fern-SDK-Version": "0.9.9",
21
21
  }
22
22
  headers["X_API_KEY"] = self.api_key
23
23
  return headers
@@ -5,6 +5,7 @@ from ...core.client_wrapper import SyncClientWrapper
5
5
  from ...types.prompt_request_input import PromptRequestInput
6
6
  from ...types.vellum_variable import VellumVariable
7
7
  from ...types.prompt_parameters import PromptParameters
8
+ from ...types.prompt_block import PromptBlock
8
9
  from ...types.prompt_settings import PromptSettings
9
10
  from ...types.ad_hoc_expand_meta import AdHocExpandMeta
10
11
  from ...core.request_options import RequestOptions
@@ -34,7 +35,7 @@ class AdHocClient:
34
35
  input_values: typing.Sequence[PromptRequestInput],
35
36
  input_variables: typing.Sequence[VellumVariable],
36
37
  parameters: PromptParameters,
37
- blocks: typing.Sequence[typing.Optional[typing.Any]],
38
+ blocks: typing.Sequence[PromptBlock],
38
39
  settings: typing.Optional[PromptSettings] = OMIT,
39
40
  expand_meta: typing.Optional[AdHocExpandMeta] = OMIT,
40
41
  request_options: typing.Optional[RequestOptions] = None,
@@ -52,7 +53,7 @@ class AdHocClient:
52
53
 
53
54
  parameters : PromptParameters
54
55
 
55
- blocks : typing.Sequence[typing.Optional[typing.Any]]
56
+ blocks : typing.Sequence[PromptBlock]
56
57
 
57
58
  settings : typing.Optional[PromptSettings]
58
59
 
@@ -70,6 +71,8 @@ class AdHocClient:
70
71
  --------
71
72
  from vellum import (
72
73
  AdHocExpandMeta,
74
+ EphemeralPromptCacheConfig,
75
+ JinjaPromptBlock,
73
76
  PromptParameters,
74
77
  PromptRequestStringInput,
75
78
  PromptSettings,
@@ -118,7 +121,14 @@ class AdHocClient:
118
121
  settings=PromptSettings(
119
122
  timeout=1.1,
120
123
  ),
121
- blocks=[{"key": "value"}],
124
+ blocks=[
125
+ JinjaPromptBlock(
126
+ state="ENABLED",
127
+ cache_config=EphemeralPromptCacheConfig(),
128
+ template="string",
129
+ template_type="STRING",
130
+ )
131
+ ],
122
132
  expand_meta=AdHocExpandMeta(
123
133
  cost=True,
124
134
  model_name=True,
@@ -147,7 +157,9 @@ class AdHocClient:
147
157
  "settings": convert_and_respect_annotation_metadata(
148
158
  object_=settings, annotation=PromptSettings, direction="write"
149
159
  ),
150
- "blocks": blocks,
160
+ "blocks": convert_and_respect_annotation_metadata(
161
+ object_=blocks, annotation=typing.Sequence[PromptBlock], direction="write"
162
+ ),
151
163
  "expand_meta": convert_and_respect_annotation_metadata(
152
164
  object_=expand_meta, annotation=AdHocExpandMeta, direction="write"
153
165
  ),
@@ -219,7 +231,7 @@ class AsyncAdHocClient:
219
231
  input_values: typing.Sequence[PromptRequestInput],
220
232
  input_variables: typing.Sequence[VellumVariable],
221
233
  parameters: PromptParameters,
222
- blocks: typing.Sequence[typing.Optional[typing.Any]],
234
+ blocks: typing.Sequence[PromptBlock],
223
235
  settings: typing.Optional[PromptSettings] = OMIT,
224
236
  expand_meta: typing.Optional[AdHocExpandMeta] = OMIT,
225
237
  request_options: typing.Optional[RequestOptions] = None,
@@ -237,7 +249,7 @@ class AsyncAdHocClient:
237
249
 
238
250
  parameters : PromptParameters
239
251
 
240
- blocks : typing.Sequence[typing.Optional[typing.Any]]
252
+ blocks : typing.Sequence[PromptBlock]
241
253
 
242
254
  settings : typing.Optional[PromptSettings]
243
255
 
@@ -258,6 +270,8 @@ class AsyncAdHocClient:
258
270
  from vellum import (
259
271
  AdHocExpandMeta,
260
272
  AsyncVellum,
273
+ EphemeralPromptCacheConfig,
274
+ JinjaPromptBlock,
261
275
  PromptParameters,
262
276
  PromptRequestStringInput,
263
277
  PromptSettings,
@@ -308,7 +322,14 @@ class AsyncAdHocClient:
308
322
  settings=PromptSettings(
309
323
  timeout=1.1,
310
324
  ),
311
- blocks=[{"key": "value"}],
325
+ blocks=[
326
+ JinjaPromptBlock(
327
+ state="ENABLED",
328
+ cache_config=EphemeralPromptCacheConfig(),
329
+ template="string",
330
+ template_type="STRING",
331
+ )
332
+ ],
312
333
  expand_meta=AdHocExpandMeta(
313
334
  cost=True,
314
335
  model_name=True,
@@ -340,7 +361,9 @@ class AsyncAdHocClient:
340
361
  "settings": convert_and_respect_annotation_metadata(
341
362
  object_=settings, annotation=PromptSettings, direction="write"
342
363
  ),
343
- "blocks": blocks,
364
+ "blocks": convert_and_respect_annotation_metadata(
365
+ object_=blocks, annotation=typing.Sequence[PromptBlock], direction="write"
366
+ ),
344
367
  "expand_meta": convert_and_respect_annotation_metadata(
345
368
  object_=expand_meta, annotation=AdHocExpandMeta, direction="write"
346
369
  ),
vellum/types/__init__.py CHANGED
@@ -44,6 +44,7 @@ from .chat_history_vellum_value_request import ChatHistoryVellumValueRequest
44
44
  from .chat_message import ChatMessage
45
45
  from .chat_message_content import ChatMessageContent
46
46
  from .chat_message_content_request import ChatMessageContentRequest
47
+ from .chat_message_prompt_block import ChatMessagePromptBlock
47
48
  from .chat_message_request import ChatMessageRequest
48
49
  from .chat_message_role import ChatMessageRole
49
50
  from .code_execution_node_array_result import CodeExecutionNodeArrayResult
@@ -89,6 +90,8 @@ from .enriched_normalized_completion import EnrichedNormalizedCompletion
89
90
  from .entity_status import EntityStatus
90
91
  from .entity_visibility import EntityVisibility
91
92
  from .environment_enum import EnvironmentEnum
93
+ from .ephemeral_prompt_cache_config import EphemeralPromptCacheConfig
94
+ from .ephemeral_prompt_cache_config_type_enum import EphemeralPromptCacheConfigTypeEnum
92
95
  from .error_input_request import ErrorInputRequest
93
96
  from .error_variable_value import ErrorVariableValue
94
97
  from .error_vellum_value import ErrorVellumValue
@@ -137,6 +140,7 @@ from .function_call_request import FunctionCallRequest
137
140
  from .function_call_variable_value import FunctionCallVariableValue
138
141
  from .function_call_vellum_value import FunctionCallVellumValue
139
142
  from .function_call_vellum_value_request import FunctionCallVellumValueRequest
143
+ from .function_definition_prompt_block import FunctionDefinitionPromptBlock
140
144
  from .generate_options_request import GenerateOptionsRequest
141
145
  from .generate_request import GenerateRequest
142
146
  from .generate_response import GenerateResponse
@@ -173,6 +177,7 @@ from .initiated_workflow_node_result_event import InitiatedWorkflowNodeResultEve
173
177
  from .instructor_vectorizer_config import InstructorVectorizerConfig
174
178
  from .instructor_vectorizer_config_request import InstructorVectorizerConfigRequest
175
179
  from .iteration_state_enum import IterationStateEnum
180
+ from .jinja_prompt_block import JinjaPromptBlock
176
181
  from .json_input_request import JsonInputRequest
177
182
  from .json_variable_value import JsonVariableValue
178
183
  from .json_vellum_value import JsonVellumValue
@@ -257,9 +262,12 @@ from .paginated_test_suite_test_case_list import PaginatedTestSuiteTestCaseList
257
262
  from .paginated_workflow_release_tag_read_list import PaginatedWorkflowReleaseTagReadList
258
263
  from .pdf_search_result_meta_source import PdfSearchResultMetaSource
259
264
  from .pdf_search_result_meta_source_request import PdfSearchResultMetaSourceRequest
265
+ from .plain_text_prompt_block import PlainTextPromptBlock
260
266
  from .price import Price
261
267
  from .processing_failure_reason_enum import ProcessingFailureReasonEnum
262
268
  from .processing_state_enum import ProcessingStateEnum
269
+ from .prompt_block import PromptBlock
270
+ from .prompt_block_state import PromptBlockState
263
271
  from .prompt_deployment_expand_meta_request import PromptDeploymentExpandMetaRequest
264
272
  from .prompt_deployment_input_request import PromptDeploymentInputRequest
265
273
  from .prompt_execution_meta import PromptExecutionMeta
@@ -286,6 +294,8 @@ from .rejected_prompt_execution_meta import RejectedPromptExecutionMeta
286
294
  from .rejected_workflow_node_result_event import RejectedWorkflowNodeResultEvent
287
295
  from .release_tag_source import ReleaseTagSource
288
296
  from .replace_test_suite_test_case_request import ReplaceTestSuiteTestCaseRequest
297
+ from .rich_text_child_block import RichTextChildBlock
298
+ from .rich_text_prompt_block import RichTextPromptBlock
289
299
  from .sandbox_scenario import SandboxScenario
290
300
  from .scenario_input import ScenarioInput
291
301
  from .scenario_input_chat_history_variable_value import ScenarioInputChatHistoryVariableValue
@@ -421,6 +431,7 @@ from .token_overlapping_window_chunking_request import TokenOverlappingWindowChu
421
431
  from .unit_enum import UnitEnum
422
432
  from .upload_document_response import UploadDocumentResponse
423
433
  from .upsert_test_suite_test_case_request import UpsertTestSuiteTestCaseRequest
434
+ from .variable_prompt_block import VariablePromptBlock
424
435
  from .vellum_audio import VellumAudio
425
436
  from .vellum_audio_request import VellumAudioRequest
426
437
  from .vellum_error import VellumError
@@ -519,6 +530,7 @@ __all__ = [
519
530
  "ChatMessage",
520
531
  "ChatMessageContent",
521
532
  "ChatMessageContentRequest",
533
+ "ChatMessagePromptBlock",
522
534
  "ChatMessageRequest",
523
535
  "ChatMessageRole",
524
536
  "CodeExecutionNodeArrayResult",
@@ -564,6 +576,8 @@ __all__ = [
564
576
  "EntityStatus",
565
577
  "EntityVisibility",
566
578
  "EnvironmentEnum",
579
+ "EphemeralPromptCacheConfig",
580
+ "EphemeralPromptCacheConfigTypeEnum",
567
581
  "ErrorInputRequest",
568
582
  "ErrorVariableValue",
569
583
  "ErrorVellumValue",
@@ -612,6 +626,7 @@ __all__ = [
612
626
  "FunctionCallVariableValue",
613
627
  "FunctionCallVellumValue",
614
628
  "FunctionCallVellumValueRequest",
629
+ "FunctionDefinitionPromptBlock",
615
630
  "GenerateOptionsRequest",
616
631
  "GenerateRequest",
617
632
  "GenerateResponse",
@@ -644,6 +659,7 @@ __all__ = [
644
659
  "InstructorVectorizerConfig",
645
660
  "InstructorVectorizerConfigRequest",
646
661
  "IterationStateEnum",
662
+ "JinjaPromptBlock",
647
663
  "JsonInputRequest",
648
664
  "JsonVariableValue",
649
665
  "JsonVellumValue",
@@ -728,9 +744,12 @@ __all__ = [
728
744
  "PaginatedWorkflowReleaseTagReadList",
729
745
  "PdfSearchResultMetaSource",
730
746
  "PdfSearchResultMetaSourceRequest",
747
+ "PlainTextPromptBlock",
731
748
  "Price",
732
749
  "ProcessingFailureReasonEnum",
733
750
  "ProcessingStateEnum",
751
+ "PromptBlock",
752
+ "PromptBlockState",
734
753
  "PromptDeploymentExpandMetaRequest",
735
754
  "PromptDeploymentInputRequest",
736
755
  "PromptExecutionMeta",
@@ -757,6 +776,8 @@ __all__ = [
757
776
  "RejectedWorkflowNodeResultEvent",
758
777
  "ReleaseTagSource",
759
778
  "ReplaceTestSuiteTestCaseRequest",
779
+ "RichTextChildBlock",
780
+ "RichTextPromptBlock",
760
781
  "SandboxScenario",
761
782
  "ScenarioInput",
762
783
  "ScenarioInputChatHistoryVariableValue",
@@ -888,6 +909,7 @@ __all__ = [
888
909
  "UnitEnum",
889
910
  "UploadDocumentResponse",
890
911
  "UpsertTestSuiteTestCaseRequest",
912
+ "VariablePromptBlock",
891
913
  "VellumAudio",
892
914
  "VellumAudioRequest",
893
915
  "VellumError",
@@ -0,0 +1,39 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from __future__ import annotations
4
+ from ..core.pydantic_utilities import UniversalBaseModel
5
+ import typing
6
+ from .prompt_block_state import PromptBlockState
7
+ from .ephemeral_prompt_cache_config import EphemeralPromptCacheConfig
8
+ from .chat_message_role import ChatMessageRole
9
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
10
+ import pydantic
11
+ from ..core.pydantic_utilities import update_forward_refs
12
+
13
+
14
+ class ChatMessagePromptBlock(UniversalBaseModel):
15
+ """
16
+ A block that represents a chat message in a prompt template.
17
+ """
18
+
19
+ state: typing.Optional[PromptBlockState] = None
20
+ cache_config: typing.Optional[EphemeralPromptCacheConfig] = None
21
+ block_type: typing.Literal["CHAT_MESSAGE"] = "CHAT_MESSAGE"
22
+ chat_role: ChatMessageRole
23
+ chat_source: typing.Optional[str] = None
24
+ chat_message_unterminated: typing.Optional[bool] = None
25
+ blocks: typing.List["PromptBlock"]
26
+
27
+ if IS_PYDANTIC_V2:
28
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
29
+ else:
30
+
31
+ class Config:
32
+ frozen = True
33
+ smart_union = True
34
+ extra = pydantic.Extra.allow
35
+
36
+
37
+ from .prompt_block import PromptBlock # noqa: E402
38
+
39
+ update_forward_refs(ChatMessagePromptBlock)
@@ -0,0 +1,20 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import typing
5
+ from .ephemeral_prompt_cache_config_type_enum import EphemeralPromptCacheConfigTypeEnum
6
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
7
+ import pydantic
8
+
9
+
10
+ class EphemeralPromptCacheConfig(UniversalBaseModel):
11
+ type: typing.Optional[EphemeralPromptCacheConfigTypeEnum] = None
12
+
13
+ if IS_PYDANTIC_V2:
14
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
15
+ else:
16
+
17
+ class Config:
18
+ frozen = True
19
+ smart_union = True
20
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ EphemeralPromptCacheConfigTypeEnum = typing.Literal["EPHEMERAL"]
@@ -0,0 +1,30 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import typing
5
+ from .prompt_block_state import PromptBlockState
6
+ from .ephemeral_prompt_cache_config import EphemeralPromptCacheConfig
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ import pydantic
9
+
10
+
11
+ class FunctionDefinitionPromptBlock(UniversalBaseModel):
12
+ """
13
+ A block that represents a function definition in a prompt template.
14
+ """
15
+
16
+ state: typing.Optional[PromptBlockState] = None
17
+ cache_config: typing.Optional[EphemeralPromptCacheConfig] = None
18
+ block_type: typing.Literal["FUNCTION_DEFINITION"] = "FUNCTION_DEFINITION"
19
+ function_name: typing.Optional[str] = None
20
+ function_description: typing.Optional[str] = None
21
+ function_parameters: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
22
+
23
+ if IS_PYDANTIC_V2:
24
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
25
+ else:
26
+
27
+ class Config:
28
+ frozen = True
29
+ smart_union = True
30
+ extra = pydantic.Extra.allow
@@ -0,0 +1,30 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import typing
5
+ from .prompt_block_state import PromptBlockState
6
+ from .ephemeral_prompt_cache_config import EphemeralPromptCacheConfig
7
+ from .vellum_variable_type import VellumVariableType
8
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
9
+ import pydantic
10
+
11
+
12
+ class JinjaPromptBlock(UniversalBaseModel):
13
+ """
14
+ A block of Jinja template code that is used to generate a prompt
15
+ """
16
+
17
+ state: typing.Optional[PromptBlockState] = None
18
+ cache_config: typing.Optional[EphemeralPromptCacheConfig] = None
19
+ block_type: typing.Literal["JINJA"] = "JINJA"
20
+ template: str
21
+ template_type: VellumVariableType
22
+
23
+ if IS_PYDANTIC_V2:
24
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
25
+ else:
26
+
27
+ class Config:
28
+ frozen = True
29
+ smart_union = True
30
+ extra = pydantic.Extra.allow
@@ -0,0 +1,28 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import typing
5
+ from .prompt_block_state import PromptBlockState
6
+ from .ephemeral_prompt_cache_config import EphemeralPromptCacheConfig
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ import pydantic
9
+
10
+
11
+ class PlainTextPromptBlock(UniversalBaseModel):
12
+ """
13
+ A block that holds a plain text string value.
14
+ """
15
+
16
+ state: typing.Optional[PromptBlockState] = None
17
+ cache_config: typing.Optional[EphemeralPromptCacheConfig] = None
18
+ block_type: typing.Literal["PLAIN_TEXT"] = "PLAIN_TEXT"
19
+ text: str
20
+
21
+ if IS_PYDANTIC_V2:
22
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
23
+ else:
24
+
25
+ class Config:
26
+ frozen = True
27
+ smart_union = True
28
+ extra = pydantic.Extra.allow
@@ -0,0 +1,15 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from __future__ import annotations
4
+ import typing
5
+ from .jinja_prompt_block import JinjaPromptBlock
6
+ from .function_definition_prompt_block import FunctionDefinitionPromptBlock
7
+ from .variable_prompt_block import VariablePromptBlock
8
+ from .rich_text_prompt_block import RichTextPromptBlock
9
+ import typing
10
+
11
+ if typing.TYPE_CHECKING:
12
+ from .chat_message_prompt_block import ChatMessagePromptBlock
13
+ PromptBlock = typing.Union[
14
+ JinjaPromptBlock, "ChatMessagePromptBlock", FunctionDefinitionPromptBlock, VariablePromptBlock, RichTextPromptBlock
15
+ ]
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ PromptBlockState = typing.Union[typing.Literal["ENABLED", "DISABLED"], typing.Any]
@@ -0,0 +1,7 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from .variable_prompt_block import VariablePromptBlock
5
+ from .plain_text_prompt_block import PlainTextPromptBlock
6
+
7
+ RichTextChildBlock = typing.Union[VariablePromptBlock, PlainTextPromptBlock]
@@ -0,0 +1,29 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import typing
5
+ from .prompt_block_state import PromptBlockState
6
+ from .ephemeral_prompt_cache_config import EphemeralPromptCacheConfig
7
+ from .rich_text_child_block import RichTextChildBlock
8
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
9
+ import pydantic
10
+
11
+
12
+ class RichTextPromptBlock(UniversalBaseModel):
13
+ """
14
+ A block that includes a combination of plain text and variable blocks.
15
+ """
16
+
17
+ state: typing.Optional[PromptBlockState] = None
18
+ cache_config: typing.Optional[EphemeralPromptCacheConfig] = None
19
+ block_type: typing.Literal["RICH_TEXT"] = "RICH_TEXT"
20
+ blocks: typing.List[RichTextChildBlock]
21
+
22
+ if IS_PYDANTIC_V2:
23
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
24
+ else:
25
+
26
+ class Config:
27
+ frozen = True
28
+ smart_union = True
29
+ extra = pydantic.Extra.allow
@@ -0,0 +1,28 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.pydantic_utilities import UniversalBaseModel
4
+ import typing
5
+ from .prompt_block_state import PromptBlockState
6
+ from .ephemeral_prompt_cache_config import EphemeralPromptCacheConfig
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2
8
+ import pydantic
9
+
10
+
11
+ class VariablePromptBlock(UniversalBaseModel):
12
+ """
13
+ A block that represents a variable in a prompt template.
14
+ """
15
+
16
+ state: typing.Optional[PromptBlockState] = None
17
+ cache_config: typing.Optional[EphemeralPromptCacheConfig] = None
18
+ block_type: typing.Literal["VARIABLE"] = "VARIABLE"
19
+ input_variable_id: str
20
+
21
+ if IS_PYDANTIC_V2:
22
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
23
+ else:
24
+
25
+ class Config:
26
+ frozen = True
27
+ smart_union = True
28
+ extra = pydantic.Extra.allow
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vellum-ai
3
- Version: 0.9.7
3
+ Version: 0.9.9
4
4
  Summary:
5
5
  License: MIT
6
6
  Requires-Python: >=3.8,<4.0
@@ -1,8 +1,8 @@
1
- vellum/__init__.py,sha256=XLTmPODTz4SX5gIYT6qkg5WfBvqH1Jq2h5w9dZGF0_s,33632
1
+ vellum/__init__.py,sha256=NEsCiACEkYsvptuTcfLFTiuhK3a17YvN0m-S6aHergA,34246
2
2
  vellum/client.py,sha256=kG4b9g1Jjm6zgzGBXCAYXcM_3xNQfBsa2Xut6F0eHQM,115201
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=HejxYCB47RVZhppXHM51_7mVBa8ycn6A6-5EmrNTnok,1889
5
+ vellum/core/client_wrapper.py,sha256=1VdZnJ26lNuSWW3UuVC09QTwt0a7uaSjGK_G4UbHHJI,1889
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=JOdjssV2rLBHHOO0wVn5fFQ1-1-mfQZ4mQHCt_iGr7I,15291
35
+ vellum/resources/ad_hoc/client.py,sha256=YHFtDXXbWcwFBRi9iI-Q3EDhRFrPiKj3wOgMuWLOcjg,16199
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=S1Z3m1icSICPDg0gPStafY6z_drQo2nByLdngrmg1MQ,50767
85
+ vellum/types/__init__.py,sha256=fpJM6RPsqMqKJ0V7w4e4aab8jORBgSoAY4_FRqurz9s,51740
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
@@ -119,6 +119,7 @@ vellum/types/chat_history_vellum_value_request.py,sha256=HzAiysncG5unJ-tlb43HhGZ
119
119
  vellum/types/chat_message.py,sha256=EOA8v5Ebx2KS9BtwBBGbuvSK-pn4xWYZiioHuuPWvzw,916
120
120
  vellum/types/chat_message_content.py,sha256=DQLB5rG40qLRLsmKWWo-XKa4rhk9TGQs_eFTFow2zEM,607
121
121
  vellum/types/chat_message_content_request.py,sha256=iFT_PmN6sUjeN1_fZXr2ePJEbSq_GZcClBvtu8SdVmQ,724
122
+ vellum/types/chat_message_prompt_block.py,sha256=K0D42GPIgJYfYYigXU6ggCUbwHcB1LwMNDjXDybh3MQ,1351
122
123
  vellum/types/chat_message_request.py,sha256=r2EW1pfnvNYx2fo6mBqU5HQrUzp67WXuE5G-XK281E4,945
123
124
  vellum/types/chat_message_role.py,sha256=-i0Jrcbwf72MkMoaFTGyxRduvlN7f5Y9ULhCXR5KNdA,182
124
125
  vellum/types/code_execution_node_array_result.py,sha256=KCdbmjXjReO-hPPpBsSR17h_roDUpc4R-92cmIn59ck,952
@@ -164,6 +165,8 @@ vellum/types/enriched_normalized_completion.py,sha256=qk8o_PCj8rvgxa9omng0Nx5SvG
164
165
  vellum/types/entity_status.py,sha256=bY0jEpISwXqFnbWd3PSb3yXEr-ounPXlAO_fyvHV7l8,158
165
166
  vellum/types/entity_visibility.py,sha256=BX1KdYd7dirpv878XDDvtOHkMOqebM8-lkWmLyFLaw4,184
166
167
  vellum/types/environment_enum.py,sha256=Wcewxp1cpGAMDIAZbTp4Y0GGfvy2Bq_Qu_67f_wBDGA,179
168
+ vellum/types/ephemeral_prompt_cache_config.py,sha256=PK26yfHCLPAnXd89r8gz0rCD9hRR5pjKrE-o6-Mk-dI,712
169
+ vellum/types/ephemeral_prompt_cache_config_type_enum.py,sha256=houFyNbNr9r2uXTBoRTA0eZJaBDe0CFTIUbsDyWK2e4,145
167
170
  vellum/types/error_input_request.py,sha256=iWHzxp5DBkVPsinv8sDkf5m51YxzNCyQzRoO-ULaSz0,815
168
171
  vellum/types/error_variable_value.py,sha256=ULT_D9h8dKeHTnXEDv6UHxNlpmwQ3iDHTGU6Zg8a6H0,676
169
172
  vellum/types/error_vellum_value.py,sha256=Y7yO8Y1eOlbRyOqbOh6MyPRNHYKH48gIhlZIRcw1UaA,726
@@ -212,6 +215,7 @@ vellum/types/function_call_request.py,sha256=eJBIN-wLkkkDUIwAy1nMeWHu3MZ5aJpOXyW
212
215
  vellum/types/function_call_variable_value.py,sha256=VQKCiEtJsmIK3i7CtFV_2ZpxeX70rqpUViXIvAci8L0,702
213
216
  vellum/types/function_call_vellum_value.py,sha256=lLJb-S_-S_UXm6una1BMyCbqLpMhbbMcaVIYNO45h5o,759
214
217
  vellum/types/function_call_vellum_value_request.py,sha256=oUteuCfWcj7UJbSE_Vywmmva9kyTaeL9iv5WJHabDVs,788
218
+ vellum/types/function_definition_prompt_block.py,sha256=_CO8HIw6tuCvJO7SW8OkqwJIar0mzvYnNRzOB3ry278,1161
215
219
  vellum/types/generate_options_request.py,sha256=TUDqsH0tiPWDZH4T-p5gsvKvwVHEVZ_k6oI3qsjlsk4,782
216
220
  vellum/types/generate_request.py,sha256=gL6ywAJe6YCJ5oKbtYwL2H_TMdC_6PJZAI7-P3UOF3I,1286
217
221
  vellum/types/generate_response.py,sha256=QJmSRsYhZhtDmk2xpE9ueQEkHyXmYsaEQqqlKl9-bS4,699
@@ -244,6 +248,7 @@ vellum/types/initiated_workflow_node_result_event.py,sha256=Nu1J4iQYsW2HHjQFzQq-
244
248
  vellum/types/instructor_vectorizer_config.py,sha256=7udlosXv4CUWTW_Q9m0mz3VRi1FKSbBhDIOhtxRd0-U,731
245
249
  vellum/types/instructor_vectorizer_config_request.py,sha256=6LGFFQKntMfX7bdetUqEMVdr3KJHEps0oDp2bNmqWbM,738
246
250
  vellum/types/iteration_state_enum.py,sha256=83JSh842OJgQiLtNn1KMimy6RlEYRVH3mDmYWS6Ewzo,180
251
+ vellum/types/jinja_prompt_block.py,sha256=eEoVmFeEjueNoNxrlUqmBtUhabQoOXna0NFHeqtBhNs,1030
247
252
  vellum/types/json_input_request.py,sha256=x5sA-VXxF4QH-98xRcIKPZhsMVbnJNUQofiUQqyfGk4,768
248
253
  vellum/types/json_variable_value.py,sha256=X7eBEWxuozfvIdqD5sIZ5L-L77Ou6IIsZaQVNXh5G2k,634
249
254
  vellum/types/json_vellum_value.py,sha256=8irlw6NkRRVafysfTc1Q5BFFhRrWJYzdwrDYTdJK4JY,689
@@ -328,9 +333,12 @@ vellum/types/paginated_test_suite_test_case_list.py,sha256=9KrCCQKy0egMmVx5U2k6o
328
333
  vellum/types/paginated_workflow_release_tag_read_list.py,sha256=dH24ESWyAMVtyHsBkxG8kJ9oORY04Wn3IN-7jvV7Lu4,818
329
334
  vellum/types/pdf_search_result_meta_source.py,sha256=EMVhqdN1bwE6Ujdx4VhlmKQtJvitN-57kY8oZPxh9dI,1126
330
335
  vellum/types/pdf_search_result_meta_source_request.py,sha256=nUhaD2Kw1paGC6O_ICVNu3R0e1SVgTshRTkGNgmcjXo,1133
336
+ vellum/types/plain_text_prompt_block.py,sha256=GlzovdRbT6mhunMvIpF94_0apjh_0SZtkdlx5HFrE0k,930
331
337
  vellum/types/price.py,sha256=ewzXDBVLaleuXMVQ-gQ3G1Nl5J2OWOVEMEFfnQIpiTk,610
332
338
  vellum/types/processing_failure_reason_enum.py,sha256=R_KIW7TcQejhc-vLhtNf9SdkYADgoZCn4ch4_RRIvsI,195
333
339
  vellum/types/processing_state_enum.py,sha256=lIEunnCpgYQExm2bGyTb12KyjQ3O7XOx636aWXb_Iwo,190
340
+ vellum/types/prompt_block.py,sha256=qJISp3lSZ0EVrTuqs9306KO14mZPQmj-yeghBqqfBao,606
341
+ vellum/types/prompt_block_state.py,sha256=BRAzTYARoSU36IVZGWMeeqhl5fgFMXCyhJ8rCbfB-f0,163
334
342
  vellum/types/prompt_deployment_expand_meta_request.py,sha256=agsiAaHB6lDoZPlnfJ2nmhB4Ud4EiJJTX05YmduyCPo,1910
335
343
  vellum/types/prompt_deployment_input_request.py,sha256=KrT4-Ew2VvTWXEkYQz2oyHn5EDOgrMW7FzRFaPH3ARg,353
336
344
  vellum/types/prompt_execution_meta.py,sha256=3hhMZgdAR5mKfnh2e_eVN3oKfT0E9w26khVPrpjn7jk,1141
@@ -357,6 +365,8 @@ vellum/types/rejected_prompt_execution_meta.py,sha256=4Oidh3XBBHzgjOys2kuETxqWc_
357
365
  vellum/types/rejected_workflow_node_result_event.py,sha256=o9AUc9hT60F8ckMkCx8HtKxtj4y82LBoJduB9u8w0TM,1319
358
366
  vellum/types/release_tag_source.py,sha256=YavosOXZ976yfXTNWRTZwh2HhRiYmSDk0bQCkl-jCoQ,158
359
367
  vellum/types/replace_test_suite_test_case_request.py,sha256=c1GT1RUCei1yWxyZy4Gv40PkXYisvK5OkzlqQ6WeBYA,1906
368
+ vellum/types/rich_text_child_block.py,sha256=X_ACKFKSUx5SXT1cLp0Y5-7VrNxcGOggPm67Lk2442U,270
369
+ vellum/types/rich_text_prompt_block.py,sha256=60Bg_1wuXAd5eBiO9xiN8NjMvYE67ZLTtAb1A3N-7oI,1036
360
370
  vellum/types/sandbox_scenario.py,sha256=f4S0tDxmPYHIrD_BMjRL3XZGcGxlWy9apfI64hV7MBE,844
361
371
  vellum/types/scenario_input.py,sha256=caC8p5ZnuXhv2ZiHvzTvKL3Ebtr4NXP9Q8UcJEVB8-U,476
362
372
  vellum/types/scenario_input_chat_history_variable_value.py,sha256=ihgJktmZpz_12wx2yPtyrSrBjcBcSg9fby7h_eLoXgI,835
@@ -488,6 +498,7 @@ vellum/types/token_overlapping_window_chunking_request.py,sha256=IjCs9UDrwBT6tnf
488
498
  vellum/types/unit_enum.py,sha256=BKWRVp2WfHtGK4D6TsolhNJHGHfExzrRHkFn8H8QkwQ,113
489
499
  vellum/types/upload_document_response.py,sha256=6_5Cm4yBPq5nD-rEql6GsmrAtSVVtNRczOL5YwsBVMI,649
490
500
  vellum/types/upsert_test_suite_test_case_request.py,sha256=iB38vx4mo4yNLV5XTeXMGR-PJLOQPloWQOAAi7PDpM0,2079
501
+ vellum/types/variable_prompt_block.py,sha256=cQezrQTHZRN4anIZDv21a6VEUfjYdCkDLqA7OrNGSBs,949
491
502
  vellum/types/vellum_audio.py,sha256=oPm1bcxk7fTfWfHWOPSLvrZrRBjCyPDVDRMACPoWmMI,721
492
503
  vellum/types/vellum_audio_request.py,sha256=y9CZgQ1TteW0AHNk8GuAZLNVFa981rh7P9vyV8bfgys,728
493
504
  vellum/types/vellum_error.py,sha256=jCKfuCkDTiyFb1-QyP2cg0wReja6wMuooKPAjNhBA0M,643
@@ -549,7 +560,7 @@ vellum/types/workflow_result_event_output_data_string.py,sha256=tM3kgh6tEhD0dFEb
549
560
  vellum/types/workflow_stream_event.py,sha256=Wn3Yzuy9MqWAeo8tEaXDTKDEbJoA8DdYdMVq8EKuhu8,361
550
561
  vellum/types/workspace_secret_read.py,sha256=3CnHDG72IAY0KRNvc31F0xLmhnpwjQHnDYCfQJzCxI0,714
551
562
  vellum/version.py,sha256=jq-1PlAYxN9AXuaZqbYk9ak27SgE2lw9Ia5gx1b1gVI,76
552
- vellum_ai-0.9.7.dist-info/LICENSE,sha256=CcaljEIoOBaU-wItPH4PmM_mDCGpyuUY0Er1BGu5Ti8,1073
553
- vellum_ai-0.9.7.dist-info/METADATA,sha256=hNHe7CoBAqYIH-ArQUtMpzL0iiyA_nHyJVyI-aNRlD0,4394
554
- vellum_ai-0.9.7.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
555
- vellum_ai-0.9.7.dist-info/RECORD,,
563
+ vellum_ai-0.9.9.dist-info/LICENSE,sha256=CcaljEIoOBaU-wItPH4PmM_mDCGpyuUY0Er1BGu5Ti8,1073
564
+ vellum_ai-0.9.9.dist-info/METADATA,sha256=iu-mte_J2Uit6EFQNfGYBWyxhUAQ-WuqnNDKRCFD4O4,4394
565
+ vellum_ai-0.9.9.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
566
+ vellum_ai-0.9.9.dist-info/RECORD,,