vellum-ai 0.5.1__py3-none-any.whl → 0.6.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. vellum/__init__.py +170 -20
  2. vellum/core/client_wrapper.py +1 -1
  3. vellum/resources/document_indexes/client.py +61 -52
  4. vellum/resources/documents/client.py +8 -4
  5. vellum/types/__init__.py +189 -19
  6. vellum/types/add_openai_api_key_enum.py +3 -0
  7. vellum/types/array_variable_value_item.py +0 -24
  8. vellum/types/array_vellum_value_item.py +82 -0
  9. vellum/types/basic_vectorizer_intfloat_multilingual_e_5_large.py +29 -0
  10. vellum/types/basic_vectorizer_intfloat_multilingual_e_5_large_request.py +29 -0
  11. vellum/types/basic_vectorizer_sentence_transformers_multi_qa_mpnet_base_cos_v_1.py +29 -0
  12. vellum/types/basic_vectorizer_sentence_transformers_multi_qa_mpnet_base_cos_v_1_request.py +29 -0
  13. vellum/types/basic_vectorizer_sentence_transformers_multi_qa_mpnet_base_dot_v_1.py +29 -0
  14. vellum/types/basic_vectorizer_sentence_transformers_multi_qa_mpnet_base_dot_v_1_request.py +29 -0
  15. vellum/types/document_index_chunking.py +46 -0
  16. vellum/types/document_index_chunking_request.py +46 -0
  17. vellum/types/document_index_indexing_config.py +28 -0
  18. vellum/types/document_index_indexing_config_request.py +28 -0
  19. vellum/types/document_index_read.py +2 -4
  20. vellum/types/{rejected_function_call.py → error_vellum_value.py} +3 -5
  21. vellum/types/function_call.py +20 -18
  22. vellum/types/{fulfilled_function_call_request.py → function_call_request.py} +2 -2
  23. vellum/types/function_call_variable_value.py +1 -1
  24. vellum/types/{node_output_compiled_function_value.py → function_call_vellum_value.py} +5 -2
  25. vellum/types/hkunlp_instructor_xl_enum.py +5 -0
  26. vellum/types/hkunlp_instructor_xl_vectorizer.py +30 -0
  27. vellum/types/hkunlp_instructor_xl_vectorizer_request.py +30 -0
  28. vellum/types/{fulfilled_function_call.py → image_vellum_value.py} +4 -5
  29. vellum/types/indexing_config_vectorizer.py +106 -0
  30. vellum/types/indexing_config_vectorizer_request.py +106 -0
  31. vellum/types/instructor_vectorizer_config.py +31 -0
  32. vellum/types/instructor_vectorizer_config_request.py +31 -0
  33. vellum/types/intfloat_multilingual_e_5_large_enum.py +5 -0
  34. vellum/types/json_vellum_value.py +29 -0
  35. vellum/types/metric_enum.py +5 -0
  36. vellum/types/{chat_history_variable_value.py → metric_node_result.py} +4 -3
  37. vellum/types/named_test_case_function_call_variable_value.py +2 -2
  38. vellum/types/named_test_case_function_call_variable_value_request.py +2 -2
  39. vellum/types/node_output_compiled_array_value.py +8 -2
  40. vellum/types/node_output_compiled_chat_history_value.py +7 -1
  41. vellum/types/node_output_compiled_error_value.py +7 -1
  42. vellum/types/node_output_compiled_function_call_value.py +33 -0
  43. vellum/types/node_output_compiled_json_value.py +7 -1
  44. vellum/types/node_output_compiled_number_value.py +7 -1
  45. vellum/types/node_output_compiled_search_results_value.py +7 -1
  46. vellum/types/node_output_compiled_string_value.py +7 -1
  47. vellum/types/node_output_compiled_value.py +2 -2
  48. vellum/types/{search_results_variable_value.py → number_vellum_value.py} +6 -3
  49. vellum/types/open_ai_vectorizer_config.py +30 -0
  50. vellum/types/open_ai_vectorizer_config_request.py +30 -0
  51. vellum/types/open_ai_vectorizer_text_embedding_3_large.py +30 -0
  52. vellum/types/open_ai_vectorizer_text_embedding_3_large_request.py +30 -0
  53. vellum/types/open_ai_vectorizer_text_embedding_3_small.py +30 -0
  54. vellum/types/open_ai_vectorizer_text_embedding_3_small_request.py +30 -0
  55. vellum/types/open_ai_vectorizer_text_embedding_ada_002.py +30 -0
  56. vellum/types/open_ai_vectorizer_text_embedding_ada_002_request.py +30 -0
  57. vellum/types/prompt_output.py +8 -8
  58. vellum/types/reducto_chunker_config.py +29 -0
  59. vellum/types/reducto_chunker_config_request.py +29 -0
  60. vellum/types/reducto_chunker_enum.py +5 -0
  61. vellum/types/reducto_chunking.py +30 -0
  62. vellum/types/reducto_chunking_request.py +30 -0
  63. vellum/types/sentence_chunker_config.py +30 -0
  64. vellum/types/sentence_chunker_config_request.py +30 -0
  65. vellum/types/sentence_chunker_enum.py +5 -0
  66. vellum/types/sentence_chunking.py +30 -0
  67. vellum/types/sentence_chunking_request.py +30 -0
  68. vellum/types/sentence_transformers_multi_qa_mpnet_base_cos_v_1_enum.py +5 -0
  69. vellum/types/sentence_transformers_multi_qa_mpnet_base_dot_v_1_enum.py +5 -0
  70. vellum/types/string_vellum_value.py +29 -0
  71. vellum/types/test_case_function_call_variable_value.py +2 -2
  72. vellum/types/test_suite_run_execution_function_call_output.py +2 -2
  73. vellum/types/text_embedding_3_large_enum.py +5 -0
  74. vellum/types/text_embedding_3_small_enum.py +5 -0
  75. vellum/types/text_embedding_ada_002_enum.py +5 -0
  76. vellum/types/token_overlapping_window_chunker_config.py +30 -0
  77. vellum/types/token_overlapping_window_chunker_config_request.py +30 -0
  78. vellum/types/token_overlapping_window_chunker_enum.py +5 -0
  79. vellum/types/token_overlapping_window_chunking.py +30 -0
  80. vellum/types/token_overlapping_window_chunking_request.py +30 -0
  81. vellum/types/workflow_execution_actual_chat_history_request.py +5 -0
  82. vellum/types/workflow_execution_actual_json_request.py +5 -0
  83. vellum/types/workflow_execution_actual_string_request.py +5 -0
  84. vellum/types/workflow_node_result_data.py +12 -0
  85. vellum/types/workflow_output_array.py +2 -2
  86. {vellum_ai-0.5.1.dist-info → vellum_ai-0.6.0.dist-info}/METADATA +1 -1
  87. {vellum_ai-0.5.1.dist-info → vellum_ai-0.6.0.dist-info}/RECORD +89 -37
  88. {vellum_ai-0.5.1.dist-info → vellum_ai-0.6.0.dist-info}/LICENSE +0 -0
  89. {vellum_ai-0.5.1.dist-info → vellum_ai-0.6.0.dist-info}/WHEEL +0 -0
