vellum-ai 0.3.14__py3-none-any.whl → 0.3.15__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- vellum/__init__.py +22 -0
- vellum/client.py +846 -100
- vellum/core/__init__.py +8 -0
- vellum/core/client_wrapper.py +27 -8
- vellum/core/file.py +38 -0
- vellum/core/http_client.py +130 -0
- vellum/core/jsonable_encoder.py +2 -2
- vellum/core/request_options.py +32 -0
- vellum/resources/deployments/client.py +161 -24
- vellum/resources/document_indexes/client.py +337 -80
- vellum/resources/documents/client.py +278 -58
- vellum/resources/folder_entities/client.py +60 -10
- vellum/resources/model_versions/client.py +48 -8
- vellum/resources/registered_prompts/client.py +52 -6
- vellum/resources/sandboxes/client.py +108 -26
- vellum/resources/test_suite_runs/client.py +221 -38
- vellum/resources/test_suites/client.py +110 -24
- vellum/resources/workflow_deployments/client.py +110 -14
- vellum/types/__init__.py +20 -0
- vellum/types/api_node_result.py +1 -0
- vellum/types/api_node_result_data.py +4 -2
- vellum/types/array_chat_message_content.py +1 -0
- vellum/types/array_chat_message_content_item.py +6 -5
- vellum/types/array_chat_message_content_item_request.py +6 -5
- vellum/types/array_chat_message_content_request.py +1 -0
- vellum/types/array_enum.py +2 -2
- vellum/types/array_variable_value_item.py +16 -10
- vellum/types/chat_history_enum.py +2 -2
- vellum/types/chat_history_input_request.py +6 -1
- vellum/types/chat_history_variable_value.py +2 -1
- vellum/types/chat_message.py +7 -5
- vellum/types/chat_message_content.py +8 -6
- vellum/types/chat_message_content_request.py +8 -6
- vellum/types/chat_message_request.py +7 -5
- vellum/types/code_execution_node_array_result.py +31 -0
- vellum/types/code_execution_node_chat_history_result.py +2 -1
- vellum/types/code_execution_node_error_result.py +2 -1
- vellum/types/code_execution_node_function_call_result.py +31 -0
- vellum/types/code_execution_node_json_result.py +2 -1
- vellum/types/code_execution_node_number_result.py +2 -1
- vellum/types/code_execution_node_result.py +1 -0
- vellum/types/code_execution_node_result_data.py +2 -1
- vellum/types/code_execution_node_result_output.py +36 -8
- vellum/types/code_execution_node_search_results_result.py +2 -1
- vellum/types/code_execution_node_string_result.py +2 -1
- vellum/types/conditional_node_result.py +1 -0
- vellum/types/conditional_node_result_data.py +2 -1
- vellum/types/deployment_provider_payload_response.py +1 -0
- vellum/types/deployment_read.py +32 -17
- vellum/types/document_document_to_document_index.py +21 -15
- vellum/types/document_index_read.py +32 -19
- vellum/types/document_read.py +34 -24
- vellum/types/document_status.py +2 -2
- vellum/types/enriched_normalized_completion.py +36 -19
- vellum/types/error_enum.py +2 -2
- vellum/types/error_variable_value.py +2 -1
- vellum/types/execute_prompt_api_error_response.py +5 -1
- vellum/types/execute_prompt_event.py +8 -6
- vellum/types/execute_prompt_response.py +4 -4
- vellum/types/execute_workflow_error_response.py +5 -1
- vellum/types/execute_workflow_response.py +3 -2
- vellum/types/execute_workflow_stream_error_response.py +5 -1
- vellum/types/execute_workflow_workflow_result_event.py +4 -4
- vellum/types/execution_array_vellum_value.py +7 -2
- vellum/types/execution_chat_history_vellum_value.py +7 -2
- vellum/types/execution_error_vellum_value.py +7 -2
- vellum/types/execution_function_call_vellum_value.py +7 -2
- vellum/types/execution_json_vellum_value.py +7 -2
- vellum/types/execution_number_vellum_value.py +7 -2
- vellum/types/execution_search_results_vellum_value.py +7 -2
- vellum/types/execution_string_vellum_value.py +7 -2
- vellum/types/execution_vellum_value.py +16 -10
- vellum/types/fulfilled_enum.py +2 -2
- vellum/types/fulfilled_execute_prompt_event.py +2 -1
- vellum/types/fulfilled_execute_prompt_response.py +12 -5
- vellum/types/fulfilled_execute_workflow_workflow_result_event.py +1 -0
- vellum/types/fulfilled_function_call.py +2 -1
- vellum/types/fulfilled_prompt_execution_meta.py +3 -2
- vellum/types/fulfilled_workflow_node_result_event.py +6 -5
- vellum/types/function_call.py +4 -4
- vellum/types/function_call_chat_message_content.py +1 -0
- vellum/types/function_call_chat_message_content_request.py +1 -0
- vellum/types/function_call_chat_message_content_value.py +2 -1
- vellum/types/function_call_chat_message_content_value_request.py +2 -1
- vellum/types/function_call_enum.py +2 -2
- vellum/types/function_call_variable_value.py +1 -0
- vellum/types/generate_error_response.py +5 -1
- vellum/types/generate_options_request.py +8 -5
- vellum/types/generate_request.py +15 -9
- vellum/types/generate_result.py +10 -6
- vellum/types/generate_result_data.py +5 -3
- vellum/types/generate_result_error.py +5 -1
- vellum/types/generate_stream_response.py +1 -0
- vellum/types/generate_stream_result.py +3 -2
- vellum/types/generate_stream_result_data.py +1 -0
- vellum/types/image_chat_message_content.py +1 -0
- vellum/types/image_chat_message_content_request.py +1 -0
- vellum/types/image_enum.py +2 -2
- vellum/types/image_variable_value.py +2 -1
- vellum/types/initiated_enum.py +2 -2
- vellum/types/initiated_execute_prompt_event.py +2 -1
- vellum/types/initiated_prompt_execution_meta.py +5 -4
- vellum/types/initiated_workflow_node_result_event.py +5 -4
- vellum/types/json_enum.py +2 -2
- vellum/types/json_input_request.py +6 -1
- vellum/types/json_variable_value.py +2 -1
- vellum/types/logprobs_enum.py +2 -2
- vellum/types/metadata_filter_config_request.py +7 -6
- vellum/types/metadata_filter_rule_request.py +7 -6
- vellum/types/model_version_build_config.py +12 -7
- vellum/types/model_version_exec_config.py +18 -11
- vellum/types/model_version_exec_config_parameters.py +7 -6
- vellum/types/model_version_read.py +51 -32
- vellum/types/model_version_sandbox_snapshot.py +17 -4
- vellum/types/named_test_case_chat_history_variable_value_request.py +2 -1
- vellum/types/named_test_case_error_variable_value_request.py +2 -1
- vellum/types/named_test_case_json_variable_value_request.py +2 -1
- vellum/types/named_test_case_number_variable_value_request.py +2 -1
- vellum/types/named_test_case_search_results_variable_value_request.py +2 -1
- vellum/types/named_test_case_string_variable_value_request.py +2 -1
- vellum/types/named_test_case_variable_value_request.py +12 -8
- vellum/types/node_input_compiled_array_value.py +2 -1
- vellum/types/node_input_compiled_chat_history_value.py +2 -1
- vellum/types/node_input_compiled_error_value.py +2 -1
- vellum/types/node_input_compiled_function_call.py +32 -0
- vellum/types/node_input_compiled_json_value.py +2 -1
- vellum/types/node_input_compiled_number_value.py +2 -1
- vellum/types/node_input_compiled_search_results_value.py +2 -1
- vellum/types/node_input_compiled_string_value.py +2 -1
- vellum/types/node_input_variable_compiled_value.py +26 -9
- vellum/types/node_output_compiled_array_value.py +2 -1
- vellum/types/node_output_compiled_chat_history_value.py +2 -1
- vellum/types/node_output_compiled_error_value.py +2 -1
- vellum/types/node_output_compiled_function_value.py +2 -1
- vellum/types/node_output_compiled_json_value.py +2 -1
- vellum/types/node_output_compiled_number_value.py +2 -1
- vellum/types/node_output_compiled_search_results_value.py +2 -1
- vellum/types/node_output_compiled_string_value.py +2 -1
- vellum/types/node_output_compiled_value.py +16 -10
- vellum/types/normalized_log_probs.py +2 -1
- vellum/types/normalized_token_log_probs.py +3 -2
- vellum/types/number_enum.py +2 -2
- vellum/types/number_variable_value.py +2 -1
- vellum/types/paginated_document_index_read_list.py +5 -4
- vellum/types/paginated_slim_deployment_read_list.py +5 -4
- vellum/types/paginated_slim_document_list.py +5 -4
- vellum/types/paginated_slim_workflow_deployment_list.py +5 -4
- vellum/types/paginated_test_suite_run_execution_list.py +5 -4
- vellum/types/prompt_deployment_expand_meta_request_request.py +25 -15
- vellum/types/prompt_deployment_input_request.py +6 -5
- vellum/types/prompt_execution_meta.py +6 -5
- vellum/types/prompt_node_result.py +1 -0
- vellum/types/prompt_node_result_data.py +4 -3
- vellum/types/prompt_output.py +8 -6
- vellum/types/prompt_template_block.py +1 -0
- vellum/types/prompt_template_block_data.py +1 -0
- vellum/types/prompt_template_block_data_request.py +1 -0
- vellum/types/prompt_template_block_properties.py +11 -10
- vellum/types/prompt_template_block_properties_request.py +11 -10
- vellum/types/prompt_template_block_request.py +1 -0
- vellum/types/raw_prompt_execution_overrides_request.py +11 -5
- vellum/types/register_prompt_error_response.py +5 -1
- vellum/types/register_prompt_model_parameters_request.py +5 -4
- vellum/types/register_prompt_prompt.py +10 -2
- vellum/types/register_prompt_prompt_info_request.py +5 -3
- vellum/types/register_prompt_response.py +30 -10
- vellum/types/registered_prompt_deployment.py +15 -3
- vellum/types/registered_prompt_input_variable_request.py +3 -2
- vellum/types/registered_prompt_model_version.py +10 -2
- vellum/types/registered_prompt_sandbox.py +10 -2
- vellum/types/registered_prompt_sandbox_snapshot.py +5 -1
- vellum/types/rejected_enum.py +2 -2
- vellum/types/rejected_execute_prompt_event.py +2 -1
- vellum/types/rejected_execute_prompt_response.py +12 -5
- vellum/types/rejected_execute_workflow_workflow_result_event.py +1 -0
- vellum/types/rejected_function_call.py +2 -1
- vellum/types/rejected_prompt_execution_meta.py +3 -2
- vellum/types/rejected_workflow_node_result_event.py +4 -3
- vellum/types/sandbox_scenario.py +11 -3
- vellum/types/scenario_input.py +4 -3
- vellum/types/scenario_input_request.py +4 -3
- vellum/types/search_error_response.py +5 -1
- vellum/types/search_filters_request.py +10 -6
- vellum/types/search_node_result.py +1 -0
- vellum/types/search_node_result_data.py +7 -4
- vellum/types/search_request_options_request.py +20 -8
- vellum/types/search_response.py +5 -3
- vellum/types/search_result.py +15 -5
- vellum/types/search_result_document.py +20 -8
- vellum/types/search_result_document_request.py +15 -7
- vellum/types/search_result_merging_request.py +5 -1
- vellum/types/search_result_request.py +15 -5
- vellum/types/search_results_enum.py +2 -2
- vellum/types/search_results_variable_value.py +2 -1
- vellum/types/search_weights_request.py +10 -4
- vellum/types/slim_deployment_read.py +28 -14
- vellum/types/slim_document.py +56 -35
- vellum/types/slim_workflow_deployment.py +37 -24
- vellum/types/streaming_enum.py +2 -2
- vellum/types/streaming_execute_prompt_event.py +6 -4
- vellum/types/streaming_prompt_execution_meta.py +2 -1
- vellum/types/streaming_workflow_node_result_event.py +6 -5
- vellum/types/string_chat_message_content.py +1 -0
- vellum/types/string_chat_message_content_request.py +1 -0
- vellum/types/string_enum.py +2 -2
- vellum/types/string_input_request.py +6 -1
- vellum/types/string_variable_value.py +2 -1
- vellum/types/submit_completion_actual_request.py +25 -13
- vellum/types/submit_completion_actuals_error_response.py +1 -0
- vellum/types/submit_workflow_execution_actual_request.py +6 -5
- vellum/types/subworkflow_enum.py +2 -2
- vellum/types/subworkflow_node_result.py +1 -0
- vellum/types/templating_node_array_result.py +31 -0
- vellum/types/templating_node_chat_history_result.py +2 -1
- vellum/types/templating_node_error_result.py +2 -1
- vellum/types/templating_node_function_call_result.py +31 -0
- vellum/types/templating_node_json_result.py +2 -1
- vellum/types/templating_node_number_result.py +2 -1
- vellum/types/templating_node_result.py +1 -0
- vellum/types/templating_node_result_data.py +1 -0
- vellum/types/templating_node_result_output.py +36 -8
- vellum/types/templating_node_search_results_result.py +2 -1
- vellum/types/templating_node_string_result.py +2 -1
- vellum/types/terminal_node_array_result.py +8 -3
- vellum/types/terminal_node_chat_history_result.py +8 -3
- vellum/types/terminal_node_error_result.py +8 -3
- vellum/types/terminal_node_function_call_result.py +8 -3
- vellum/types/terminal_node_json_result.py +8 -3
- vellum/types/terminal_node_number_result.py +8 -3
- vellum/types/terminal_node_result.py +1 -0
- vellum/types/terminal_node_result_data.py +1 -0
- vellum/types/terminal_node_result_output.py +16 -10
- vellum/types/terminal_node_search_results_result.py +8 -3
- vellum/types/terminal_node_string_result.py +8 -3
- vellum/types/test_case_chat_history_variable_value.py +2 -1
- vellum/types/test_case_error_variable_value.py +2 -1
- vellum/types/test_case_json_variable_value.py +2 -1
- vellum/types/test_case_number_variable_value.py +2 -1
- vellum/types/test_case_search_results_variable_value.py +2 -1
- vellum/types/test_case_string_variable_value.py +2 -1
- vellum/types/test_case_variable_value.py +12 -8
- vellum/types/test_suite_run_deployment_release_tag_exec_config.py +5 -3
- vellum/types/test_suite_run_deployment_release_tag_exec_config_data.py +10 -4
- vellum/types/test_suite_run_deployment_release_tag_exec_config_data_request.py +10 -4
- vellum/types/test_suite_run_deployment_release_tag_exec_config_request.py +5 -3
- vellum/types/test_suite_run_deployment_release_tag_exec_config_type_enum.py +2 -2
- vellum/types/test_suite_run_exec_config.py +4 -4
- vellum/types/test_suite_run_exec_config_request.py +4 -4
- vellum/types/test_suite_run_execution.py +1 -0
- vellum/types/test_suite_run_execution_chat_history_output.py +2 -1
- vellum/types/test_suite_run_execution_error_output.py +2 -1
- vellum/types/test_suite_run_execution_json_output.py +2 -1
- vellum/types/test_suite_run_execution_metric_result.py +1 -0
- vellum/types/test_suite_run_execution_number_output.py +2 -1
- vellum/types/test_suite_run_execution_output.py +12 -8
- vellum/types/test_suite_run_execution_search_results_output.py +2 -1
- vellum/types/test_suite_run_execution_string_output.py +2 -1
- vellum/types/test_suite_run_metric_error_output.py +1 -0
- vellum/types/test_suite_run_metric_error_output_type_enum.py +2 -2
- vellum/types/test_suite_run_metric_number_output.py +1 -0
- vellum/types/test_suite_run_metric_number_output_type_enum.py +2 -2
- vellum/types/test_suite_run_metric_output.py +4 -4
- vellum/types/test_suite_run_read.py +16 -14
- vellum/types/test_suite_run_test_suite.py +1 -0
- vellum/types/test_suite_run_workflow_release_tag_exec_config.py +5 -3
- vellum/types/test_suite_run_workflow_release_tag_exec_config_data.py +10 -6
- vellum/types/test_suite_run_workflow_release_tag_exec_config_data_request.py +10 -6
- vellum/types/test_suite_run_workflow_release_tag_exec_config_request.py +5 -3
- vellum/types/test_suite_run_workflow_release_tag_exec_config_type_enum.py +2 -2
- vellum/types/test_suite_test_case.py +3 -2
- vellum/types/upload_document_error_response.py +1 -0
- vellum/types/upload_document_response.py +5 -1
- vellum/types/vellum_error.py +1 -0
- vellum/types/vellum_error_request.py +1 -0
- vellum/types/vellum_image.py +2 -1
- vellum/types/vellum_image_request.py +2 -1
- vellum/types/vellum_variable.py +1 -0
- vellum/types/workflow_deployment_read.py +37 -24
- vellum/types/workflow_event_error.py +1 -0
- vellum/types/workflow_execution_actual_chat_history_request.py +25 -15
- vellum/types/workflow_execution_actual_json_request.py +25 -15
- vellum/types/workflow_execution_actual_string_request.py +25 -15
- vellum/types/workflow_execution_node_result_event.py +3 -2
- vellum/types/workflow_execution_workflow_result_event.py +3 -2
- vellum/types/workflow_node_result_data.py +16 -10
- vellum/types/workflow_node_result_event.py +8 -6
- vellum/types/workflow_output.py +18 -11
- vellum/types/workflow_output_array.py +7 -2
- vellum/types/workflow_output_chat_history.py +7 -2
- vellum/types/workflow_output_error.py +7 -2
- vellum/types/workflow_output_function_call.py +7 -2
- vellum/types/workflow_output_image.py +7 -2
- vellum/types/workflow_output_json.py +7 -2
- vellum/types/workflow_output_number.py +7 -2
- vellum/types/workflow_output_search_results.py +7 -2
- vellum/types/workflow_output_string.py +7 -2
- vellum/types/workflow_request_chat_history_input_request.py +6 -1
- vellum/types/workflow_request_input_request.py +8 -6
- vellum/types/workflow_request_json_input_request.py +6 -1
- vellum/types/workflow_request_number_input_request.py +6 -1
- vellum/types/workflow_request_string_input_request.py +6 -1
- vellum/types/workflow_result_event.py +5 -4
- vellum/types/workflow_result_event_output_data.py +16 -10
- vellum/types/workflow_result_event_output_data_array.py +8 -5
- vellum/types/workflow_result_event_output_data_chat_history.py +8 -5
- vellum/types/workflow_result_event_output_data_error.py +8 -5
- vellum/types/workflow_result_event_output_data_function_call.py +8 -5
- vellum/types/workflow_result_event_output_data_json.py +8 -5
- vellum/types/workflow_result_event_output_data_number.py +8 -5
- vellum/types/workflow_result_event_output_data_search_results.py +8 -5
- vellum/types/workflow_result_event_output_data_string.py +11 -7
- vellum/types/workflow_stream_event.py +4 -4
- vellum/version.py +4 -0
- {vellum_ai-0.3.14.dist-info → vellum_ai-0.3.15.dist-info}/METADATA +4 -4
- vellum_ai-0.3.15.dist-info/RECORD +365 -0
- vellum_ai-0.3.14.dist-info/RECORD +0 -356
- {vellum_ai-0.3.14.dist-info → vellum_ai-0.3.15.dist-info}/LICENSE +0 -0
- {vellum_ai-0.3.14.dist-info → vellum_ai-0.3.15.dist-info}/WHEEL +0 -0
@@ -1,10 +1,14 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
+
import typing
|
3
4
|
import urllib.parse
|
4
5
|
from json.decoder import JSONDecodeError
|
5
6
|
|
6
7
|
from ...core.api_error import ApiError
|
7
8
|
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
9
|
+
from ...core.jsonable_encoder import jsonable_encoder
|
10
|
+
from ...core.remove_none_from_dict import remove_none_from_dict
|
11
|
+
from ...core.request_options import RequestOptions
|
8
12
|
from ...types.model_version_read import ModelVersionRead
|
9
13
|
|
10
14
|
try:
|
@@ -17,12 +21,14 @@ class ModelVersionsClient:
|
|
17
21
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
18
22
|
self._client_wrapper = client_wrapper
|
19
23
|
|
20
|
-
def retrieve(self, id: str) -> ModelVersionRead:
|
24
|
+
def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ModelVersionRead:
|
21
25
|
"""
|
22
26
|
Deprecated. Use the `deployments/provider-payload` endpoint to fetch information that we send to Model providers.
|
23
27
|
|
24
28
|
Parameters:
|
25
29
|
- id: str. A UUID string identifying this model version.
|
30
|
+
|
31
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
26
32
|
---
|
27
33
|
from vellum.client import Vellum
|
28
34
|
|
@@ -35,9 +41,25 @@ class ModelVersionsClient:
|
|
35
41
|
"""
|
36
42
|
_response = self._client_wrapper.httpx_client.request(
|
37
43
|
"GET",
|
38
|
-
urllib.parse.urljoin(
|
39
|
-
|
40
|
-
|
44
|
+
urllib.parse.urljoin(
|
45
|
+
f"{self._client_wrapper.get_environment().default}/", f"v1/model-versions/{jsonable_encoder(id)}"
|
46
|
+
),
|
47
|
+
params=jsonable_encoder(
|
48
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
49
|
+
),
|
50
|
+
headers=jsonable_encoder(
|
51
|
+
remove_none_from_dict(
|
52
|
+
{
|
53
|
+
**self._client_wrapper.get_headers(),
|
54
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
55
|
+
}
|
56
|
+
)
|
57
|
+
),
|
58
|
+
timeout=request_options.get("timeout_in_seconds")
|
59
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
60
|
+
else self._client_wrapper.get_timeout(),
|
61
|
+
retries=0,
|
62
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
41
63
|
)
|
42
64
|
if 200 <= _response.status_code < 300:
|
43
65
|
return pydantic.parse_obj_as(ModelVersionRead, _response.json()) # type: ignore
|
@@ -52,12 +74,14 @@ class AsyncModelVersionsClient:
|
|
52
74
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
53
75
|
self._client_wrapper = client_wrapper
|
54
76
|
|
55
|
-
async def retrieve(self, id: str) -> ModelVersionRead:
|
77
|
+
async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ModelVersionRead:
|
56
78
|
"""
|
57
79
|
Deprecated. Use the `deployments/provider-payload` endpoint to fetch information that we send to Model providers.
|
58
80
|
|
59
81
|
Parameters:
|
60
82
|
- id: str. A UUID string identifying this model version.
|
83
|
+
|
84
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
61
85
|
---
|
62
86
|
from vellum.client import AsyncVellum
|
63
87
|
|
@@ -70,9 +94,25 @@ class AsyncModelVersionsClient:
|
|
70
94
|
"""
|
71
95
|
_response = await self._client_wrapper.httpx_client.request(
|
72
96
|
"GET",
|
73
|
-
urllib.parse.urljoin(
|
74
|
-
|
75
|
-
|
97
|
+
urllib.parse.urljoin(
|
98
|
+
f"{self._client_wrapper.get_environment().default}/", f"v1/model-versions/{jsonable_encoder(id)}"
|
99
|
+
),
|
100
|
+
params=jsonable_encoder(
|
101
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
102
|
+
),
|
103
|
+
headers=jsonable_encoder(
|
104
|
+
remove_none_from_dict(
|
105
|
+
{
|
106
|
+
**self._client_wrapper.get_headers(),
|
107
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
108
|
+
}
|
109
|
+
)
|
110
|
+
),
|
111
|
+
timeout=request_options.get("timeout_in_seconds")
|
112
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
113
|
+
else self._client_wrapper.get_timeout(),
|
114
|
+
retries=0,
|
115
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
76
116
|
)
|
77
117
|
if 200 <= _response.status_code < 300:
|
78
118
|
return pydantic.parse_obj_as(ModelVersionRead, _response.json()) # type: ignore
|
@@ -7,6 +7,8 @@ from json.decoder import JSONDecodeError
|
|
7
7
|
from ...core.api_error import ApiError
|
8
8
|
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
9
9
|
from ...core.jsonable_encoder import jsonable_encoder
|
10
|
+
from ...core.remove_none_from_dict import remove_none_from_dict
|
11
|
+
from ...core.request_options import RequestOptions
|
10
12
|
from ...errors.bad_request_error import BadRequestError
|
11
13
|
from ...errors.conflict_error import ConflictError
|
12
14
|
from ...errors.not_found_error import NotFoundError
|
@@ -39,6 +41,7 @@ class RegisteredPromptsClient:
|
|
39
41
|
model: str,
|
40
42
|
parameters: RegisterPromptModelParametersRequest,
|
41
43
|
meta: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
44
|
+
request_options: typing.Optional[RequestOptions] = None,
|
42
45
|
) -> RegisterPromptResponse:
|
43
46
|
"""
|
44
47
|
Registers a prompt within Vellum and creates associated Vellum entities. Intended to be used by integration
|
@@ -73,6 +76,8 @@ class RegisteredPromptsClient:
|
|
73
76
|
- parameters: RegisterPromptModelParametersRequest. The initial model parameters to use for this prompt
|
74
77
|
|
75
78
|
- meta: typing.Optional[typing.Dict[str, typing.Any]]. Optionally include additional metadata to store along with the prompt.
|
79
|
+
|
80
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
76
81
|
---
|
77
82
|
from vellum import (
|
78
83
|
BlockTypeEnum,
|
@@ -134,9 +139,28 @@ class RegisteredPromptsClient:
|
|
134
139
|
urllib.parse.urljoin(
|
135
140
|
f"{self._client_wrapper.get_environment().default}/", "v1/registered-prompts/register"
|
136
141
|
),
|
137
|
-
|
138
|
-
|
139
|
-
|
142
|
+
params=jsonable_encoder(
|
143
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
144
|
+
),
|
145
|
+
json=jsonable_encoder(_request)
|
146
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
147
|
+
else {
|
148
|
+
**jsonable_encoder(_request),
|
149
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
150
|
+
},
|
151
|
+
headers=jsonable_encoder(
|
152
|
+
remove_none_from_dict(
|
153
|
+
{
|
154
|
+
**self._client_wrapper.get_headers(),
|
155
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
156
|
+
}
|
157
|
+
)
|
158
|
+
),
|
159
|
+
timeout=request_options.get("timeout_in_seconds")
|
160
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
161
|
+
else self._client_wrapper.get_timeout(),
|
162
|
+
retries=0,
|
163
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
140
164
|
)
|
141
165
|
if 200 <= _response.status_code < 300:
|
142
166
|
return pydantic.parse_obj_as(RegisterPromptResponse, _response.json()) # type: ignore
|
@@ -167,6 +191,7 @@ class AsyncRegisteredPromptsClient:
|
|
167
191
|
model: str,
|
168
192
|
parameters: RegisterPromptModelParametersRequest,
|
169
193
|
meta: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
194
|
+
request_options: typing.Optional[RequestOptions] = None,
|
170
195
|
) -> RegisterPromptResponse:
|
171
196
|
"""
|
172
197
|
Registers a prompt within Vellum and creates associated Vellum entities. Intended to be used by integration
|
@@ -201,6 +226,8 @@ class AsyncRegisteredPromptsClient:
|
|
201
226
|
- parameters: RegisterPromptModelParametersRequest. The initial model parameters to use for this prompt
|
202
227
|
|
203
228
|
- meta: typing.Optional[typing.Dict[str, typing.Any]]. Optionally include additional metadata to store along with the prompt.
|
229
|
+
|
230
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
204
231
|
---
|
205
232
|
from vellum import (
|
206
233
|
BlockTypeEnum,
|
@@ -262,9 +289,28 @@ class AsyncRegisteredPromptsClient:
|
|
262
289
|
urllib.parse.urljoin(
|
263
290
|
f"{self._client_wrapper.get_environment().default}/", "v1/registered-prompts/register"
|
264
291
|
),
|
265
|
-
|
266
|
-
|
267
|
-
|
292
|
+
params=jsonable_encoder(
|
293
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
294
|
+
),
|
295
|
+
json=jsonable_encoder(_request)
|
296
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
297
|
+
else {
|
298
|
+
**jsonable_encoder(_request),
|
299
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
300
|
+
},
|
301
|
+
headers=jsonable_encoder(
|
302
|
+
remove_none_from_dict(
|
303
|
+
{
|
304
|
+
**self._client_wrapper.get_headers(),
|
305
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
306
|
+
}
|
307
|
+
)
|
308
|
+
),
|
309
|
+
timeout=request_options.get("timeout_in_seconds")
|
310
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
311
|
+
else self._client_wrapper.get_timeout(),
|
312
|
+
retries=0,
|
313
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
268
314
|
)
|
269
315
|
if 200 <= _response.status_code < 300:
|
270
316
|
return pydantic.parse_obj_as(RegisterPromptResponse, _response.json()) # type: ignore
|
@@ -7,6 +7,8 @@ from json.decoder import JSONDecodeError
|
|
7
7
|
from ...core.api_error import ApiError
|
8
8
|
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
9
9
|
from ...core.jsonable_encoder import jsonable_encoder
|
10
|
+
from ...core.remove_none_from_dict import remove_none_from_dict
|
11
|
+
from ...core.request_options import RequestOptions
|
10
12
|
from ...types.sandbox_scenario import SandboxScenario
|
11
13
|
from ...types.scenario_input_request import ScenarioInputRequest
|
12
14
|
|
@@ -28,8 +30,9 @@ class SandboxesClient:
|
|
28
30
|
id: str,
|
29
31
|
*,
|
30
32
|
label: typing.Optional[str] = OMIT,
|
31
|
-
inputs: typing.
|
33
|
+
inputs: typing.Sequence[ScenarioInputRequest],
|
32
34
|
scenario_id: typing.Optional[str] = OMIT,
|
35
|
+
request_options: typing.Optional[RequestOptions] = None,
|
33
36
|
) -> SandboxScenario:
|
34
37
|
"""
|
35
38
|
Upserts a new scenario for a sandbox, keying off of the optionally provided scenario id.
|
@@ -45,9 +48,11 @@ class SandboxesClient:
|
|
45
48
|
|
46
49
|
- label: typing.Optional[str].
|
47
50
|
|
48
|
-
- inputs: typing.
|
51
|
+
- inputs: typing.Sequence[ScenarioInputRequest]. The inputs for the scenario
|
49
52
|
|
50
53
|
- scenario_id: typing.Optional[str]. The id of the scenario to update. If none is provided, an id will be generated and a new scenario will be appended.
|
54
|
+
|
55
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
51
56
|
---
|
52
57
|
from vellum import ScenarioInputRequest, ScenarioInputTypeEnum
|
53
58
|
from vellum.client import Vellum
|
@@ -69,9 +74,6 @@ class SandboxesClient:
|
|
69
74
|
type=ScenarioInputTypeEnum.TEXT,
|
70
75
|
value="Why hello, there!",
|
71
76
|
),
|
72
|
-
ScenarioInputRequest(
|
73
|
-
key="key",
|
74
|
-
),
|
75
77
|
],
|
76
78
|
)
|
77
79
|
"""
|
@@ -82,10 +84,31 @@ class SandboxesClient:
|
|
82
84
|
_request["scenario_id"] = scenario_id
|
83
85
|
_response = self._client_wrapper.httpx_client.request(
|
84
86
|
"POST",
|
85
|
-
urllib.parse.urljoin(
|
86
|
-
|
87
|
-
|
88
|
-
|
87
|
+
urllib.parse.urljoin(
|
88
|
+
f"{self._client_wrapper.get_environment().default}/", f"v1/sandboxes/{jsonable_encoder(id)}/scenarios"
|
89
|
+
),
|
90
|
+
params=jsonable_encoder(
|
91
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
92
|
+
),
|
93
|
+
json=jsonable_encoder(_request)
|
94
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
95
|
+
else {
|
96
|
+
**jsonable_encoder(_request),
|
97
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
98
|
+
},
|
99
|
+
headers=jsonable_encoder(
|
100
|
+
remove_none_from_dict(
|
101
|
+
{
|
102
|
+
**self._client_wrapper.get_headers(),
|
103
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
104
|
+
}
|
105
|
+
)
|
106
|
+
),
|
107
|
+
timeout=request_options.get("timeout_in_seconds")
|
108
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
109
|
+
else self._client_wrapper.get_timeout(),
|
110
|
+
retries=0,
|
111
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
89
112
|
)
|
90
113
|
if 200 <= _response.status_code < 300:
|
91
114
|
return pydantic.parse_obj_as(SandboxScenario, _response.json()) # type: ignore
|
@@ -95,7 +118,9 @@ class SandboxesClient:
|
|
95
118
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
96
119
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
97
120
|
|
98
|
-
def delete_sandbox_scenario(
|
121
|
+
def delete_sandbox_scenario(
|
122
|
+
self, id: str, scenario_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
123
|
+
) -> None:
|
99
124
|
"""
|
100
125
|
Deletes an existing scenario from a sandbox, keying off of the provided scenario id.
|
101
126
|
|
@@ -103,6 +128,8 @@ class SandboxesClient:
|
|
103
128
|
- id: str. A UUID string identifying this sandbox.
|
104
129
|
|
105
130
|
- scenario_id: str. An id identifying the scenario that you'd like to delete
|
131
|
+
|
132
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
106
133
|
---
|
107
134
|
from vellum.client import Vellum
|
108
135
|
|
@@ -117,10 +144,25 @@ class SandboxesClient:
|
|
117
144
|
_response = self._client_wrapper.httpx_client.request(
|
118
145
|
"DELETE",
|
119
146
|
urllib.parse.urljoin(
|
120
|
-
f"{self._client_wrapper.get_environment().default}/",
|
147
|
+
f"{self._client_wrapper.get_environment().default}/",
|
148
|
+
f"v1/sandboxes/{jsonable_encoder(id)}/scenarios/{jsonable_encoder(scenario_id)}",
|
149
|
+
),
|
150
|
+
params=jsonable_encoder(
|
151
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
152
|
+
),
|
153
|
+
headers=jsonable_encoder(
|
154
|
+
remove_none_from_dict(
|
155
|
+
{
|
156
|
+
**self._client_wrapper.get_headers(),
|
157
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
158
|
+
}
|
159
|
+
)
|
121
160
|
),
|
122
|
-
|
123
|
-
|
161
|
+
timeout=request_options.get("timeout_in_seconds")
|
162
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
163
|
+
else self._client_wrapper.get_timeout(),
|
164
|
+
retries=0,
|
165
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
124
166
|
)
|
125
167
|
if 200 <= _response.status_code < 300:
|
126
168
|
return
|
@@ -140,8 +182,9 @@ class AsyncSandboxesClient:
|
|
140
182
|
id: str,
|
141
183
|
*,
|
142
184
|
label: typing.Optional[str] = OMIT,
|
143
|
-
inputs: typing.
|
185
|
+
inputs: typing.Sequence[ScenarioInputRequest],
|
144
186
|
scenario_id: typing.Optional[str] = OMIT,
|
187
|
+
request_options: typing.Optional[RequestOptions] = None,
|
145
188
|
) -> SandboxScenario:
|
146
189
|
"""
|
147
190
|
Upserts a new scenario for a sandbox, keying off of the optionally provided scenario id.
|
@@ -157,9 +200,11 @@ class AsyncSandboxesClient:
|
|
157
200
|
|
158
201
|
- label: typing.Optional[str].
|
159
202
|
|
160
|
-
- inputs: typing.
|
203
|
+
- inputs: typing.Sequence[ScenarioInputRequest]. The inputs for the scenario
|
161
204
|
|
162
205
|
- scenario_id: typing.Optional[str]. The id of the scenario to update. If none is provided, an id will be generated and a new scenario will be appended.
|
206
|
+
|
207
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
163
208
|
---
|
164
209
|
from vellum import ScenarioInputRequest, ScenarioInputTypeEnum
|
165
210
|
from vellum.client import AsyncVellum
|
@@ -181,9 +226,6 @@ class AsyncSandboxesClient:
|
|
181
226
|
type=ScenarioInputTypeEnum.TEXT,
|
182
227
|
value="Why hello, there!",
|
183
228
|
),
|
184
|
-
ScenarioInputRequest(
|
185
|
-
key="key",
|
186
|
-
),
|
187
229
|
],
|
188
230
|
)
|
189
231
|
"""
|
@@ -194,10 +236,31 @@ class AsyncSandboxesClient:
|
|
194
236
|
_request["scenario_id"] = scenario_id
|
195
237
|
_response = await self._client_wrapper.httpx_client.request(
|
196
238
|
"POST",
|
197
|
-
urllib.parse.urljoin(
|
198
|
-
|
199
|
-
|
200
|
-
|
239
|
+
urllib.parse.urljoin(
|
240
|
+
f"{self._client_wrapper.get_environment().default}/", f"v1/sandboxes/{jsonable_encoder(id)}/scenarios"
|
241
|
+
),
|
242
|
+
params=jsonable_encoder(
|
243
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
244
|
+
),
|
245
|
+
json=jsonable_encoder(_request)
|
246
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
247
|
+
else {
|
248
|
+
**jsonable_encoder(_request),
|
249
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
250
|
+
},
|
251
|
+
headers=jsonable_encoder(
|
252
|
+
remove_none_from_dict(
|
253
|
+
{
|
254
|
+
**self._client_wrapper.get_headers(),
|
255
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
256
|
+
}
|
257
|
+
)
|
258
|
+
),
|
259
|
+
timeout=request_options.get("timeout_in_seconds")
|
260
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
261
|
+
else self._client_wrapper.get_timeout(),
|
262
|
+
retries=0,
|
263
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
201
264
|
)
|
202
265
|
if 200 <= _response.status_code < 300:
|
203
266
|
return pydantic.parse_obj_as(SandboxScenario, _response.json()) # type: ignore
|
@@ -207,7 +270,9 @@ class AsyncSandboxesClient:
|
|
207
270
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
208
271
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
209
272
|
|
210
|
-
async def delete_sandbox_scenario(
|
273
|
+
async def delete_sandbox_scenario(
|
274
|
+
self, id: str, scenario_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
275
|
+
) -> None:
|
211
276
|
"""
|
212
277
|
Deletes an existing scenario from a sandbox, keying off of the provided scenario id.
|
213
278
|
|
@@ -215,6 +280,8 @@ class AsyncSandboxesClient:
|
|
215
280
|
- id: str. A UUID string identifying this sandbox.
|
216
281
|
|
217
282
|
- scenario_id: str. An id identifying the scenario that you'd like to delete
|
283
|
+
|
284
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
218
285
|
---
|
219
286
|
from vellum.client import AsyncVellum
|
220
287
|
|
@@ -229,10 +296,25 @@ class AsyncSandboxesClient:
|
|
229
296
|
_response = await self._client_wrapper.httpx_client.request(
|
230
297
|
"DELETE",
|
231
298
|
urllib.parse.urljoin(
|
232
|
-
f"{self._client_wrapper.get_environment().default}/",
|
299
|
+
f"{self._client_wrapper.get_environment().default}/",
|
300
|
+
f"v1/sandboxes/{jsonable_encoder(id)}/scenarios/{jsonable_encoder(scenario_id)}",
|
301
|
+
),
|
302
|
+
params=jsonable_encoder(
|
303
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
304
|
+
),
|
305
|
+
headers=jsonable_encoder(
|
306
|
+
remove_none_from_dict(
|
307
|
+
{
|
308
|
+
**self._client_wrapper.get_headers(),
|
309
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
310
|
+
}
|
311
|
+
)
|
233
312
|
),
|
234
|
-
|
235
|
-
|
313
|
+
timeout=request_options.get("timeout_in_seconds")
|
314
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
315
|
+
else self._client_wrapper.get_timeout(),
|
316
|
+
retries=0,
|
317
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
236
318
|
)
|
237
319
|
if 200 <= _response.status_code < 300:
|
238
320
|
return
|