vellum-ai 0.9.6__py3-none-any.whl → 0.9.8__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- vellum/__init__.py +38 -42
- vellum/core/client_wrapper.py +1 -1
- vellum/resources/ad_hoc/client.py +86 -90
- vellum/types/__init__.py +38 -42
- vellum/types/{ad_hoc_expand_meta_request.py → ad_hoc_expand_meta.py} +1 -1
- vellum/types/{chat_message_prompt_block_request.py → chat_message_prompt_block.py} +7 -9
- vellum/types/{chat_message_prompt_block_properties_request.py → chat_message_prompt_block_properties.py} +6 -8
- vellum/types/{ephemeral_prompt_cache_config_request.py → ephemeral_prompt_cache_config.py} +1 -1
- vellum/types/{function_definition_prompt_block_request.py → function_definition_prompt_block.py} +5 -5
- vellum/types/{function_definition_prompt_block_properties_request.py → function_definition_prompt_block_properties.py} +1 -1
- vellum/types/{jinja_prompt_block_request.py → jinja_prompt_block.py} +5 -5
- vellum/types/{jinja_prompt_block_properties_request.py → jinja_prompt_block_properties.py} +1 -1
- vellum/types/{plain_text_prompt_block_request.py → plain_text_prompt_block.py} +3 -3
- vellum/types/prompt_block.py +15 -0
- vellum/types/{prompt_parameters_request.py → prompt_parameters.py} +1 -1
- vellum/types/{prompt_request_chat_history_input_request.py → prompt_request_chat_history_input.py} +3 -3
- vellum/types/prompt_request_input.py +8 -0
- vellum/types/{prompt_request_json_input_request.py → prompt_request_json_input.py} +1 -1
- vellum/types/{prompt_request_string_input_request.py → prompt_request_string_input.py} +1 -1
- vellum/types/{prompt_settings_request.py → prompt_settings.py} +1 -1
- vellum/types/rich_text_child_block.py +7 -0
- vellum/types/{rich_text_prompt_block_request.py → rich_text_prompt_block.py} +6 -7
- vellum/types/{variable_prompt_block_request.py → variable_prompt_block.py} +3 -3
- {vellum_ai-0.9.6.dist-info → vellum_ai-0.9.8.dist-info}/METADATA +1 -1
- {vellum_ai-0.9.6.dist-info → vellum_ai-0.9.8.dist-info}/RECORD +27 -29
- vellum/types/prompt_block_request.py +0 -19
- vellum/types/prompt_request_input_request.py +0 -10
- vellum/types/rich_text_child_block_request.py +0 -7
- vellum/types/vellum_variable_extensions_request.py +0 -23
- vellum/types/vellum_variable_request.py +0 -33
- {vellum_ai-0.9.6.dist-info → vellum_ai-0.9.8.dist-info}/LICENSE +0 -0
- {vellum_ai-0.9.6.dist-info → vellum_ai-0.9.8.dist-info}/WHEEL +0 -0
vellum/types/__init__.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
3
|
from .ad_hoc_execute_prompt_event import AdHocExecutePromptEvent
|
4
|
-
from .
|
4
|
+
from .ad_hoc_expand_meta import AdHocExpandMeta
|
5
5
|
from .ad_hoc_fulfilled_prompt_execution_meta import AdHocFulfilledPromptExecutionMeta
|
6
6
|
from .ad_hoc_initiated_prompt_execution_meta import AdHocInitiatedPromptExecutionMeta
|
7
7
|
from .ad_hoc_rejected_prompt_execution_meta import AdHocRejectedPromptExecutionMeta
|
@@ -44,8 +44,8 @@ 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 .
|
48
|
-
from .
|
47
|
+
from .chat_message_prompt_block import ChatMessagePromptBlock
|
48
|
+
from .chat_message_prompt_block_properties import ChatMessagePromptBlockProperties
|
49
49
|
from .chat_message_request import ChatMessageRequest
|
50
50
|
from .chat_message_role import ChatMessageRole
|
51
51
|
from .code_execution_node_array_result import CodeExecutionNodeArrayResult
|
@@ -91,7 +91,7 @@ from .enriched_normalized_completion import EnrichedNormalizedCompletion
|
|
91
91
|
from .entity_status import EntityStatus
|
92
92
|
from .entity_visibility import EntityVisibility
|
93
93
|
from .environment_enum import EnvironmentEnum
|
94
|
-
from .
|
94
|
+
from .ephemeral_prompt_cache_config import EphemeralPromptCacheConfig
|
95
95
|
from .ephemeral_prompt_cache_config_type_enum import EphemeralPromptCacheConfigTypeEnum
|
96
96
|
from .error_input_request import ErrorInputRequest
|
97
97
|
from .error_variable_value import ErrorVariableValue
|
@@ -141,8 +141,8 @@ from .function_call_request import FunctionCallRequest
|
|
141
141
|
from .function_call_variable_value import FunctionCallVariableValue
|
142
142
|
from .function_call_vellum_value import FunctionCallVellumValue
|
143
143
|
from .function_call_vellum_value_request import FunctionCallVellumValueRequest
|
144
|
-
from .
|
145
|
-
from .
|
144
|
+
from .function_definition_prompt_block import FunctionDefinitionPromptBlock
|
145
|
+
from .function_definition_prompt_block_properties import FunctionDefinitionPromptBlockProperties
|
146
146
|
from .generate_options_request import GenerateOptionsRequest
|
147
147
|
from .generate_request import GenerateRequest
|
148
148
|
from .generate_response import GenerateResponse
|
@@ -179,8 +179,8 @@ from .initiated_workflow_node_result_event import InitiatedWorkflowNodeResultEve
|
|
179
179
|
from .instructor_vectorizer_config import InstructorVectorizerConfig
|
180
180
|
from .instructor_vectorizer_config_request import InstructorVectorizerConfigRequest
|
181
181
|
from .iteration_state_enum import IterationStateEnum
|
182
|
-
from .
|
183
|
-
from .
|
182
|
+
from .jinja_prompt_block import JinjaPromptBlock
|
183
|
+
from .jinja_prompt_block_properties import JinjaPromptBlockProperties
|
184
184
|
from .json_input_request import JsonInputRequest
|
185
185
|
from .json_variable_value import JsonVariableValue
|
186
186
|
from .json_vellum_value import JsonVellumValue
|
@@ -265,11 +265,11 @@ from .paginated_test_suite_test_case_list import PaginatedTestSuiteTestCaseList
|
|
265
265
|
from .paginated_workflow_release_tag_read_list import PaginatedWorkflowReleaseTagReadList
|
266
266
|
from .pdf_search_result_meta_source import PdfSearchResultMetaSource
|
267
267
|
from .pdf_search_result_meta_source_request import PdfSearchResultMetaSourceRequest
|
268
|
-
from .
|
268
|
+
from .plain_text_prompt_block import PlainTextPromptBlock
|
269
269
|
from .price import Price
|
270
270
|
from .processing_failure_reason_enum import ProcessingFailureReasonEnum
|
271
271
|
from .processing_state_enum import ProcessingStateEnum
|
272
|
-
from .
|
272
|
+
from .prompt_block import PromptBlock
|
273
273
|
from .prompt_block_state import PromptBlockState
|
274
274
|
from .prompt_deployment_expand_meta_request import PromptDeploymentExpandMetaRequest
|
275
275
|
from .prompt_deployment_input_request import PromptDeploymentInputRequest
|
@@ -278,12 +278,12 @@ from .prompt_node_execution_meta import PromptNodeExecutionMeta
|
|
278
278
|
from .prompt_node_result import PromptNodeResult
|
279
279
|
from .prompt_node_result_data import PromptNodeResultData
|
280
280
|
from .prompt_output import PromptOutput
|
281
|
-
from .
|
282
|
-
from .
|
283
|
-
from .
|
284
|
-
from .
|
285
|
-
from .
|
286
|
-
from .
|
281
|
+
from .prompt_parameters import PromptParameters
|
282
|
+
from .prompt_request_chat_history_input import PromptRequestChatHistoryInput
|
283
|
+
from .prompt_request_input import PromptRequestInput
|
284
|
+
from .prompt_request_json_input import PromptRequestJsonInput
|
285
|
+
from .prompt_request_string_input import PromptRequestStringInput
|
286
|
+
from .prompt_settings import PromptSettings
|
287
287
|
from .raw_prompt_execution_overrides_request import RawPromptExecutionOverridesRequest
|
288
288
|
from .reducto_chunker_config import ReductoChunkerConfig
|
289
289
|
from .reducto_chunker_config_request import ReductoChunkerConfigRequest
|
@@ -297,8 +297,8 @@ from .rejected_prompt_execution_meta import RejectedPromptExecutionMeta
|
|
297
297
|
from .rejected_workflow_node_result_event import RejectedWorkflowNodeResultEvent
|
298
298
|
from .release_tag_source import ReleaseTagSource
|
299
299
|
from .replace_test_suite_test_case_request import ReplaceTestSuiteTestCaseRequest
|
300
|
-
from .
|
301
|
-
from .
|
300
|
+
from .rich_text_child_block import RichTextChildBlock
|
301
|
+
from .rich_text_prompt_block import RichTextPromptBlock
|
302
302
|
from .sandbox_scenario import SandboxScenario
|
303
303
|
from .scenario_input import ScenarioInput
|
304
304
|
from .scenario_input_chat_history_variable_value import ScenarioInputChatHistoryVariableValue
|
@@ -434,7 +434,7 @@ from .token_overlapping_window_chunking_request import TokenOverlappingWindowChu
|
|
434
434
|
from .unit_enum import UnitEnum
|
435
435
|
from .upload_document_response import UploadDocumentResponse
|
436
436
|
from .upsert_test_suite_test_case_request import UpsertTestSuiteTestCaseRequest
|
437
|
-
from .
|
437
|
+
from .variable_prompt_block import VariablePromptBlock
|
438
438
|
from .vellum_audio import VellumAudio
|
439
439
|
from .vellum_audio_request import VellumAudioRequest
|
440
440
|
from .vellum_error import VellumError
|
@@ -449,8 +449,6 @@ from .vellum_value_logical_expression_request import VellumValueLogicalExpressio
|
|
449
449
|
from .vellum_value_request import VellumValueRequest
|
450
450
|
from .vellum_variable import VellumVariable
|
451
451
|
from .vellum_variable_extensions import VellumVariableExtensions
|
452
|
-
from .vellum_variable_extensions_request import VellumVariableExtensionsRequest
|
453
|
-
from .vellum_variable_request import VellumVariableRequest
|
454
452
|
from .vellum_variable_type import VellumVariableType
|
455
453
|
from .workflow_deployment_read import WorkflowDeploymentRead
|
456
454
|
from .workflow_event_error import WorkflowEventError
|
@@ -500,7 +498,7 @@ from .workspace_secret_read import WorkspaceSecretRead
|
|
500
498
|
|
501
499
|
__all__ = [
|
502
500
|
"AdHocExecutePromptEvent",
|
503
|
-
"
|
501
|
+
"AdHocExpandMeta",
|
504
502
|
"AdHocFulfilledPromptExecutionMeta",
|
505
503
|
"AdHocInitiatedPromptExecutionMeta",
|
506
504
|
"AdHocRejectedPromptExecutionMeta",
|
@@ -535,8 +533,8 @@ __all__ = [
|
|
535
533
|
"ChatMessage",
|
536
534
|
"ChatMessageContent",
|
537
535
|
"ChatMessageContentRequest",
|
538
|
-
"
|
539
|
-
"
|
536
|
+
"ChatMessagePromptBlock",
|
537
|
+
"ChatMessagePromptBlockProperties",
|
540
538
|
"ChatMessageRequest",
|
541
539
|
"ChatMessageRole",
|
542
540
|
"CodeExecutionNodeArrayResult",
|
@@ -582,7 +580,7 @@ __all__ = [
|
|
582
580
|
"EntityStatus",
|
583
581
|
"EntityVisibility",
|
584
582
|
"EnvironmentEnum",
|
585
|
-
"
|
583
|
+
"EphemeralPromptCacheConfig",
|
586
584
|
"EphemeralPromptCacheConfigTypeEnum",
|
587
585
|
"ErrorInputRequest",
|
588
586
|
"ErrorVariableValue",
|
@@ -632,8 +630,8 @@ __all__ = [
|
|
632
630
|
"FunctionCallVariableValue",
|
633
631
|
"FunctionCallVellumValue",
|
634
632
|
"FunctionCallVellumValueRequest",
|
635
|
-
"
|
636
|
-
"
|
633
|
+
"FunctionDefinitionPromptBlock",
|
634
|
+
"FunctionDefinitionPromptBlockProperties",
|
637
635
|
"GenerateOptionsRequest",
|
638
636
|
"GenerateRequest",
|
639
637
|
"GenerateResponse",
|
@@ -666,8 +664,8 @@ __all__ = [
|
|
666
664
|
"InstructorVectorizerConfig",
|
667
665
|
"InstructorVectorizerConfigRequest",
|
668
666
|
"IterationStateEnum",
|
669
|
-
"
|
670
|
-
"
|
667
|
+
"JinjaPromptBlock",
|
668
|
+
"JinjaPromptBlockProperties",
|
671
669
|
"JsonInputRequest",
|
672
670
|
"JsonVariableValue",
|
673
671
|
"JsonVellumValue",
|
@@ -752,11 +750,11 @@ __all__ = [
|
|
752
750
|
"PaginatedWorkflowReleaseTagReadList",
|
753
751
|
"PdfSearchResultMetaSource",
|
754
752
|
"PdfSearchResultMetaSourceRequest",
|
755
|
-
"
|
753
|
+
"PlainTextPromptBlock",
|
756
754
|
"Price",
|
757
755
|
"ProcessingFailureReasonEnum",
|
758
756
|
"ProcessingStateEnum",
|
759
|
-
"
|
757
|
+
"PromptBlock",
|
760
758
|
"PromptBlockState",
|
761
759
|
"PromptDeploymentExpandMetaRequest",
|
762
760
|
"PromptDeploymentInputRequest",
|
@@ -765,12 +763,12 @@ __all__ = [
|
|
765
763
|
"PromptNodeResult",
|
766
764
|
"PromptNodeResultData",
|
767
765
|
"PromptOutput",
|
768
|
-
"
|
769
|
-
"
|
770
|
-
"
|
771
|
-
"
|
772
|
-
"
|
773
|
-
"
|
766
|
+
"PromptParameters",
|
767
|
+
"PromptRequestChatHistoryInput",
|
768
|
+
"PromptRequestInput",
|
769
|
+
"PromptRequestJsonInput",
|
770
|
+
"PromptRequestStringInput",
|
771
|
+
"PromptSettings",
|
774
772
|
"RawPromptExecutionOverridesRequest",
|
775
773
|
"ReductoChunkerConfig",
|
776
774
|
"ReductoChunkerConfigRequest",
|
@@ -784,8 +782,8 @@ __all__ = [
|
|
784
782
|
"RejectedWorkflowNodeResultEvent",
|
785
783
|
"ReleaseTagSource",
|
786
784
|
"ReplaceTestSuiteTestCaseRequest",
|
787
|
-
"
|
788
|
-
"
|
785
|
+
"RichTextChildBlock",
|
786
|
+
"RichTextPromptBlock",
|
789
787
|
"SandboxScenario",
|
790
788
|
"ScenarioInput",
|
791
789
|
"ScenarioInputChatHistoryVariableValue",
|
@@ -917,7 +915,7 @@ __all__ = [
|
|
917
915
|
"UnitEnum",
|
918
916
|
"UploadDocumentResponse",
|
919
917
|
"UpsertTestSuiteTestCaseRequest",
|
920
|
-
"
|
918
|
+
"VariablePromptBlock",
|
921
919
|
"VellumAudio",
|
922
920
|
"VellumAudioRequest",
|
923
921
|
"VellumError",
|
@@ -932,8 +930,6 @@ __all__ = [
|
|
932
930
|
"VellumValueRequest",
|
933
931
|
"VellumVariable",
|
934
932
|
"VellumVariableExtensions",
|
935
|
-
"VellumVariableExtensionsRequest",
|
936
|
-
"VellumVariableRequest",
|
937
933
|
"VellumVariableType",
|
938
934
|
"WorkflowDeploymentRead",
|
939
935
|
"WorkflowEventError",
|
@@ -6,7 +6,7 @@ import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
7
7
|
|
8
8
|
|
9
|
-
class
|
9
|
+
class AdHocExpandMeta(UniversalBaseModel):
|
10
10
|
cost: typing.Optional[bool] = pydantic.Field(default=None)
|
11
11
|
"""
|
12
12
|
If enabled, the response will include model host cost tracking. This may increase latency for some model hosts.
|
@@ -4,21 +4,21 @@ from __future__ import annotations
|
|
4
4
|
from ..core.pydantic_utilities import UniversalBaseModel
|
5
5
|
import typing
|
6
6
|
from .prompt_block_state import PromptBlockState
|
7
|
-
from .
|
7
|
+
from .ephemeral_prompt_cache_config import EphemeralPromptCacheConfig
|
8
8
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
9
9
|
import pydantic
|
10
10
|
from ..core.pydantic_utilities import update_forward_refs
|
11
11
|
|
12
12
|
|
13
|
-
class
|
13
|
+
class ChatMessagePromptBlock(UniversalBaseModel):
|
14
14
|
"""
|
15
15
|
A block that represents a chat message in a prompt template.
|
16
16
|
"""
|
17
17
|
|
18
18
|
state: typing.Optional[PromptBlockState] = None
|
19
|
-
cache_config: typing.Optional[
|
19
|
+
cache_config: typing.Optional[EphemeralPromptCacheConfig] = None
|
20
20
|
block_type: typing.Literal["CHAT_MESSAGE"] = "CHAT_MESSAGE"
|
21
|
-
properties: "
|
21
|
+
properties: "ChatMessagePromptBlockProperties"
|
22
22
|
|
23
23
|
if IS_PYDANTIC_V2:
|
24
24
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
@@ -30,9 +30,7 @@ class ChatMessagePromptBlockRequest(UniversalBaseModel):
|
|
30
30
|
extra = pydantic.Extra.allow
|
31
31
|
|
32
32
|
|
33
|
-
from .
|
33
|
+
from .chat_message_prompt_block_properties import ChatMessagePromptBlockProperties # noqa: E402
|
34
34
|
|
35
|
-
update_forward_refs(
|
36
|
-
|
37
|
-
)
|
38
|
-
update_forward_refs(ChatMessagePromptBlockRequest)
|
35
|
+
update_forward_refs(ChatMessagePromptBlockProperties, ChatMessagePromptBlock=ChatMessagePromptBlock)
|
36
|
+
update_forward_refs(ChatMessagePromptBlock)
|
@@ -9,12 +9,12 @@ import pydantic
|
|
9
9
|
from ..core.pydantic_utilities import update_forward_refs
|
10
10
|
|
11
11
|
|
12
|
-
class
|
12
|
+
class ChatMessagePromptBlockProperties(UniversalBaseModel):
|
13
13
|
"""
|
14
14
|
The properties of a ChatMessagePromptTemplateBlock
|
15
15
|
"""
|
16
16
|
|
17
|
-
blocks: typing.List["
|
17
|
+
blocks: typing.List["PromptBlock"]
|
18
18
|
chat_role: typing.Optional[ChatMessageRole] = None
|
19
19
|
chat_source: typing.Optional[str] = None
|
20
20
|
chat_message_unterminated: typing.Optional[bool] = None
|
@@ -29,10 +29,8 @@ class ChatMessagePromptBlockPropertiesRequest(UniversalBaseModel):
|
|
29
29
|
extra = pydantic.Extra.allow
|
30
30
|
|
31
31
|
|
32
|
-
from .
|
33
|
-
from .
|
32
|
+
from .chat_message_prompt_block import ChatMessagePromptBlock # noqa: E402
|
33
|
+
from .prompt_block import PromptBlock # noqa: E402
|
34
34
|
|
35
|
-
update_forward_refs(
|
36
|
-
|
37
|
-
)
|
38
|
-
update_forward_refs(ChatMessagePromptBlockPropertiesRequest)
|
35
|
+
update_forward_refs(ChatMessagePromptBlock, ChatMessagePromptBlockProperties=ChatMessagePromptBlockProperties)
|
36
|
+
update_forward_refs(ChatMessagePromptBlockProperties)
|
@@ -7,7 +7,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
7
|
import pydantic
|
8
8
|
|
9
9
|
|
10
|
-
class
|
10
|
+
class EphemeralPromptCacheConfig(UniversalBaseModel):
|
11
11
|
type: typing.Optional[EphemeralPromptCacheConfigTypeEnum] = None
|
12
12
|
|
13
13
|
if IS_PYDANTIC_V2:
|
vellum/types/{function_definition_prompt_block_request.py → function_definition_prompt_block.py}
RENAMED
@@ -3,21 +3,21 @@
|
|
3
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
4
4
|
import typing
|
5
5
|
from .prompt_block_state import PromptBlockState
|
6
|
-
from .
|
7
|
-
from .
|
6
|
+
from .ephemeral_prompt_cache_config import EphemeralPromptCacheConfig
|
7
|
+
from .function_definition_prompt_block_properties import FunctionDefinitionPromptBlockProperties
|
8
8
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
9
9
|
import pydantic
|
10
10
|
|
11
11
|
|
12
|
-
class
|
12
|
+
class FunctionDefinitionPromptBlock(UniversalBaseModel):
|
13
13
|
"""
|
14
14
|
A block that represents a function definition in a prompt template.
|
15
15
|
"""
|
16
16
|
|
17
17
|
state: typing.Optional[PromptBlockState] = None
|
18
|
-
cache_config: typing.Optional[
|
18
|
+
cache_config: typing.Optional[EphemeralPromptCacheConfig] = None
|
19
19
|
block_type: typing.Literal["FUNCTION_DEFINITION"] = "FUNCTION_DEFINITION"
|
20
|
-
properties:
|
20
|
+
properties: FunctionDefinitionPromptBlockProperties
|
21
21
|
|
22
22
|
if IS_PYDANTIC_V2:
|
23
23
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
@@ -6,7 +6,7 @@ import pydantic
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
7
7
|
|
8
8
|
|
9
|
-
class
|
9
|
+
class FunctionDefinitionPromptBlockProperties(UniversalBaseModel):
|
10
10
|
function_name: typing.Optional[str] = pydantic.Field(default=None)
|
11
11
|
"""
|
12
12
|
The name identifying the function.
|
@@ -3,21 +3,21 @@
|
|
3
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
4
4
|
import typing
|
5
5
|
from .prompt_block_state import PromptBlockState
|
6
|
-
from .
|
7
|
-
from .
|
6
|
+
from .ephemeral_prompt_cache_config import EphemeralPromptCacheConfig
|
7
|
+
from .jinja_prompt_block_properties import JinjaPromptBlockProperties
|
8
8
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
9
9
|
import pydantic
|
10
10
|
|
11
11
|
|
12
|
-
class
|
12
|
+
class JinjaPromptBlock(UniversalBaseModel):
|
13
13
|
"""
|
14
14
|
A block of Jinja template code that is used to generate a prompt
|
15
15
|
"""
|
16
16
|
|
17
17
|
state: typing.Optional[PromptBlockState] = None
|
18
|
-
cache_config: typing.Optional[
|
18
|
+
cache_config: typing.Optional[EphemeralPromptCacheConfig] = None
|
19
19
|
block_type: typing.Literal["JINJA"] = "JINJA"
|
20
|
-
properties:
|
20
|
+
properties: JinjaPromptBlockProperties
|
21
21
|
|
22
22
|
if IS_PYDANTIC_V2:
|
23
23
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
@@ -7,7 +7,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
7
7
|
import pydantic
|
8
8
|
|
9
9
|
|
10
|
-
class
|
10
|
+
class JinjaPromptBlockProperties(UniversalBaseModel):
|
11
11
|
template: typing.Optional[str] = None
|
12
12
|
template_type: typing.Optional[VellumVariableType] = None
|
13
13
|
|
@@ -3,18 +3,18 @@
|
|
3
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
4
4
|
import typing
|
5
5
|
from .prompt_block_state import PromptBlockState
|
6
|
-
from .
|
6
|
+
from .ephemeral_prompt_cache_config import EphemeralPromptCacheConfig
|
7
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
8
8
|
import pydantic
|
9
9
|
|
10
10
|
|
11
|
-
class
|
11
|
+
class PlainTextPromptBlock(UniversalBaseModel):
|
12
12
|
"""
|
13
13
|
A block that holds a plain text string value.
|
14
14
|
"""
|
15
15
|
|
16
16
|
state: typing.Optional[PromptBlockState] = None
|
17
|
-
cache_config: typing.Optional[
|
17
|
+
cache_config: typing.Optional[EphemeralPromptCacheConfig] = None
|
18
18
|
block_type: typing.Literal["PLAIN_TEXT"] = "PLAIN_TEXT"
|
19
19
|
text: str
|
20
20
|
|
@@ -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
|
+
]
|
@@ -6,7 +6,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
|
6
6
|
import pydantic
|
7
7
|
|
8
8
|
|
9
|
-
class
|
9
|
+
class PromptParameters(UniversalBaseModel):
|
10
10
|
stop: typing.Optional[typing.List[str]] = None
|
11
11
|
temperature: typing.Optional[float] = None
|
12
12
|
max_tokens: typing.Optional[int] = None
|
vellum/types/{prompt_request_chat_history_input_request.py → prompt_request_chat_history_input.py}
RENAMED
@@ -3,18 +3,18 @@
|
|
3
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
4
4
|
import pydantic
|
5
5
|
import typing
|
6
|
-
from .
|
6
|
+
from .chat_message import ChatMessage
|
7
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
8
8
|
|
9
9
|
|
10
|
-
class
|
10
|
+
class PromptRequestChatHistoryInput(UniversalBaseModel):
|
11
11
|
key: str = pydantic.Field()
|
12
12
|
"""
|
13
13
|
The variable's name, as defined in the Prompt.
|
14
14
|
"""
|
15
15
|
|
16
16
|
type: typing.Literal["CHAT_HISTORY"] = "CHAT_HISTORY"
|
17
|
-
value: typing.List[
|
17
|
+
value: typing.List[ChatMessage]
|
18
18
|
|
19
19
|
if IS_PYDANTIC_V2:
|
20
20
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import typing
|
4
|
+
from .prompt_request_string_input import PromptRequestStringInput
|
5
|
+
from .prompt_request_json_input import PromptRequestJsonInput
|
6
|
+
from .prompt_request_chat_history_input import PromptRequestChatHistoryInput
|
7
|
+
|
8
|
+
PromptRequestInput = typing.Union[PromptRequestStringInput, PromptRequestJsonInput, PromptRequestChatHistoryInput]
|
@@ -6,7 +6,7 @@ import typing
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
7
7
|
|
8
8
|
|
9
|
-
class
|
9
|
+
class PromptRequestJsonInput(UniversalBaseModel):
|
10
10
|
key: str = pydantic.Field()
|
11
11
|
"""
|
12
12
|
The variable's name, as defined in the Prompt.
|
@@ -6,7 +6,7 @@ import typing
|
|
6
6
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
7
7
|
|
8
8
|
|
9
|
-
class
|
9
|
+
class PromptRequestStringInput(UniversalBaseModel):
|
10
10
|
key: str = pydantic.Field()
|
11
11
|
"""
|
12
12
|
The variable's name, as defined in the Prompt.
|
@@ -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]
|
@@ -2,23 +2,22 @@
|
|
2
2
|
|
3
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
4
4
|
import typing
|
5
|
-
from .rich_text_child_block_request import RichTextChildBlockRequest
|
6
5
|
from .prompt_block_state import PromptBlockState
|
7
|
-
from .
|
6
|
+
from .ephemeral_prompt_cache_config import EphemeralPromptCacheConfig
|
7
|
+
from .rich_text_child_block import RichTextChildBlock
|
8
8
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
9
9
|
import pydantic
|
10
10
|
|
11
11
|
|
12
|
-
class
|
12
|
+
class RichTextPromptBlock(UniversalBaseModel):
|
13
13
|
"""
|
14
14
|
A block that includes a combination of plain text and variable blocks.
|
15
15
|
"""
|
16
16
|
|
17
|
-
block_type: typing.Literal["RICH_TEXT"] = "RICH_TEXT"
|
18
|
-
blocks: typing.List[RichTextChildBlockRequest]
|
19
|
-
id: str
|
20
17
|
state: typing.Optional[PromptBlockState] = None
|
21
|
-
cache_config: typing.Optional[
|
18
|
+
cache_config: typing.Optional[EphemeralPromptCacheConfig] = None
|
19
|
+
block_type: typing.Literal["RICH_TEXT"] = "RICH_TEXT"
|
20
|
+
blocks: typing.List[RichTextChildBlock]
|
22
21
|
|
23
22
|
if IS_PYDANTIC_V2:
|
24
23
|
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
@@ -3,18 +3,18 @@
|
|
3
3
|
from ..core.pydantic_utilities import UniversalBaseModel
|
4
4
|
import typing
|
5
5
|
from .prompt_block_state import PromptBlockState
|
6
|
-
from .
|
6
|
+
from .ephemeral_prompt_cache_config import EphemeralPromptCacheConfig
|
7
7
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2
|
8
8
|
import pydantic
|
9
9
|
|
10
10
|
|
11
|
-
class
|
11
|
+
class VariablePromptBlock(UniversalBaseModel):
|
12
12
|
"""
|
13
13
|
A block that represents a variable in a prompt template.
|
14
14
|
"""
|
15
15
|
|
16
16
|
state: typing.Optional[PromptBlockState] = None
|
17
|
-
cache_config: typing.Optional[
|
17
|
+
cache_config: typing.Optional[EphemeralPromptCacheConfig] = None
|
18
18
|
block_type: typing.Literal["VARIABLE"] = "VARIABLE"
|
19
19
|
input_variable_id: str
|
20
20
|
|