@@ -10,6 +10,7 @@ from ...core.jsonable_encoder import jsonable_encoder
10
10
  from ...core.pydantic_utilities import pydantic_v1
11
11
  from ...core.remove_none_from_dict import remove_none_from_dict
12
12
  from ...core.request_options import RequestOptions
13
+ from ...types.document_index_indexing_config_request import DocumentIndexIndexingConfigRequest
13
14
  from ...types.document_index_read import DocumentIndexRead
14
15
  from ...types.entity_status import EntityStatus
15
16
  from ...types.environment_enum import EnvironmentEnum
@@ -30,6 +31,7 @@ class DocumentIndexesClient:
30
31
  limit: typing.Optional[int] = None,
31
32
  offset: typing.Optional[int] = None,
32
33
  ordering: typing.Optional[str] = None,
34
+ search: typing.Optional[str] = None,
33
35
  status: typing.Optional[DocumentIndexesListRequestStatus] = None,
34
36
  request_options: typing.Optional[RequestOptions] = None,
35
37
  ) -> PaginatedDocumentIndexReadList:
@@ -43,7 +45,9 @@ class DocumentIndexesClient:
43
45
 
44
46
  - ordering: typing.Optional[str]. Which field to use when ordering the results.
45
47
 
46
- - status: typing.Optional[DocumentIndexesListRequestStatus]. The current status of the document index
48
+ - search: typing.Optional[str]. Search for document indices by name or label
49
+
50
+ - status: typing.Optional[DocumentIndexesListRequestStatus]. Filter down to only document indices that have a status matching the status specified
47
51
 
