vellum-ai 0.6.4__py3-none-any.whl → 0.6.6__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- vellum/__init__.py +18 -0
- vellum/core/client_wrapper.py +1 -1
- vellum/types/__init__.py +16 -0
- vellum/types/deployment_read.py +5 -0
- vellum/types/pdf_enum.py +5 -0
- vellum/types/pdf_search_result_meta_source.py +37 -0
- vellum/types/pdf_search_result_meta_source_request.py +37 -0
- vellum/types/search_result.py +6 -0
- vellum/types/search_result_meta.py +26 -0
- vellum/types/search_result_meta_request.py +26 -0
- vellum/types/search_result_meta_source.py +20 -0
- vellum/types/search_result_meta_source_request.py +20 -0
- vellum/types/search_result_request.py +6 -0
- vellum/types/workflow_deployment_read.py +5 -0
- vellum_ai-0.6.6.dist-info/METADATA +126 -0
- {vellum_ai-0.6.4.dist-info → vellum_ai-0.6.6.dist-info}/RECORD +18 -11
- vellum_ai-0.6.4.dist-info/METADATA +0 -109
- {vellum_ai-0.6.4.dist-info → vellum_ai-0.6.6.dist-info}/LICENSE +0 -0
- {vellum_ai-0.6.4.dist-info → vellum_ai-0.6.6.dist-info}/WHEEL +0 -0
vellum/__init__.py
CHANGED
@@ -295,6 +295,9 @@ from .types import (
|
|
295
295
|
PaginatedSlimWorkflowDeploymentList,
|
296
296
|
PaginatedTestSuiteRunExecutionList,
|
297
297
|
PaginatedTestSuiteTestCaseList,
|
298
|
+
PdfEnum,
|
299
|
+
PdfSearchResultMetaSource,
|
300
|
+
PdfSearchResultMetaSourceRequest,
|
298
301
|
ProcessingFailureReasonEnum,
|
299
302
|
ProcessingStateEnum,
|
300
303
|
PromptDeploymentExpandMetaRequestRequest,
|
@@ -341,6 +344,12 @@ from .types import (
|
|
341
344
|
SearchResultDocument,
|
342
345
|
SearchResultDocumentRequest,
|
343
346
|
SearchResultMergingRequest,
|
347
|
+
SearchResultMeta,
|
348
|
+
SearchResultMetaRequest,
|
349
|
+
SearchResultMetaSource,
|
350
|
+
SearchResultMetaSourceRequest,
|
351
|
+
SearchResultMetaSourceRequest_Pdf,
|
352
|
+
SearchResultMetaSource_Pdf,
|
344
353
|
SearchResultRequest,
|
345
354
|
SearchResultsEnum,
|
346
355
|
SearchWeightsRequest,
|
@@ -915,6 +924,9 @@ __all__ = [
|
|
915
924
|
"PaginatedSlimWorkflowDeploymentList",
|
916
925
|
"PaginatedTestSuiteRunExecutionList",
|
917
926
|
"PaginatedTestSuiteTestCaseList",
|
927
|
+
"PdfEnum",
|
928
|
+
"PdfSearchResultMetaSource",
|
929
|
+
"PdfSearchResultMetaSourceRequest",
|
918
930
|
"ProcessingFailureReasonEnum",
|
919
931
|
"ProcessingStateEnum",
|
920
932
|
"PromptDeploymentExpandMetaRequestRequest",
|
@@ -961,6 +973,12 @@ __all__ = [
|
|
961
973
|
"SearchResultDocument",
|
962
974
|
"SearchResultDocumentRequest",
|
963
975
|
"SearchResultMergingRequest",
|
976
|
+
"SearchResultMeta",
|
977
|
+
"SearchResultMetaRequest",
|
978
|
+
"SearchResultMetaSource",
|
979
|
+
"SearchResultMetaSourceRequest",
|
980
|
+
"SearchResultMetaSourceRequest_Pdf",
|
981
|
+
"SearchResultMetaSource_Pdf",
|
964
982
|
"SearchResultRequest",
|
965
983
|
"SearchResultsEnum",
|
966
984
|
"SearchWeightsRequest",
|
vellum/core/client_wrapper.py
CHANGED
vellum/types/__init__.py
CHANGED
@@ -342,6 +342,9 @@ from .paginated_slim_document_list import PaginatedSlimDocumentList
|
|
342
342
|
from .paginated_slim_workflow_deployment_list import PaginatedSlimWorkflowDeploymentList
|
343
343
|
from .paginated_test_suite_run_execution_list import PaginatedTestSuiteRunExecutionList
|
344
344
|
from .paginated_test_suite_test_case_list import PaginatedTestSuiteTestCaseList
|
345
|
+
from .pdf_enum import PdfEnum
|
346
|
+
from .pdf_search_result_meta_source import PdfSearchResultMetaSource
|
347
|
+
from .pdf_search_result_meta_source_request import PdfSearchResultMetaSourceRequest
|
345
348
|
from .processing_failure_reason_enum import ProcessingFailureReasonEnum
|
346
349
|
from .processing_state_enum import ProcessingStateEnum
|
347
350
|
from .prompt_deployment_expand_meta_request_request import PromptDeploymentExpandMetaRequestRequest
|
@@ -390,6 +393,10 @@ from .search_result import SearchResult
|
|
390
393
|
from .search_result_document import SearchResultDocument
|
391
394
|
from .search_result_document_request import SearchResultDocumentRequest
|
392
395
|
from .search_result_merging_request import SearchResultMergingRequest
|
396
|
+
from .search_result_meta import SearchResultMeta
|
397
|
+
from .search_result_meta_request import SearchResultMetaRequest
|
398
|
+
from .search_result_meta_source import SearchResultMetaSource, SearchResultMetaSource_Pdf
|
399
|
+
from .search_result_meta_source_request import SearchResultMetaSourceRequest, SearchResultMetaSourceRequest_Pdf
|
393
400
|
from .search_result_request import SearchResultRequest
|
394
401
|
from .search_results_enum import SearchResultsEnum
|
395
402
|
from .search_weights_request import SearchWeightsRequest
|
@@ -974,6 +981,9 @@ __all__ = [
|
|
974
981
|
"PaginatedSlimWorkflowDeploymentList",
|
975
982
|
"PaginatedTestSuiteRunExecutionList",
|
976
983
|
"PaginatedTestSuiteTestCaseList",
|
984
|
+
"PdfEnum",
|
985
|
+
"PdfSearchResultMetaSource",
|
986
|
+
"PdfSearchResultMetaSourceRequest",
|
977
987
|
"ProcessingFailureReasonEnum",
|
978
988
|
"ProcessingStateEnum",
|
979
989
|
"PromptDeploymentExpandMetaRequestRequest",
|
@@ -1020,6 +1030,12 @@ __all__ = [
|
|
1020
1030
|
"SearchResultDocument",
|
1021
1031
|
"SearchResultDocumentRequest",
|
1022
1032
|
"SearchResultMergingRequest",
|
1033
|
+
"SearchResultMeta",
|
1034
|
+
"SearchResultMetaRequest",
|
1035
|
+
"SearchResultMetaSource",
|
1036
|
+
"SearchResultMetaSourceRequest",
|
1037
|
+
"SearchResultMetaSourceRequest_Pdf",
|
1038
|
+
"SearchResultMetaSource_Pdf",
|
1023
1039
|
"SearchResultRequest",
|
1024
1040
|
"SearchResultsEnum",
|
1025
1041
|
"SearchWeightsRequest",
|
vellum/types/deployment_read.py
CHANGED
@@ -47,6 +47,11 @@ class DeploymentRead(pydantic_v1.BaseModel):
|
|
47
47
|
Deprecated. The Prompt execution endpoints return a `prompt_version_id` that could be used instead.
|
48
48
|
"""
|
49
49
|
|
50
|
+
last_deployed_history_item_id: str = pydantic_v1.Field()
|
51
|
+
"""
|
52
|
+
The ID of the history item associated with this Deployment's LATEST Release Tag
|
53
|
+
"""
|
54
|
+
|
50
55
|
def json(self, **kwargs: typing.Any) -> str:
|
51
56
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
52
57
|
return super().json(**kwargs_with_defaults)
|
vellum/types/pdf_enum.py
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import datetime as dt
|
4
|
+
import typing
|
5
|
+
|
6
|
+
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
8
|
+
|
9
|
+
|
10
|
+
class PdfSearchResultMetaSource(pydantic_v1.BaseModel):
|
11
|
+
"""
|
12
|
+
The source of a search result from a PDF document.
|
13
|
+
"""
|
14
|
+
|
15
|
+
start_page_num: typing.Optional[int] = pydantic_v1.Field(default=None)
|
16
|
+
"""
|
17
|
+
The 1-indexed page number where the chunk starts in the document. Only available for supported chunking strategies and document types.
|
18
|
+
"""
|
19
|
+
|
20
|
+
end_page_num: typing.Optional[int] = pydantic_v1.Field(default=None)
|
21
|
+
"""
|
22
|
+
The 1-indexed page number where the chunk ends in the document. Only available for supported chunking strategies and document types.
|
23
|
+
"""
|
24
|
+
|
25
|
+
def json(self, **kwargs: typing.Any) -> str:
|
26
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
27
|
+
return super().json(**kwargs_with_defaults)
|
28
|
+
|
29
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
30
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
31
|
+
return super().dict(**kwargs_with_defaults)
|
32
|
+
|
33
|
+
class Config:
|
34
|
+
frozen = True
|
35
|
+
smart_union = True
|
36
|
+
extra = pydantic_v1.Extra.allow
|
37
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import datetime as dt
|
4
|
+
import typing
|
5
|
+
|
6
|
+
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
8
|
+
|
9
|
+
|
10
|
+
class PdfSearchResultMetaSourceRequest(pydantic_v1.BaseModel):
|
11
|
+
"""
|
12
|
+
The source of a search result from a PDF document.
|
13
|
+
"""
|
14
|
+
|
15
|
+
start_page_num: typing.Optional[int] = pydantic_v1.Field(default=None)
|
16
|
+
"""
|
17
|
+
The 1-indexed page number where the chunk starts in the document. Only available for supported chunking strategies and document types.
|
18
|
+
"""
|
19
|
+
|
20
|
+
end_page_num: typing.Optional[int] = pydantic_v1.Field(default=None)
|
21
|
+
"""
|
22
|
+
The 1-indexed page number where the chunk ends in the document. Only available for supported chunking strategies and document types.
|
23
|
+
"""
|
24
|
+
|
25
|
+
def json(self, **kwargs: typing.Any) -> str:
|
26
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
27
|
+
return super().json(**kwargs_with_defaults)
|
28
|
+
|
29
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
30
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
31
|
+
return super().dict(**kwargs_with_defaults)
|
32
|
+
|
33
|
+
class Config:
|
34
|
+
frozen = True
|
35
|
+
smart_union = True
|
36
|
+
extra = pydantic_v1.Extra.allow
|
37
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
vellum/types/search_result.py
CHANGED
@@ -6,6 +6,7 @@ import typing
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
7
|
from ..core.pydantic_utilities import pydantic_v1
|
8
8
|
from .search_result_document import SearchResultDocument
|
9
|
+
from .search_result_meta import SearchResultMeta
|
9
10
|
|
10
11
|
|
11
12
|
class SearchResult(pydantic_v1.BaseModel):
|
@@ -25,6 +26,11 @@ class SearchResult(pydantic_v1.BaseModel):
|
|
25
26
|
The document that contains the chunk that matched the search query.
|
26
27
|
"""
|
27
28
|
|
29
|
+
meta: typing.Optional[SearchResultMeta] = pydantic_v1.Field(default=None)
|
30
|
+
"""
|
31
|
+
Additional information about the search result.
|
32
|
+
"""
|
33
|
+
|
28
34
|
def json(self, **kwargs: typing.Any) -> str:
|
29
35
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
30
36
|
return super().json(**kwargs_with_defaults)
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import datetime as dt
|
4
|
+
import typing
|
5
|
+
|
6
|
+
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
8
|
+
from .search_result_meta_source import SearchResultMetaSource
|
9
|
+
|
10
|
+
|
11
|
+
class SearchResultMeta(pydantic_v1.BaseModel):
|
12
|
+
source: SearchResultMetaSource
|
13
|
+
|
14
|
+
def json(self, **kwargs: typing.Any) -> str:
|
15
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
16
|
+
return super().json(**kwargs_with_defaults)
|
17
|
+
|
18
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
19
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
20
|
+
return super().dict(**kwargs_with_defaults)
|
21
|
+
|
22
|
+
class Config:
|
23
|
+
frozen = True
|
24
|
+
smart_union = True
|
25
|
+
extra = pydantic_v1.Extra.allow
|
26
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import datetime as dt
|
4
|
+
import typing
|
5
|
+
|
6
|
+
from ..core.datetime_utils import serialize_datetime
|
7
|
+
from ..core.pydantic_utilities import pydantic_v1
|
8
|
+
from .search_result_meta_source_request import SearchResultMetaSourceRequest
|
9
|
+
|
10
|
+
|
11
|
+
class SearchResultMetaRequest(pydantic_v1.BaseModel):
|
12
|
+
source: SearchResultMetaSourceRequest
|
13
|
+
|
14
|
+
def json(self, **kwargs: typing.Any) -> str:
|
15
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
16
|
+
return super().json(**kwargs_with_defaults)
|
17
|
+
|
18
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
19
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
20
|
+
return super().dict(**kwargs_with_defaults)
|
21
|
+
|
22
|
+
class Config:
|
23
|
+
frozen = True
|
24
|
+
smart_union = True
|
25
|
+
extra = pydantic_v1.Extra.allow
|
26
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
import typing
|
6
|
+
|
7
|
+
from .pdf_search_result_meta_source import PdfSearchResultMetaSource
|
8
|
+
|
9
|
+
|
10
|
+
class SearchResultMetaSource_Pdf(PdfSearchResultMetaSource):
|
11
|
+
document_type: typing.Literal["PDF"] = "PDF"
|
12
|
+
|
13
|
+
class Config:
|
14
|
+
frozen = True
|
15
|
+
smart_union = True
|
16
|
+
allow_population_by_field_name = True
|
17
|
+
populate_by_name = True
|
18
|
+
|
19
|
+
|
20
|
+
SearchResultMetaSource = typing.Union[SearchResultMetaSource_Pdf]
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
import typing
|
6
|
+
|
7
|
+
from .pdf_search_result_meta_source_request import PdfSearchResultMetaSourceRequest
|
8
|
+
|
9
|
+
|
10
|
+
class SearchResultMetaSourceRequest_Pdf(PdfSearchResultMetaSourceRequest):
|
11
|
+
document_type: typing.Literal["PDF"] = "PDF"
|
12
|
+
|
13
|
+
class Config:
|
14
|
+
frozen = True
|
15
|
+
smart_union = True
|
16
|
+
allow_population_by_field_name = True
|
17
|
+
populate_by_name = True
|
18
|
+
|
19
|
+
|
20
|
+
SearchResultMetaSourceRequest = typing.Union[SearchResultMetaSourceRequest_Pdf]
|
@@ -6,6 +6,7 @@ import typing
|
|
6
6
|
from ..core.datetime_utils import serialize_datetime
|
7
7
|
from ..core.pydantic_utilities import pydantic_v1
|
8
8
|
from .search_result_document_request import SearchResultDocumentRequest
|
9
|
+
from .search_result_meta_request import SearchResultMetaRequest
|
9
10
|
|
10
11
|
|
11
12
|
class SearchResultRequest(pydantic_v1.BaseModel):
|
@@ -25,6 +26,11 @@ class SearchResultRequest(pydantic_v1.BaseModel):
|
|
25
26
|
The document that contains the chunk that matched the search query.
|
26
27
|
"""
|
27
28
|
|
29
|
+
meta: typing.Optional[SearchResultMetaRequest] = pydantic_v1.Field(default=None)
|
30
|
+
"""
|
31
|
+
Additional information about the search result.
|
32
|
+
"""
|
33
|
+
|
28
34
|
def json(self, **kwargs: typing.Any) -> str:
|
29
35
|
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
30
36
|
return super().json(**kwargs_with_defaults)
|
@@ -41,6 +41,11 @@ class WorkflowDeploymentRead(pydantic_v1.BaseModel):
|
|
41
41
|
|
42
42
|
created: dt.datetime
|
43
43
|
last_deployed_on: dt.datetime
|
44
|
+
last_deployed_history_item_id: str = pydantic_v1.Field()
|
45
|
+
"""
|
46
|
+
The ID of the history item associated with this Workflow Deployment's LATEST Release Tag
|
47
|
+
"""
|
48
|
+
|
44
49
|
input_variables: typing.List[VellumVariable] = pydantic_v1.Field()
|
45
50
|
"""
|
46
51
|
The input variables this Workflow Deployment expects to receive values for when it is executed.
|
@@ -0,0 +1,126 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: vellum-ai
|
3
|
+
Version: 0.6.6
|
4
|
+
Summary:
|
5
|
+
Requires-Python: >=3.8,<4.0
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
7
|
+
Classifier: Programming Language :: Python :: 3.8
|
8
|
+
Classifier: Programming Language :: Python :: 3.9
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
11
|
+
Requires-Dist: cdktf (>=0.20.5,<0.21.0)
|
12
|
+
Requires-Dist: httpx (>=0.21.2)
|
13
|
+
Requires-Dist: publication (==0.0.3)
|
14
|
+
Requires-Dist: pydantic (>=1.9.2)
|
15
|
+
Requires-Dist: typing_extensions (>=4.0.0)
|
16
|
+
Description-Content-Type: text/markdown
|
17
|
+
|
18
|
+
# Vellum Python Library
|
19
|
+
|
20
|
+
[![pypi](https://img.shields.io/pypi/v/vellum-ai.svg)](https://pypi.python.org/pypi/vellum-ai)
|
21
|
+
![license badge](https://img.shields.io/github/license/vellum-ai/vellum-client-python)
|
22
|
+
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://buildwithfern.com/?utm_source=vellum-ai/vellum-client-python/readme)
|
23
|
+
|
24
|
+
The Vellum Python SDK provides access to the Vellum API from python.
|
25
|
+
|
26
|
+
|
27
|
+
## API Docs
|
28
|
+
You can find Vellum's complete API docs at [docs.vellum.ai](https://docs.vellum.ai/api-reference/introduction/getting-started).
|
29
|
+
|
30
|
+
## Installation
|
31
|
+
|
32
|
+
```sh
|
33
|
+
pip install --upgrade vellum-ai
|
34
|
+
```
|
35
|
+
|
36
|
+
## Usage
|
37
|
+
Below is how you would invoke a deployed Prompt from the Vellum API. For a complete list of all APIs
|
38
|
+
that Vellum supports, check out our [API Reference](https://docs.vellum.ai/api-reference/introduction/getting-started).
|
39
|
+
|
40
|
+
```python
|
41
|
+
from vellum import (
|
42
|
+
PromptDeploymentInputRequest_String,
|
43
|
+
)
|
44
|
+
from vellum.client import Vellum
|
45
|
+
|
46
|
+
client = Vellum(
|
47
|
+
api_key="YOUR_API_KEY",
|
48
|
+
)
|
49
|
+
|
50
|
+
def execute() -> str:
|
51
|
+
result = client.execute_prompt(
|
52
|
+
prompt_deployment_name="<example-deployment-name>>",
|
53
|
+
release_tag="LATEST",
|
54
|
+
inputs=[
|
55
|
+
PromptDeploymentInputRequest_String(
|
56
|
+
name="input_a",
|
57
|
+
type="STRING",
|
58
|
+
value="Hello, world!",
|
59
|
+
)
|
60
|
+
],
|
61
|
+
)
|
62
|
+
|
63
|
+
if result.state == "REJECTED":
|
64
|
+
raise Exception(result.error.message)
|
65
|
+
|
66
|
+
return result.outputs[0].value
|
67
|
+
|
68
|
+
if __name__ == "__main__":
|
69
|
+
print(execute())
|
70
|
+
```
|
71
|
+
|
72
|
+
> [!TIP]
|
73
|
+
> You can set a system environment variable `VELLUM_API_KEY` to avoid writing your api key within your code. To do so, add `export VELLUM_API_KEY=<your-api-token>`
|
74
|
+
> to your ~/.zshrc or ~/.bashrc, open a new terminal, and then any code calling `vellum.Vellum()` will read this key.
|
75
|
+
|
76
|
+
## Async Client
|
77
|
+
This SDK has an async version. Here's how to use it:
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
```python
|
82
|
+
import asyncio
|
83
|
+
|
84
|
+
import vellum
|
85
|
+
from vellum.client import AsyncVellum
|
86
|
+
|
87
|
+
client = AsyncVellum(api_key="YOUR_API_KEY")
|
88
|
+
|
89
|
+
async def execute() -> str:
|
90
|
+
result = await client.execute_prompt(
|
91
|
+
prompt_deployment_name="<example-deployment-name>>",
|
92
|
+
release_tag="LATEST",
|
93
|
+
inputs=[
|
94
|
+
vellum.PromptDeploymentInputRequest_String(
|
95
|
+
name="input_a",
|
96
|
+
value="Hello, world!",
|
97
|
+
)
|
98
|
+
],
|
99
|
+
)
|
100
|
+
|
101
|
+
if result.state == "REJECTED":
|
102
|
+
raise Exception(result.error.message)
|
103
|
+
|
104
|
+
return result.outputs[0].value
|
105
|
+
|
106
|
+
if __name__ == "__main__":
|
107
|
+
print(asyncio.run(execute()))
|
108
|
+
```
|
109
|
+
|
110
|
+
## Contributing
|
111
|
+
|
112
|
+
While we value open-source contributions to this SDK, most of this library is generated programmatically.
|
113
|
+
|
114
|
+
Please feel free to make contributions to any of the directories or files below:
|
115
|
+
```plaintext
|
116
|
+
examples/*
|
117
|
+
src/vellum/lib/*
|
118
|
+
tests/*
|
119
|
+
README.md
|
120
|
+
```
|
121
|
+
|
122
|
+
Any additions made to files beyond those directories and files above would have to be moved over to our generation code
|
123
|
+
(found in the separate [vellum-client-generator](https://github.com/vellum-ai/vellum-client-generator) repo),
|
124
|
+
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept,
|
125
|
+
but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!
|
126
|
+
|
@@ -1,8 +1,8 @@
|
|
1
|
-
vellum/__init__.py,sha256=
|
1
|
+
vellum/__init__.py,sha256=Gu91YntxNpNqfin3Nksl7cQnB-JxuOX65CVPClG-Wo4,45407
|
2
2
|
vellum/client.py,sha256=FklbOzCaDTPP_EQn0HJXUq1_ZFOHuSePt6_nVQ_YLgY,97463
|
3
3
|
vellum/core/__init__.py,sha256=1pNSKkwyQvMl_F0wohBqmoQAITptg3zlvCwsoSSzy7c,853
|
4
4
|
vellum/core/api_error.py,sha256=RE8LELok2QCjABadECTvtDp7qejA1VmINCh6TbqPwSE,426
|
5
|
-
vellum/core/client_wrapper.py,sha256=
|
5
|
+
vellum/core/client_wrapper.py,sha256=atwV8644mcBgTajVkL1azFJjenaU8WVxc0OOXZo459A,1697
|
6
6
|
vellum/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
7
7
|
vellum/core/file.py,sha256=sy1RUGZ3aJYuw998bZytxxo6QdgKmlnlgBaMvwEKCGg,1480
|
8
8
|
vellum/core/http_client.py,sha256=5ok6hqgZDJhg57EHvMnr0BBaHdG50QxFPKaCZ9aVWTc,5059
|
@@ -60,7 +60,7 @@ vellum/terraform/document_index/__init__.py,sha256=qq2zENI22bUvqGk_a1lmsoTr5O_xC
|
|
60
60
|
vellum/terraform/provider/__init__.py,sha256=K1yLlTZkYBxhD4bhUV1v23hxDGgbfsAIGsSyeB54dNQ,10298
|
61
61
|
vellum/terraform/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
62
62
|
vellum/terraform/versions.json,sha256=STW6Mg3BKDacFmbWHXziHxE90GWncZf4AIzCLiXm_7o,56
|
63
|
-
vellum/types/__init__.py,sha256
|
63
|
+
vellum/types/__init__.py,sha256=-vziB5tUZm3fLSs-t0zN8mHg3oQVV7J6F5e6SkUg1Lo,60913
|
64
64
|
vellum/types/add_openai_api_key_enum.py,sha256=GB7sLK_Ou7-Xn73sKJHUo6Gx3TjyhU7uJvWZAg4UeaI,92
|
65
65
|
vellum/types/api_node_result.py,sha256=SvYIi1T-N_P3FVjzv9I91PaCT0IN958A3easp5Q7jqE,983
|
66
66
|
vellum/types/api_node_result_data.py,sha256=KFBmmizcEg73GwQMXUtEdJ4e9YGFpRLYAnalwxIcDug,1161
|
@@ -104,7 +104,7 @@ vellum/types/created_enum.py,sha256=_dfKJhEenYcIUYY1uKQuq1uNS3k9HbPGCxXnW-Tu5uo,
|
|
104
104
|
vellum/types/delete_enum.py,sha256=g6Rnc2pbgXkEbqhG0Bx1z-ZGr4DMkb8QK8du9dQQcpQ,118
|
105
105
|
vellum/types/deleted_enum.py,sha256=F7VTcnxIkXrwyQr5CjGikBbCnlo6To_rP0pibWm-ioo,120
|
106
106
|
vellum/types/deployment_provider_payload_response.py,sha256=nEw7v0EVo3NgKDVtsBMjd9XLWmFAGk59U1Z-qSs-Stc,898
|
107
|
-
vellum/types/deployment_read.py,sha256=
|
107
|
+
vellum/types/deployment_read.py,sha256=Ob9ArdqKJb5vjRx26hX_iOnPF2MwtBYxB5xx2LVNbEk,2100
|
108
108
|
vellum/types/deployment_release_tag_deployment_history_item.py,sha256=997C-J0NOEvOm7Y_dyyaqYvKMIEHCDj0JEpAcmOjOEQ,903
|
109
109
|
vellum/types/deployment_release_tag_read.py,sha256=o0X8dMSqajT3-lEnLk9tRb8PRhs3l3M4iBM7CX9316c,1432
|
110
110
|
vellum/types/document_document_to_document_index.py,sha256=kCPPJFnXu9HFZbk7PgRCtRDj5Cw2_0yEPjAStm-YC2E,1532
|
@@ -253,6 +253,9 @@ vellum/types/paginated_slim_document_list.py,sha256=L8RyvP1ADem7HUnNjDr4KyoQjIJt
|
|
253
253
|
vellum/types/paginated_slim_workflow_deployment_list.py,sha256=1NfPIuU_NgWgJsXcUpCBtOPj7MqZlblbcCXCjzGXwWc,1111
|
254
254
|
vellum/types/paginated_test_suite_run_execution_list.py,sha256=mVhD_un8RCqnJbH9yWliNQPf5E3C0jcH0ManhH6gxZc,1060
|
255
255
|
vellum/types/paginated_test_suite_test_case_list.py,sha256=Ak_plmBTt72atM2uC1PWm8uVffi3tPAozolApJ7LYS4,1044
|
256
|
+
vellum/types/pdf_enum.py,sha256=pFnB6Uv7AbPbZPXlEtQ9O4qNNVeQX0kNLxz1sdkxvVM,112
|
257
|
+
vellum/types/pdf_search_result_meta_source.py,sha256=qEwl2y_RN1XUShidjaH5zm8kp-4PRKm9hNk2_Jf29RY,1377
|
258
|
+
vellum/types/pdf_search_result_meta_source_request.py,sha256=ft-qjTtiSxvo3KVTdzF88QkOCc4sOq46gEyb7ICjBOI,1384
|
256
259
|
vellum/types/processing_failure_reason_enum.py,sha256=R_KIW7TcQejhc-vLhtNf9SdkYADgoZCn4ch4_RRIvsI,195
|
257
260
|
vellum/types/processing_state_enum.py,sha256=lIEunnCpgYQExm2bGyTb12KyjQ3O7XOx636aWXb_Iwo,190
|
258
261
|
vellum/types/prompt_deployment_expand_meta_request_request.py,sha256=r7xmsEaFZWLXKE1Y7GGjUXbaYyMnIdpdgFy3QvMEl8M,2044
|
@@ -286,11 +289,15 @@ vellum/types/search_node_result.py,sha256=ylJR6lICVahKvr4eGZxDxdLbHkxnu3zaHEV-GW
|
|
286
289
|
vellum/types/search_node_result_data.py,sha256=bixMDjtlOKLFVkhUQHWkQcTffkbvYYfuob2hYkJWngg,1143
|
287
290
|
vellum/types/search_request_options_request.py,sha256=WI_MYTsu4pjILsaJvkC-1A-Ghi8ib5qQZdz3kUq9iSY,1622
|
288
291
|
vellum/types/search_response.py,sha256=tMnotqttu7YEYteBDuuriI2HYIJsstG1UFs-3GuNzPs,1047
|
289
|
-
vellum/types/search_result.py,sha256=
|
292
|
+
vellum/types/search_result.py,sha256=bsAjiXEpXdwnysiJ0rsR3_aEi5wQlXR9HCECQ23ecxE,1500
|
290
293
|
vellum/types/search_result_document.py,sha256=MRzncZs2Ug9g0NLoFO5AwElFIpJ4Zs-wUMOuDqX9Yfk,1466
|
291
294
|
vellum/types/search_result_document_request.py,sha256=GVIvgn0htJJojCMPep2p3P_bcxf1ffNZ0XHhNPNsy-w,1473
|
292
295
|
vellum/types/search_result_merging_request.py,sha256=Yx1iv-58kFMCayP_ngjhD8O-m2nvlIAfAQUz1pRxwKI,972
|
293
|
-
vellum/types/
|
296
|
+
vellum/types/search_result_meta.py,sha256=6BIF2iDyBAlZMgJ4b0Hjw-6ZKgMicSXp09hvS1MHatY,936
|
297
|
+
vellum/types/search_result_meta_request.py,sha256=9NT29Gy-lcmoF5fcTV95ftB5bS9aZjW4YSzkIVidH6A,965
|
298
|
+
vellum/types/search_result_meta_source.py,sha256=8T7zgf4lKIoyVKN09dEME2bb3hi86ufG65z96kwYfDM,511
|
299
|
+
vellum/types/search_result_meta_source_request.py,sha256=iQi1DI-COoeqfO3zsECjZPlnn-fTJEFEj6CGPXYH61A,554
|
300
|
+
vellum/types/search_result_request.py,sha256=EYg4mDwbpGmQuMwQktn1LXOvn0XMVY0cKc3XPkCAjdw,1551
|
294
301
|
vellum/types/search_results_enum.py,sha256=qiQWwPnGtlWgG6JVCOAV8KzJarrhOeZrOAeb569grgA,133
|
295
302
|
vellum/types/search_weights_request.py,sha256=C6uvEWZSpmbslpU52qcVA-lEtKF_crRsafXsN_rDURc,1128
|
296
303
|
vellum/types/sentence_chunker_config.py,sha256=DVag4hG9rvuhJWgzbcbsdU4Nz1mx_Ynb3DHUbeOViA4,1003
|
@@ -418,7 +425,7 @@ vellum/types/vellum_image.py,sha256=1QCMf26kEKRKP9DTxNI0qp7CNC1viWGFV9hmIxFyxoY,
|
|
418
425
|
vellum/types/vellum_image_request.py,sha256=ADerbxbSJHzNYouJa1jaBIGvbHR2nSmqYAxE-cgS2Rg,921
|
419
426
|
vellum/types/vellum_variable.py,sha256=MPxkKBtuxtg4HZud4xwsyT_sH6FG-YDGeFLpUa4NZDs,944
|
420
427
|
vellum/types/vellum_variable_type.py,sha256=uHeBCGi7U_SksgKOxtvI4KxYffD4BD2TlddTPo_LUSM,281
|
421
|
-
vellum/types/workflow_deployment_read.py,sha256=
|
428
|
+
vellum/types/workflow_deployment_read.py,sha256=010Jqbj-XOXRm4evLM5yIg4RwDVFB5ayKopMIRPUH88,2281
|
422
429
|
vellum/types/workflow_event_error.py,sha256=1f-xt3rNeCIpSm37KmAqVMc9IEbDD-3pNH4zwBYzXP0,981
|
423
430
|
vellum/types/workflow_execution_actual_chat_history_request.py,sha256=ZBk37qbr-gXYeFLhgmkQQLKvrtlJCWVe9B6GYjq763o,2223
|
424
431
|
vellum/types/workflow_execution_actual_json_request.py,sha256=XuiH6iE_NZiut9E3Y8VwiY5rOHx8u3sd2i_TxbfG8d8,2160
|
@@ -459,7 +466,7 @@ vellum/types/workflow_result_event_output_data_search_results.py,sha256=gazaUrC5
|
|
459
466
|
vellum/types/workflow_result_event_output_data_string.py,sha256=aVWIIGbLj4TJJhTTj6WzhbYXQkcZatKuhhNy8UYwXbw,1482
|
460
467
|
vellum/types/workflow_stream_event.py,sha256=KA6Bkk_XA6AIPWR-1vKnwF1A8l_Bm5y0arQCWWWRpsk,911
|
461
468
|
vellum/version.py,sha256=neLt8HBHHUtDF9M5fsyUzHT-pKooEPvceaLDqqIGb0s,77
|
462
|
-
vellum_ai-0.6.
|
463
|
-
vellum_ai-0.6.
|
464
|
-
vellum_ai-0.6.
|
465
|
-
vellum_ai-0.6.
|
469
|
+
vellum_ai-0.6.6.dist-info/LICENSE,sha256=CcaljEIoOBaU-wItPH4PmM_mDCGpyuUY0Er1BGu5Ti8,1073
|
470
|
+
vellum_ai-0.6.6.dist-info/METADATA,sha256=GDu8VFYeIr-72DPo2M5V-BSnSiWrMyGCziUD7axX-3o,3872
|
471
|
+
vellum_ai-0.6.6.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
472
|
+
vellum_ai-0.6.6.dist-info/RECORD,,
|
@@ -1,109 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: vellum-ai
|
3
|
-
Version: 0.6.4
|
4
|
-
Summary:
|
5
|
-
Requires-Python: >=3.8,<4.0
|
6
|
-
Classifier: Programming Language :: Python :: 3
|
7
|
-
Classifier: Programming Language :: Python :: 3.8
|
8
|
-
Classifier: Programming Language :: Python :: 3.9
|
9
|
-
Classifier: Programming Language :: Python :: 3.10
|
10
|
-
Classifier: Programming Language :: Python :: 3.11
|
11
|
-
Requires-Dist: cdktf (>=0.20.5,<0.21.0)
|
12
|
-
Requires-Dist: httpx (>=0.21.2)
|
13
|
-
Requires-Dist: publication (==0.0.3)
|
14
|
-
Requires-Dist: pydantic (>=1.9.2)
|
15
|
-
Requires-Dist: typing_extensions (>=4.0.0)
|
16
|
-
Description-Content-Type: text/markdown
|
17
|
-
|
18
|
-
# Vellum Python Library
|
19
|
-
|
20
|
-
[![pypi](https://img.shields.io/pypi/v/vellum-ai.svg)](https://pypi.python.org/pypi/vellum-ai)
|
21
|
-
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://buildwithfern.com/?utm_source=vellum-ai/vellum-client-python/readme)
|
22
|
-
|
23
|
-
The Vellum Python Library provides access to the Vellum API from python.
|
24
|
-
|
25
|
-
|
26
|
-
## API Docs
|
27
|
-
You can find Vellum's complete API docs at [docs.vellum.ai](https://docs.vellum.ai).
|
28
|
-
|
29
|
-
## Installation
|
30
|
-
|
31
|
-
```sh
|
32
|
-
pip install --upgrade vellum-ai
|
33
|
-
```
|
34
|
-
|
35
|
-
## Usage
|
36
|
-
|
37
|
-
```python
|
38
|
-
import vellum
|
39
|
-
from vellum.client import Vellum
|
40
|
-
|
41
|
-
|
42
|
-
client = Vellum(api_key="YOUR_API_KEY")
|
43
|
-
|
44
|
-
result = client.generate(
|
45
|
-
deployment_name="my-deployment",
|
46
|
-
requests=[
|
47
|
-
vellum.GenerateRequest(
|
48
|
-
input_values={"question": "Can I get a refund?"})]
|
49
|
-
)
|
50
|
-
|
51
|
-
print(result.text)
|
52
|
-
```
|
53
|
-
|
54
|
-
## Async Client
|
55
|
-
|
56
|
-
```python
|
57
|
-
import vellum
|
58
|
-
from vellum.client import AsyncVellum
|
59
|
-
|
60
|
-
raven = AsyncVellum(api_key="YOUR_API_KEY")
|
61
|
-
|
62
|
-
async def generate() -> str:
|
63
|
-
result = client.generate(
|
64
|
-
deployment_name="my-deployment",
|
65
|
-
requests=[
|
66
|
-
vellum.GenerateRequest(
|
67
|
-
input_values={"question": "Can I get a refund?"})]
|
68
|
-
)
|
69
|
-
|
70
|
-
return result.text
|
71
|
-
```
|
72
|
-
|
73
|
-
## Uploading documents
|
74
|
-
|
75
|
-
Documents can be uploaded to Vellum via either the UI or this API. Once uploaded and indexed, Vellum's Search allows you to perform semantic searches against them.
|
76
|
-
|
77
|
-
```python
|
78
|
-
from vellum.client import Vellum
|
79
|
-
|
80
|
-
client = Vellum(api_key="YOUR_API_KEY")
|
81
|
-
|
82
|
-
with open("/path/to/your/file.txt", "rb") as file:
|
83
|
-
result = client.documents.upload(
|
84
|
-
# File to upload
|
85
|
-
contents=file,
|
86
|
-
# Document label
|
87
|
-
label="Human-friendly label for your document",
|
88
|
-
# The names of indexes that you'd like this document to be added to.
|
89
|
-
add_to_index_names=["<your-index-name>"],
|
90
|
-
# Optionally include a unique ID from your system to this document later.
|
91
|
-
# Useful if you want to perform updates later
|
92
|
-
external_id="<your-index-name>",
|
93
|
-
# Optionally include keywords to associate with the document that can be used in hybrid search
|
94
|
-
keywords=[],
|
95
|
-
)
|
96
|
-
|
97
|
-
print(result)
|
98
|
-
```
|
99
|
-
|
100
|
-
## Beta status
|
101
|
-
|
102
|
-
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning the package version to a specific version in your pyproject.toml file. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
|
103
|
-
|
104
|
-
## Contributing
|
105
|
-
|
106
|
-
While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!
|
107
|
-
|
108
|
-
On the other hand, contributions to the README are always very welcome!
|
109
|
-
|
File without changes
|
File without changes
|