vellum-ai 0.3.13__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.13.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.13.dist-info/RECORD +0 -356
- {vellum_ai-0.3.13.dist-info → vellum_ai-0.3.15.dist-info}/LICENSE +0 -0
- {vellum_ai-0.3.13.dist-info → vellum_ai-0.3.15.dist-info}/WHEEL +0 -0
@@ -8,6 +8,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
10
|
from ...core.remove_none_from_dict import remove_none_from_dict
|
11
|
+
from ...core.request_options import RequestOptions
|
11
12
|
from ...types.document_index_read import DocumentIndexRead
|
12
13
|
from ...types.entity_status import EntityStatus
|
13
14
|
from ...types.environment_enum import EnvironmentEnum
|
@@ -34,6 +35,7 @@ class DocumentIndexesClient:
|
|
34
35
|
offset: typing.Optional[int] = None,
|
35
36
|
ordering: typing.Optional[str] = None,
|
36
37
|
status: typing.Optional[DocumentIndexesListRequestStatus] = None,
|
38
|
+
request_options: typing.Optional[RequestOptions] = None,
|
37
39
|
) -> PaginatedDocumentIndexReadList:
|
38
40
|
"""
|
39
41
|
Used to retrieve a list of Document Indexes.
|
@@ -48,7 +50,9 @@ class DocumentIndexesClient:
|
|
48
50
|
- status: typing.Optional[DocumentIndexesListRequestStatus]. The current status of the document index
|
49
51
|
|
50
52
|
- `ACTIVE` - Active
|
51
|
-
- `ARCHIVED` - Archived
|
53
|
+
- `ARCHIVED` - Archived
|
54
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
55
|
+
---
|
52
56
|
from vellum.client import Vellum
|
53
57
|
|
54
58
|
client = Vellum(
|
@@ -59,9 +63,34 @@ class DocumentIndexesClient:
|
|
59
63
|
_response = self._client_wrapper.httpx_client.request(
|
60
64
|
"GET",
|
61
65
|
urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", "v1/document-indexes"),
|
62
|
-
params=
|
63
|
-
|
64
|
-
|
66
|
+
params=jsonable_encoder(
|
67
|
+
remove_none_from_dict(
|
68
|
+
{
|
69
|
+
"limit": limit,
|
70
|
+
"offset": offset,
|
71
|
+
"ordering": ordering,
|
72
|
+
"status": status,
|
73
|
+
**(
|
74
|
+
request_options.get("additional_query_parameters", {})
|
75
|
+
if request_options is not None
|
76
|
+
else {}
|
77
|
+
),
|
78
|
+
}
|
79
|
+
)
|
80
|
+
),
|
81
|
+
headers=jsonable_encoder(
|
82
|
+
remove_none_from_dict(
|
83
|
+
{
|
84
|
+
**self._client_wrapper.get_headers(),
|
85
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
86
|
+
}
|
87
|
+
)
|
88
|
+
),
|
89
|
+
timeout=request_options.get("timeout_in_seconds")
|
90
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
91
|
+
else self._client_wrapper.get_timeout(),
|
92
|
+
retries=0,
|
93
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
65
94
|
)
|
66
95
|
if 200 <= _response.status_code < 300:
|
67
96
|
return pydantic.parse_obj_as(PaginatedDocumentIndexReadList, _response.json()) # type: ignore
|
@@ -80,6 +109,7 @@ class DocumentIndexesClient:
|
|
80
109
|
environment: typing.Optional[EnvironmentEnum] = OMIT,
|
81
110
|
indexing_config: typing.Dict[str, typing.Any],
|
82
111
|
copy_documents_from_index_id: typing.Optional[str] = OMIT,
|
112
|
+
request_options: typing.Optional[RequestOptions] = None,
|
83
113
|
) -> DocumentIndexRead:
|
84
114
|
"""
|
85
115
|
Creates a new document index.
|
@@ -101,6 +131,8 @@ class DocumentIndexesClient:
|
|
101
131
|
- indexing_config: typing.Dict[str, typing.Any]. Configuration representing how documents should be indexed
|
102
132
|
|
103
133
|
- copy_documents_from_index_id: typing.Optional[str]. Optionally specify the id of a document index from which you'd like to copy and re-index its documents into this newly created index
|
134
|
+
|
135
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
104
136
|
---
|
105
137
|
from vellum.client import Vellum
|
106
138
|
|
@@ -112,25 +144,19 @@ class DocumentIndexesClient:
|
|
112
144
|
name="my-document-index",
|
113
145
|
indexing_config={
|
114
146
|
"chunking": {
|
115
|
-
"
|
116
|
-
|
117
|
-
"
|
118
|
-
|
119
|
-
"min_overlap_ratio": 0.5,
|
120
|
-
},
|
147
|
+
"chunker_name": "sentence-chunker",
|
148
|
+
"chunker_config": {
|
149
|
+
"character_limit": 1000,
|
150
|
+
"min_overlap_ratio": 0.5,
|
121
151
|
},
|
122
|
-
"type": "unknown",
|
123
152
|
},
|
124
153
|
"vectorizer": {
|
125
|
-
"
|
126
|
-
|
127
|
-
"
|
128
|
-
|
129
|
-
|
130
|
-
"instruction_query_text_type": "plain_text",
|
131
|
-
},
|
154
|
+
"model_name": "hkunlp/instructor-xl",
|
155
|
+
"config": {
|
156
|
+
"instruction_domain": "",
|
157
|
+
"instruction_document_text_type": "plain_text",
|
158
|
+
"instruction_query_text_type": "plain_text",
|
132
159
|
},
|
133
|
-
"type": "unknown",
|
134
160
|
},
|
135
161
|
},
|
136
162
|
)
|
@@ -145,9 +171,28 @@ class DocumentIndexesClient:
|
|
145
171
|
_response = self._client_wrapper.httpx_client.request(
|
146
172
|
"POST",
|
147
173
|
urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", "v1/document-indexes"),
|
148
|
-
|
149
|
-
|
150
|
-
|
174
|
+
params=jsonable_encoder(
|
175
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
176
|
+
),
|
177
|
+
json=jsonable_encoder(_request)
|
178
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
179
|
+
else {
|
180
|
+
**jsonable_encoder(_request),
|
181
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
182
|
+
},
|
183
|
+
headers=jsonable_encoder(
|
184
|
+
remove_none_from_dict(
|
185
|
+
{
|
186
|
+
**self._client_wrapper.get_headers(),
|
187
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
188
|
+
}
|
189
|
+
)
|
190
|
+
),
|
191
|
+
timeout=request_options.get("timeout_in_seconds")
|
192
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
193
|
+
else self._client_wrapper.get_timeout(),
|
194
|
+
retries=0,
|
195
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
151
196
|
)
|
152
197
|
if 200 <= _response.status_code < 300:
|
153
198
|
return pydantic.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
|
@@ -157,12 +202,14 @@ class DocumentIndexesClient:
|
|
157
202
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
158
203
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
159
204
|
|
160
|
-
def retrieve(self, id: str) -> DocumentIndexRead:
|
205
|
+
def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DocumentIndexRead:
|
161
206
|
"""
|
162
207
|
Used to retrieve a Document Index given its ID or name.
|
163
208
|
|
164
209
|
Parameters:
|
165
210
|
- id: str. Either the Document Index's ID or its unique name
|
211
|
+
|
212
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
166
213
|
---
|
167
214
|
from vellum.client import Vellum
|
168
215
|
|
@@ -175,9 +222,25 @@ class DocumentIndexesClient:
|
|
175
222
|
"""
|
176
223
|
_response = self._client_wrapper.httpx_client.request(
|
177
224
|
"GET",
|
178
|
-
urllib.parse.urljoin(
|
179
|
-
|
180
|
-
|
225
|
+
urllib.parse.urljoin(
|
226
|
+
f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{jsonable_encoder(id)}"
|
227
|
+
),
|
228
|
+
params=jsonable_encoder(
|
229
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
230
|
+
),
|
231
|
+
headers=jsonable_encoder(
|
232
|
+
remove_none_from_dict(
|
233
|
+
{
|
234
|
+
**self._client_wrapper.get_headers(),
|
235
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
236
|
+
}
|
237
|
+
)
|
238
|
+
),
|
239
|
+
timeout=request_options.get("timeout_in_seconds")
|
240
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
241
|
+
else self._client_wrapper.get_timeout(),
|
242
|
+
retries=0,
|
243
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
181
244
|
)
|
182
245
|
if 200 <= _response.status_code < 300:
|
183
246
|
return pydantic.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
|
@@ -194,6 +257,7 @@ class DocumentIndexesClient:
|
|
194
257
|
label: str,
|
195
258
|
status: typing.Optional[EntityStatus] = OMIT,
|
196
259
|
environment: typing.Optional[EnvironmentEnum] = OMIT,
|
260
|
+
request_options: typing.Optional[RequestOptions] = None,
|
197
261
|
) -> DocumentIndexRead:
|
198
262
|
"""
|
199
263
|
Used to fully update a Document Index given its ID.
|
@@ -211,7 +275,9 @@ class DocumentIndexesClient:
|
|
211
275
|
|
212
276
|
* `DEVELOPMENT` - Development
|
213
277
|
* `STAGING` - Staging
|
214
|
-
* `PRODUCTION` - Production
|
278
|
+
* `PRODUCTION` - Production
|
279
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
280
|
+
---
|
215
281
|
from vellum.client import Vellum
|
216
282
|
|
217
283
|
client = Vellum(
|
@@ -229,10 +295,31 @@ class DocumentIndexesClient:
|
|
229
295
|
_request["environment"] = environment
|
230
296
|
_response = self._client_wrapper.httpx_client.request(
|
231
297
|
"PUT",
|
232
|
-
urllib.parse.urljoin(
|
233
|
-
|
234
|
-
|
235
|
-
|
298
|
+
urllib.parse.urljoin(
|
299
|
+
f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{jsonable_encoder(id)}"
|
300
|
+
),
|
301
|
+
params=jsonable_encoder(
|
302
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
303
|
+
),
|
304
|
+
json=jsonable_encoder(_request)
|
305
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
306
|
+
else {
|
307
|
+
**jsonable_encoder(_request),
|
308
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
309
|
+
},
|
310
|
+
headers=jsonable_encoder(
|
311
|
+
remove_none_from_dict(
|
312
|
+
{
|
313
|
+
**self._client_wrapper.get_headers(),
|
314
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
315
|
+
}
|
316
|
+
)
|
317
|
+
),
|
318
|
+
timeout=request_options.get("timeout_in_seconds")
|
319
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
320
|
+
else self._client_wrapper.get_timeout(),
|
321
|
+
retries=0,
|
322
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
236
323
|
)
|
237
324
|
if 200 <= _response.status_code < 300:
|
238
325
|
return pydantic.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
|
@@ -242,12 +329,14 @@ class DocumentIndexesClient:
|
|
242
329
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
243
330
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
244
331
|
|
245
|
-
def destroy(self, id: str) -> None:
|
332
|
+
def destroy(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
246
333
|
"""
|
247
334
|
Used to delete a Document Index given its ID.
|
248
335
|
|
249
336
|
Parameters:
|
250
337
|
- id: str. A UUID string identifying this document index.
|
338
|
+
|
339
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
251
340
|
---
|
252
341
|
from vellum.client import Vellum
|
253
342
|
|
@@ -260,9 +349,25 @@ class DocumentIndexesClient:
|
|
260
349
|
"""
|
261
350
|
_response = self._client_wrapper.httpx_client.request(
|
262
351
|
"DELETE",
|
263
|
-
urllib.parse.urljoin(
|
264
|
-
|
265
|
-
|
352
|
+
urllib.parse.urljoin(
|
353
|
+
f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{jsonable_encoder(id)}"
|
354
|
+
),
|
355
|
+
params=jsonable_encoder(
|
356
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
357
|
+
),
|
358
|
+
headers=jsonable_encoder(
|
359
|
+
remove_none_from_dict(
|
360
|
+
{
|
361
|
+
**self._client_wrapper.get_headers(),
|
362
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
363
|
+
}
|
364
|
+
)
|
365
|
+
),
|
366
|
+
timeout=request_options.get("timeout_in_seconds")
|
367
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
368
|
+
else self._client_wrapper.get_timeout(),
|
369
|
+
retries=0,
|
370
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
266
371
|
)
|
267
372
|
if 200 <= _response.status_code < 300:
|
268
373
|
return
|
@@ -279,6 +384,7 @@ class DocumentIndexesClient:
|
|
279
384
|
label: typing.Optional[str] = OMIT,
|
280
385
|
status: typing.Optional[EntityStatus] = OMIT,
|
281
386
|
environment: typing.Optional[EnvironmentEnum] = OMIT,
|
387
|
+
request_options: typing.Optional[RequestOptions] = None,
|
282
388
|
) -> DocumentIndexRead:
|
283
389
|
"""
|
284
390
|
Used to partial update a Document Index given its ID.
|
@@ -296,7 +402,9 @@ class DocumentIndexesClient:
|
|
296
402
|
|
297
403
|
* `DEVELOPMENT` - Development
|
298
404
|
* `STAGING` - Staging
|
299
|
-
* `PRODUCTION` - Production
|
405
|
+
* `PRODUCTION` - Production
|
406
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
407
|
+
---
|
300
408
|
from vellum.client import Vellum
|
301
409
|
|
302
410
|
client = Vellum(
|
@@ -315,10 +423,31 @@ class DocumentIndexesClient:
|
|
315
423
|
_request["environment"] = environment
|
316
424
|
_response = self._client_wrapper.httpx_client.request(
|
317
425
|
"PATCH",
|
318
|
-
urllib.parse.urljoin(
|
319
|
-
|
320
|
-
|
321
|
-
|
426
|
+
urllib.parse.urljoin(
|
427
|
+
f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{jsonable_encoder(id)}"
|
428
|
+
),
|
429
|
+
params=jsonable_encoder(
|
430
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
431
|
+
),
|
432
|
+
json=jsonable_encoder(_request)
|
433
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
434
|
+
else {
|
435
|
+
**jsonable_encoder(_request),
|
436
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
437
|
+
},
|
438
|
+
headers=jsonable_encoder(
|
439
|
+
remove_none_from_dict(
|
440
|
+
{
|
441
|
+
**self._client_wrapper.get_headers(),
|
442
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
443
|
+
}
|
444
|
+
)
|
445
|
+
),
|
446
|
+
timeout=request_options.get("timeout_in_seconds")
|
447
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
448
|
+
else self._client_wrapper.get_timeout(),
|
449
|
+
retries=0,
|
450
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
322
451
|
)
|
323
452
|
if 200 <= _response.status_code < 300:
|
324
453
|
return pydantic.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
|
@@ -340,6 +469,7 @@ class AsyncDocumentIndexesClient:
|
|
340
469
|
offset: typing.Optional[int] = None,
|
341
470
|
ordering: typing.Optional[str] = None,
|
342
471
|
status: typing.Optional[DocumentIndexesListRequestStatus] = None,
|
472
|
+
request_options: typing.Optional[RequestOptions] = None,
|
343
473
|
) -> PaginatedDocumentIndexReadList:
|
344
474
|
"""
|
345
475
|
Used to retrieve a list of Document Indexes.
|
@@ -354,7 +484,9 @@ class AsyncDocumentIndexesClient:
|
|
354
484
|
- status: typing.Optional[DocumentIndexesListRequestStatus]. The current status of the document index
|
355
485
|
|
356
486
|
- `ACTIVE` - Active
|
357
|
-
- `ARCHIVED` - Archived
|
487
|
+
- `ARCHIVED` - Archived
|
488
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
489
|
+
---
|
358
490
|
from vellum.client import AsyncVellum
|
359
491
|
|
360
492
|
client = AsyncVellum(
|
@@ -365,9 +497,34 @@ class AsyncDocumentIndexesClient:
|
|
365
497
|
_response = await self._client_wrapper.httpx_client.request(
|
366
498
|
"GET",
|
367
499
|
urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", "v1/document-indexes"),
|
368
|
-
params=
|
369
|
-
|
370
|
-
|
500
|
+
params=jsonable_encoder(
|
501
|
+
remove_none_from_dict(
|
502
|
+
{
|
503
|
+
"limit": limit,
|
504
|
+
"offset": offset,
|
505
|
+
"ordering": ordering,
|
506
|
+
"status": status,
|
507
|
+
**(
|
508
|
+
request_options.get("additional_query_parameters", {})
|
509
|
+
if request_options is not None
|
510
|
+
else {}
|
511
|
+
),
|
512
|
+
}
|
513
|
+
)
|
514
|
+
),
|
515
|
+
headers=jsonable_encoder(
|
516
|
+
remove_none_from_dict(
|
517
|
+
{
|
518
|
+
**self._client_wrapper.get_headers(),
|
519
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
520
|
+
}
|
521
|
+
)
|
522
|
+
),
|
523
|
+
timeout=request_options.get("timeout_in_seconds")
|
524
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
525
|
+
else self._client_wrapper.get_timeout(),
|
526
|
+
retries=0,
|
527
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
371
528
|
)
|
372
529
|
if 200 <= _response.status_code < 300:
|
373
530
|
return pydantic.parse_obj_as(PaginatedDocumentIndexReadList, _response.json()) # type: ignore
|
@@ -386,6 +543,7 @@ class AsyncDocumentIndexesClient:
|
|
386
543
|
environment: typing.Optional[EnvironmentEnum] = OMIT,
|
387
544
|
indexing_config: typing.Dict[str, typing.Any],
|
388
545
|
copy_documents_from_index_id: typing.Optional[str] = OMIT,
|
546
|
+
request_options: typing.Optional[RequestOptions] = None,
|
389
547
|
) -> DocumentIndexRead:
|
390
548
|
"""
|
391
549
|
Creates a new document index.
|
@@ -407,6 +565,8 @@ class AsyncDocumentIndexesClient:
|
|
407
565
|
- indexing_config: typing.Dict[str, typing.Any]. Configuration representing how documents should be indexed
|
408
566
|
|
409
567
|
- copy_documents_from_index_id: typing.Optional[str]. Optionally specify the id of a document index from which you'd like to copy and re-index its documents into this newly created index
|
568
|
+
|
569
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
410
570
|
---
|
411
571
|
from vellum.client import AsyncVellum
|
412
572
|
|
@@ -418,25 +578,19 @@ class AsyncDocumentIndexesClient:
|
|
418
578
|
name="my-document-index",
|
419
579
|
indexing_config={
|
420
580
|
"chunking": {
|
421
|
-
"
|
422
|
-
|
423
|
-
"
|
424
|
-
|
425
|
-
"min_overlap_ratio": 0.5,
|
426
|
-
},
|
581
|
+
"chunker_name": "sentence-chunker",
|
582
|
+
"chunker_config": {
|
583
|
+
"character_limit": 1000,
|
584
|
+
"min_overlap_ratio": 0.5,
|
427
585
|
},
|
428
|
-
"type": "unknown",
|
429
586
|
},
|
430
587
|
"vectorizer": {
|
431
|
-
"
|
432
|
-
|
433
|
-
"
|
434
|
-
|
435
|
-
|
436
|
-
"instruction_query_text_type": "plain_text",
|
437
|
-
},
|
588
|
+
"model_name": "hkunlp/instructor-xl",
|
589
|
+
"config": {
|
590
|
+
"instruction_domain": "",
|
591
|
+
"instruction_document_text_type": "plain_text",
|
592
|
+
"instruction_query_text_type": "plain_text",
|
438
593
|
},
|
439
|
-
"type": "unknown",
|
440
594
|
},
|
441
595
|
},
|
442
596
|
)
|
@@ -451,9 +605,28 @@ class AsyncDocumentIndexesClient:
|
|
451
605
|
_response = await self._client_wrapper.httpx_client.request(
|
452
606
|
"POST",
|
453
607
|
urllib.parse.urljoin(f"{self._client_wrapper.get_environment().default}/", "v1/document-indexes"),
|
454
|
-
|
455
|
-
|
456
|
-
|
608
|
+
params=jsonable_encoder(
|
609
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
610
|
+
),
|
611
|
+
json=jsonable_encoder(_request)
|
612
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
613
|
+
else {
|
614
|
+
**jsonable_encoder(_request),
|
615
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
616
|
+
},
|
617
|
+
headers=jsonable_encoder(
|
618
|
+
remove_none_from_dict(
|
619
|
+
{
|
620
|
+
**self._client_wrapper.get_headers(),
|
621
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
622
|
+
}
|
623
|
+
)
|
624
|
+
),
|
625
|
+
timeout=request_options.get("timeout_in_seconds")
|
626
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
627
|
+
else self._client_wrapper.get_timeout(),
|
628
|
+
retries=0,
|
629
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
457
630
|
)
|
458
631
|
if 200 <= _response.status_code < 300:
|
459
632
|
return pydantic.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
|
@@ -463,12 +636,14 @@ class AsyncDocumentIndexesClient:
|
|
463
636
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
464
637
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
465
638
|
|
466
|
-
async def retrieve(self, id: str) -> DocumentIndexRead:
|
639
|
+
async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DocumentIndexRead:
|
467
640
|
"""
|
468
641
|
Used to retrieve a Document Index given its ID or name.
|
469
642
|
|
470
643
|
Parameters:
|
471
644
|
- id: str. Either the Document Index's ID or its unique name
|
645
|
+
|
646
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
472
647
|
---
|
473
648
|
from vellum.client import AsyncVellum
|
474
649
|
|
@@ -481,9 +656,25 @@ class AsyncDocumentIndexesClient:
|
|
481
656
|
"""
|
482
657
|
_response = await self._client_wrapper.httpx_client.request(
|
483
658
|
"GET",
|
484
|
-
urllib.parse.urljoin(
|
485
|
-
|
486
|
-
|
659
|
+
urllib.parse.urljoin(
|
660
|
+
f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{jsonable_encoder(id)}"
|
661
|
+
),
|
662
|
+
params=jsonable_encoder(
|
663
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
664
|
+
),
|
665
|
+
headers=jsonable_encoder(
|
666
|
+
remove_none_from_dict(
|
667
|
+
{
|
668
|
+
**self._client_wrapper.get_headers(),
|
669
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
670
|
+
}
|
671
|
+
)
|
672
|
+
),
|
673
|
+
timeout=request_options.get("timeout_in_seconds")
|
674
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
675
|
+
else self._client_wrapper.get_timeout(),
|
676
|
+
retries=0,
|
677
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
487
678
|
)
|
488
679
|
if 200 <= _response.status_code < 300:
|
489
680
|
return pydantic.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
|
@@ -500,6 +691,7 @@ class AsyncDocumentIndexesClient:
|
|
500
691
|
label: str,
|
501
692
|
status: typing.Optional[EntityStatus] = OMIT,
|
502
693
|
environment: typing.Optional[EnvironmentEnum] = OMIT,
|
694
|
+
request_options: typing.Optional[RequestOptions] = None,
|
503
695
|
) -> DocumentIndexRead:
|
504
696
|
"""
|
505
697
|
Used to fully update a Document Index given its ID.
|
@@ -517,7 +709,9 @@ class AsyncDocumentIndexesClient:
|
|
517
709
|
|
518
710
|
* `DEVELOPMENT` - Development
|
519
711
|
* `STAGING` - Staging
|
520
|
-
* `PRODUCTION` - Production
|
712
|
+
* `PRODUCTION` - Production
|
713
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
714
|
+
---
|
521
715
|
from vellum.client import AsyncVellum
|
522
716
|
|
523
717
|
client = AsyncVellum(
|
@@ -535,10 +729,31 @@ class AsyncDocumentIndexesClient:
|
|
535
729
|
_request["environment"] = environment
|
536
730
|
_response = await self._client_wrapper.httpx_client.request(
|
537
731
|
"PUT",
|
538
|
-
urllib.parse.urljoin(
|
539
|
-
|
540
|
-
|
541
|
-
|
732
|
+
urllib.parse.urljoin(
|
733
|
+
f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{jsonable_encoder(id)}"
|
734
|
+
),
|
735
|
+
params=jsonable_encoder(
|
736
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
737
|
+
),
|
738
|
+
json=jsonable_encoder(_request)
|
739
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
740
|
+
else {
|
741
|
+
**jsonable_encoder(_request),
|
742
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
743
|
+
},
|
744
|
+
headers=jsonable_encoder(
|
745
|
+
remove_none_from_dict(
|
746
|
+
{
|
747
|
+
**self._client_wrapper.get_headers(),
|
748
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
749
|
+
}
|
750
|
+
)
|
751
|
+
),
|
752
|
+
timeout=request_options.get("timeout_in_seconds")
|
753
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
754
|
+
else self._client_wrapper.get_timeout(),
|
755
|
+
retries=0,
|
756
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
542
757
|
)
|
543
758
|
if 200 <= _response.status_code < 300:
|
544
759
|
return pydantic.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
|
@@ -548,12 +763,14 @@ class AsyncDocumentIndexesClient:
|
|
548
763
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
549
764
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
550
765
|
|
551
|
-
async def destroy(self, id: str) -> None:
|
766
|
+
async def destroy(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
552
767
|
"""
|
553
768
|
Used to delete a Document Index given its ID.
|
554
769
|
|
555
770
|
Parameters:
|
556
771
|
- id: str. A UUID string identifying this document index.
|
772
|
+
|
773
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
557
774
|
---
|
558
775
|
from vellum.client import AsyncVellum
|
559
776
|
|
@@ -566,9 +783,25 @@ class AsyncDocumentIndexesClient:
|
|
566
783
|
"""
|
567
784
|
_response = await self._client_wrapper.httpx_client.request(
|
568
785
|
"DELETE",
|
569
|
-
urllib.parse.urljoin(
|
570
|
-
|
571
|
-
|
786
|
+
urllib.parse.urljoin(
|
787
|
+
f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{jsonable_encoder(id)}"
|
788
|
+
),
|
789
|
+
params=jsonable_encoder(
|
790
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
791
|
+
),
|
792
|
+
headers=jsonable_encoder(
|
793
|
+
remove_none_from_dict(
|
794
|
+
{
|
795
|
+
**self._client_wrapper.get_headers(),
|
796
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
797
|
+
}
|
798
|
+
)
|
799
|
+
),
|
800
|
+
timeout=request_options.get("timeout_in_seconds")
|
801
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
802
|
+
else self._client_wrapper.get_timeout(),
|
803
|
+
retries=0,
|
804
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
572
805
|
)
|
573
806
|
if 200 <= _response.status_code < 300:
|
574
807
|
return
|
@@ -585,6 +818,7 @@ class AsyncDocumentIndexesClient:
|
|
585
818
|
label: typing.Optional[str] = OMIT,
|
586
819
|
status: typing.Optional[EntityStatus] = OMIT,
|
587
820
|
environment: typing.Optional[EnvironmentEnum] = OMIT,
|
821
|
+
request_options: typing.Optional[RequestOptions] = None,
|
588
822
|
) -> DocumentIndexRead:
|
589
823
|
"""
|
590
824
|
Used to partial update a Document Index given its ID.
|
@@ -602,7 +836,9 @@ class AsyncDocumentIndexesClient:
|
|
602
836
|
|
603
837
|
* `DEVELOPMENT` - Development
|
604
838
|
* `STAGING` - Staging
|
605
|
-
* `PRODUCTION` - Production
|
839
|
+
* `PRODUCTION` - Production
|
840
|
+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
841
|
+
---
|
606
842
|
from vellum.client import AsyncVellum
|
607
843
|
|
608
844
|
client = AsyncVellum(
|
@@ -621,10 +857,31 @@ class AsyncDocumentIndexesClient:
|
|
621
857
|
_request["environment"] = environment
|
622
858
|
_response = await self._client_wrapper.httpx_client.request(
|
623
859
|
"PATCH",
|
624
|
-
urllib.parse.urljoin(
|
625
|
-
|
626
|
-
|
627
|
-
|
860
|
+
urllib.parse.urljoin(
|
861
|
+
f"{self._client_wrapper.get_environment().default}/", f"v1/document-indexes/{jsonable_encoder(id)}"
|
862
|
+
),
|
863
|
+
params=jsonable_encoder(
|
864
|
+
request_options.get("additional_query_parameters") if request_options is not None else None
|
865
|
+
),
|
866
|
+
json=jsonable_encoder(_request)
|
867
|
+
if request_options is None or request_options.get("additional_body_parameters") is None
|
868
|
+
else {
|
869
|
+
**jsonable_encoder(_request),
|
870
|
+
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
871
|
+
},
|
872
|
+
headers=jsonable_encoder(
|
873
|
+
remove_none_from_dict(
|
874
|
+
{
|
875
|
+
**self._client_wrapper.get_headers(),
|
876
|
+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
877
|
+
}
|
878
|
+
)
|
879
|
+
),
|
880
|
+
timeout=request_options.get("timeout_in_seconds")
|
881
|
+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
882
|
+
else self._client_wrapper.get_timeout(),
|
883
|
+
retries=0,
|
884
|
+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
628
885
|
)
|
629
886
|
if 200 <= _response.status_code < 300:
|
630
887
|
return pydantic.parse_obj_as(DocumentIndexRead, _response.json()) # type: ignore
|