48
52
  - `ACTIVE` - Active
49
53
  - `ARCHIVED` - Archived
@@ -65,6 +69,7 @@ class DocumentIndexesClient:
65
69
  "limit": limit,
66
70
  "offset": offset,
67
71
  "ordering": ordering,
72
+ "search": search,
68
73
  "status": status,
69
74
  **(
70
75
  request_options.get("additional_query_parameters", {})
@@ -103,7 +108,7 @@ class DocumentIndexesClient:
103
108
  name: str,
104
109
  status: typing.Optional[EntityStatus] = OMIT,
105
110
  environment: typing.Optional[EnvironmentEnum] = OMIT,
106
- indexing_config: typing.Dict[str, typing.Any],
111
+ indexing_config: DocumentIndexIndexingConfigRequest,
107
112
  copy_documents_from_index_id: typing.Optional[str] = OMIT,
108
113
  request_options: typing.Optional[RequestOptions] = None,
109
114
  ) -> DocumentIndexRead:
@@ -124,37 +129,32 @@ class DocumentIndexesClient:
124
129
  * `DEVELOPMENT` - Development
125
130
  * `STAGING` - Staging
126
131
  * `PRODUCTION` - Production
127
- - indexing_config: typing.Dict[str, typing.Any]. Configuration representing how documents should be indexed
132
+ - indexing_config: DocumentIndexIndexingConfigRequest.
128
133
 
129
134
  - 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
130
135
 
131
136
  - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
132
137
  ---
138
+ from vellum import (
139
+ DocumentIndexChunkingRequest_ReductoChunker,
140
+ DocumentIndexIndexingConfigRequest,
141
+ IndexingConfigVectorizerRequest_TextEmbedding3Small,
142
+ )
133
143
  from vellum.client import Vellum
134
144
 
135
145
  client = Vellum(
136
146
  api_key="YOUR_API_KEY",
137
147
  )
138
148
  client.document_indexes.create(
139
- label="My Document Index",
140
- name="my-document-index",
141
- indexing_config={
142
- "chunking": {
143
- "chunker_name": "sentence-chunker",
144
- "chunker_config": {
145
- "character_limit": 1000,
146
- "min_overlap_ratio": 0.5,
147
- },
148
- },
149
- "vectorizer": {
150
- "model_name": "hkunlp/instructor-xl",
151
- "config": {
152
- "instruction_domain": "",
153
- "instruction_document_text_type": "plain_text",
154
- "instruction_query_text_type": "plain_text",
155
- },
156
- },
157
- },
149
+ label="string",
150
+ name="string",
151
+ status="ACTIVE",
152
+ environment="DEVELOPMENT",
153
+ indexing_config=DocumentIndexIndexingConfigRequest(
154
+ vectorizer=IndexingConfigVectorizerRequest_TextEmbedding3Small(),
155
+ chunking=DocumentIndexChunkingRequest_ReductoChunker(),
156
+ ),
157
+ copy_documents_from_index_id="string",
158
158
  )
159
159
  """
160
160
  _request: typing.Dict[str, typing.Any] = {"label": label, "name": name, "indexing_config": indexing_config}
@@ -213,7 +213,7 @@ class DocumentIndexesClient:
213
213
  api_key="YOUR_API_KEY",
214
214
  )
215
215
  client.document_indexes.retrieve(
216
- id="id",
216
+ id="string",
217
217
  )
218
218
  """
219
219
  _response = self._client_wrapper.httpx_client.request(
@@ -280,8 +280,10 @@ class DocumentIndexesClient:
280
280
  api_key="YOUR_API_KEY",
281
281
  )
282
282
  client.document_indexes.update(
283
- id="id",
284
- label="label",
283
+ id="string",
284
+ label="string",
285
+ status="ACTIVE",
286
+ environment="DEVELOPMENT",
285
287
  )
286
288
  """
287
289
  _request: typing.Dict[str, typing.Any] = {"label": label}
@@ -407,7 +409,10 @@ class DocumentIndexesClient:
407
409
  api_key="YOUR_API_KEY",
408
410
  )
409
411
  client.document_indexes.partial_update(
410
- id="id",
412
+ id="string",
413
+ label="string",
414
+ status="ACTIVE",
415
+ environment="DEVELOPMENT",
411
416
  )
412
417
  """
413
418
  _request: typing.Dict[str, typing.Any] = {}
@@ -464,6 +469,7 @@ class AsyncDocumentIndexesClient:
464
469
  limit: typing.Optional[int] = None,
465
470
  offset: typing.Optional[int] = None,
466
471
  ordering: typing.Optional[str] = None,
472
+ search: typing.Optional[str] = None,
467
473
  status: typing.Optional[DocumentIndexesListRequestStatus] = None,
468
474
  request_options: typing.Optional[RequestOptions] = None,
469
475
  ) -> PaginatedDocumentIndexReadList:
@@ -477,7 +483,9 @@ class AsyncDocumentIndexesClient:
477
483
 
478
484
  - ordering: typing.Optional[str]. Which field to use when ordering the results.
479
485
 
480
- - status: typing.Optional[DocumentIndexesListRequestStatus]. The current status of the document index
486
+ - search: typing.Optional[str]. Search for document indices by name or label
487
+
488
+ - status: typing.Optional[DocumentIndexesListRequestStatus]. Filter down to only document indices that have a status matching the status specified
481
489
 
482
490
  - `ACTIVE` - Active
483
491
  - `ARCHIVED` - Archived
@@ -499,6 +507,7 @@ class AsyncDocumentIndexesClient:
499
507
  "limit": limit,
500
508
  "offset": offset,
501
509
  "ordering": ordering,
510
+ "search": search,
502
511
  "status": status,
503
512
  **(
504
513
  request_options.get("additional_query_parameters", {})
@@ -537,7 +546,7 @@ class AsyncDocumentIndexesClient:
537
546
  name: str,
538
547
  status: typing.Optional[EntityStatus] = OMIT,
539
548
  environment: typing.Optional[EnvironmentEnum] = OMIT,
540
- indexing_config: typing.Dict[str, typing.Any],
549
+ indexing_config: DocumentIndexIndexingConfigRequest,
541
550
  copy_documents_from_index_id: typing.Optional[str] = OMIT,
542
551
  request_options: typing.Optional[RequestOptions] = None,
543
552
  ) -> DocumentIndexRead:
@@ -558,37 +567,32 @@ class AsyncDocumentIndexesClient:
558
567
  * `DEVELOPMENT` - Development
559
568
  * `STAGING` - Staging
560
569
  * `PRODUCTION` - Production
561
- - indexing_config: typing.Dict[str, typing.Any]. Configuration representing how documents should be indexed
570
+ - indexing_config: DocumentIndexIndexingConfigRequest.
562
571
 
563
572
  - 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
564
573
 
565
574
  - request_options: typing.Optional[RequestOptions]. Request-specific configuration.
566
575
  ---
576
+ from vellum import (
577
+ DocumentIndexChunkingRequest_ReductoChunker,
578
+ DocumentIndexIndexingConfigRequest,
579
+ IndexingConfigVectorizerRequest_TextEmbedding3Small,
580
+ )
567
581
  from vellum.client import AsyncVellum
568
582
 
569
583
  client = AsyncVellum(
570
584
  api_key="YOUR_API_KEY",
571
585
  )
572
586
  await client.document_indexes.create(
573
- label="My Document Index",
574
- name="my-document-index",
575
- indexing_config={
576
- "chunking": {
577
- "chunker_name": "sentence-chunker",
578
- "chunker_config": {
579
- "character_limit": 1000,
580
- "min_overlap_ratio": 0.5,
581
- },
582
- },
583
- "vectorizer": {
584
- "model_name": "hkunlp/instructor-xl",
585
- "config": {
586
- "instruction_domain": "",
587
- "instruction_document_text_type": "plain_text",
588
- "instruction_query_text_type": "plain_text",
589
- },
590
- },
591
- },
587
+ label="string",
588
+ name="string",
589
+ status="ACTIVE",
590
+ environment="DEVELOPMENT",
591
+ indexing_config=DocumentIndexIndexingConfigRequest(
592
+ vectorizer=IndexingConfigVectorizerRequest_TextEmbedding3Small(),
593
+ chunking=DocumentIndexChunkingRequest_ReductoChunker(),
594
+ ),
595
+ copy_documents_from_index_id="string",
592
596
  )
593
597
  """
594
598
  _request: typing.Dict[str, typing.Any] = {"label": label, "name": name, "indexing_config": indexing_config}
@@ -647,7 +651,7 @@ class AsyncDocumentIndexesClient:
647
651
  api_key="YOUR_API_KEY",
648
652
  )
649
653
  await client.document_indexes.retrieve(
650
- id="id",
654
+ id="string",
651
655
  )
652
656
  """
653
657
  _response = await self._client_wrapper.httpx_client.request(
@@ -714,8 +718,10 @@ class AsyncDocumentIndexesClient:
714
718
  api_key="YOUR_API_KEY",
715
719
  )
716
720
  await client.document_indexes.update(
717
- id="id",
718
- label="label",
721
+ id="string",
722
+ label="string",
723
+ status="ACTIVE",
724
+ environment="DEVELOPMENT",
719
725
  )
720
726
  """
721
727
  _request: typing.Dict[str, typing.Any] = {"label": label}
@@ -841,7 +847,10 @@ class AsyncDocumentIndexesClient:
841
847
  api_key="YOUR_API_KEY",
842
848
  )
843
849
  await client.document_indexes.partial_update(
844
- id="id",
850
+ id="string",
851
+ label="string",
852
+ status="ACTIVE",
853
+ environment="DEVELOPMENT",
845
854
  )
846
855
  """
847
856
  _request: typing.Dict[str, typing.Any] = {}
@@ -99,7 +99,7 @@ class DocumentsClient:
99
99
 
100
100
  def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DocumentRead:
101
101
  """
102
- Retrieve a Document via its Vellum-generated ID.
102
+ Retrieve a Document, keying off of either its Vellum-generated ID or its external ID.
103
103
 
104
104
  Parameters:
105
105
  - id: str. A UUID string identifying this document.
@@ -147,6 +147,8 @@ class DocumentsClient:
147
147
 
148
148
  def destroy(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
149
149
  """
150
+ Delete a Document, keying off of either its Vellum-generated ID or its external ID.
151
+
150
152
  Parameters:
151
153
  - id: str. A UUID string identifying this document.
152
154
 
@@ -201,7 +203,7 @@ class DocumentsClient:
201
203
  request_options: typing.Optional[RequestOptions] = None,
202
204
  ) -> DocumentRead:
203
205
  """
204
- Update a Document, keying off of its Vellum-generated ID. Particularly useful for updating its metadata.
206
+ Update a Document, keying off of either its Vellum-generated ID or its external ID. Particularly useful for updating its metadata.
205
207
 
206
208
  Parameters:
207
209
  - id: str. A UUID string identifying this document.
@@ -453,7 +455,7 @@ class AsyncDocumentsClient:
453
455
 
454
456
  async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DocumentRead:
455
457
  """
456
- Retrieve a Document via its Vellum-generated ID.
458
+ Retrieve a Document, keying off of either its Vellum-generated ID or its external ID.
457
459
 
458
460
  Parameters:
459
461
  - id: str. A UUID string identifying this document.
@@ -501,6 +503,8 @@ class AsyncDocumentsClient:
501
503
 
502
504
  async def destroy(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
503
505
  """
506
+ Delete a Document, keying off of either its Vellum-generated ID or its external ID.
507
+
504
508
  Parameters:
505
509
  - id: str. A UUID string identifying this document.
506
510
 
@@ -555,7 +559,7 @@ class AsyncDocumentsClient:
555
559
  request_options: typing.Optional[RequestOptions] = None,
556
560
  ) -> DocumentRead:
557
561
  """
558
- Update a Document, keying off of its Vellum-generated ID. Particularly useful for updating its metadata.
562
+ Update a Document, keying off of either its Vellum-generated ID or its external ID. Particularly useful for updating its metadata.
559
563
 
560
564
  Parameters:
561
565
  - id: str. A UUID string identifying this document.