lambdadb 0.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of lambdadb might be problematic. Click here for more details.
- lambdadb/__init__.py +17 -0
- lambdadb/_hooks/__init__.py +5 -0
- lambdadb/_hooks/registration.py +13 -0
- lambdadb/_hooks/sdkhooks.py +76 -0
- lambdadb/_hooks/types.py +106 -0
- lambdadb/_version.py +15 -0
- lambdadb/basesdk.py +358 -0
- lambdadb/collections.py +1630 -0
- lambdadb/docs.py +1328 -0
- lambdadb/errors/__init__.py +74 -0
- lambdadb/errors/apierror.py +22 -0
- lambdadb/errors/badrequest_error.py +20 -0
- lambdadb/errors/internalservererror.py +20 -0
- lambdadb/errors/resourcealreadyexists_error.py +20 -0
- lambdadb/errors/resourcenotfound_error.py +20 -0
- lambdadb/errors/toomanyrequests_error.py +20 -0
- lambdadb/errors/unauthenticated_error.py +20 -0
- lambdadb/httpclient.py +126 -0
- lambdadb/models/__init__.py +420 -0
- lambdadb/models/bulkupsertdocsop.py +59 -0
- lambdadb/models/collectionresponse.py +64 -0
- lambdadb/models/createcollectionop.py +64 -0
- lambdadb/models/createprojectop.py +39 -0
- lambdadb/models/deletecollectionop.py +43 -0
- lambdadb/models/deletedocsop.py +88 -0
- lambdadb/models/deleteprojectop.py +52 -0
- lambdadb/models/fetchdocsop.py +102 -0
- lambdadb/models/getbulkupsertdocsop.py +82 -0
- lambdadb/models/getcollectionop.py +30 -0
- lambdadb/models/getprojectop.py +39 -0
- lambdadb/models/indexconfigs_union.py +95 -0
- lambdadb/models/listcollectionsop.py +35 -0
- lambdadb/models/listprojectsop.py +38 -0
- lambdadb/models/projectresponse.py +38 -0
- lambdadb/models/querycollectionop.py +152 -0
- lambdadb/models/security.py +25 -0
- lambdadb/models/status.py +12 -0
- lambdadb/models/updatecollectionop.py +48 -0
- lambdadb/models/updateprojectop.py +58 -0
- lambdadb/models/upsertdocsop.py +67 -0
- lambdadb/projects.py +1228 -0
- lambdadb/py.typed +1 -0
- lambdadb/sdk.py +170 -0
- lambdadb/sdkconfiguration.py +56 -0
- lambdadb/types/__init__.py +21 -0
- lambdadb/types/basemodel.py +39 -0
- lambdadb/utils/__init__.py +187 -0
- lambdadb/utils/annotations.py +55 -0
- lambdadb/utils/datetimes.py +23 -0
- lambdadb/utils/enums.py +74 -0
- lambdadb/utils/eventstreaming.py +238 -0
- lambdadb/utils/forms.py +202 -0
- lambdadb/utils/headers.py +136 -0
- lambdadb/utils/logger.py +27 -0
- lambdadb/utils/metadata.py +118 -0
- lambdadb/utils/queryparams.py +205 -0
- lambdadb/utils/requestbodies.py +66 -0
- lambdadb/utils/retries.py +217 -0
- lambdadb/utils/security.py +192 -0
- lambdadb/utils/serializers.py +248 -0
- lambdadb/utils/url.py +155 -0
- lambdadb/utils/values.py +137 -0
- lambdadb-0.1.2.dist-info/LICENSE +201 -0
- lambdadb-0.1.2.dist-info/METADATA +514 -0
- lambdadb-0.1.2.dist-info/RECORD +66 -0
- lambdadb-0.1.2.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from lambdadb.types import BaseModel
|
|
5
|
+
from lambdadb.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
|
6
|
+
import pydantic
|
|
7
|
+
from typing import List, Optional
|
|
8
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class QueryTypedDict(TypedDict):
|
|
12
|
+
r"""Query object."""
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Query(BaseModel):
|
|
16
|
+
r"""Query object."""
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class SortTypedDict(TypedDict):
|
|
20
|
+
pass
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class Sort(BaseModel):
|
|
24
|
+
pass
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class QueryCollectionRequestBodyTypedDict(TypedDict):
|
|
28
|
+
size: int
|
|
29
|
+
r"""Number of documents to return. Note that the maximum number of documents is 1000."""
|
|
30
|
+
query: NotRequired[QueryTypedDict]
|
|
31
|
+
r"""Query object."""
|
|
32
|
+
consistent_read: NotRequired[bool]
|
|
33
|
+
r"""If your application requires a strongly consistent read, set consistentRead to true. Although a strongly consistent read might take more time than an eventually consistent read, it always returns the last updated value."""
|
|
34
|
+
include_vectors: NotRequired[bool]
|
|
35
|
+
r"""If your application need to include vector values in the response, set includeVectors to true."""
|
|
36
|
+
sort: NotRequired[List[SortTypedDict]]
|
|
37
|
+
r"""List of field name, sort direction pairs."""
|
|
38
|
+
fields: NotRequired[List[str]]
|
|
39
|
+
r"""List of field name to include in results"""
|
|
40
|
+
track_scores: NotRequired[bool]
|
|
41
|
+
r"""If your application needs to track scores with sorting, set trackScores to true."""
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class QueryCollectionRequestBody(BaseModel):
|
|
45
|
+
size: int
|
|
46
|
+
r"""Number of documents to return. Note that the maximum number of documents is 1000."""
|
|
47
|
+
|
|
48
|
+
query: Optional[Query] = None
|
|
49
|
+
r"""Query object."""
|
|
50
|
+
|
|
51
|
+
consistent_read: Annotated[
|
|
52
|
+
Optional[bool], pydantic.Field(alias="consistentRead")
|
|
53
|
+
] = False
|
|
54
|
+
r"""If your application requires a strongly consistent read, set consistentRead to true. Although a strongly consistent read might take more time than an eventually consistent read, it always returns the last updated value."""
|
|
55
|
+
|
|
56
|
+
include_vectors: Annotated[
|
|
57
|
+
Optional[bool], pydantic.Field(alias="includeVectors")
|
|
58
|
+
] = False
|
|
59
|
+
r"""If your application need to include vector values in the response, set includeVectors to true."""
|
|
60
|
+
|
|
61
|
+
sort: Optional[List[Sort]] = None
|
|
62
|
+
r"""List of field name, sort direction pairs."""
|
|
63
|
+
|
|
64
|
+
fields: Optional[List[str]] = None
|
|
65
|
+
r"""List of field name to include in results"""
|
|
66
|
+
|
|
67
|
+
track_scores: Annotated[Optional[bool], pydantic.Field(alias="trackScores")] = False
|
|
68
|
+
r"""If your application needs to track scores with sorting, set trackScores to true."""
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class QueryCollectionRequestTypedDict(TypedDict):
|
|
72
|
+
project_name: str
|
|
73
|
+
r"""Project name."""
|
|
74
|
+
collection_name: str
|
|
75
|
+
r"""Collection name."""
|
|
76
|
+
request_body: QueryCollectionRequestBodyTypedDict
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class QueryCollectionRequest(BaseModel):
|
|
80
|
+
project_name: Annotated[
|
|
81
|
+
str,
|
|
82
|
+
pydantic.Field(alias="projectName"),
|
|
83
|
+
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
|
84
|
+
]
|
|
85
|
+
r"""Project name."""
|
|
86
|
+
|
|
87
|
+
collection_name: Annotated[
|
|
88
|
+
str,
|
|
89
|
+
pydantic.Field(alias="collectionName"),
|
|
90
|
+
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
|
91
|
+
]
|
|
92
|
+
r"""Collection name."""
|
|
93
|
+
|
|
94
|
+
request_body: Annotated[
|
|
95
|
+
QueryCollectionRequestBody,
|
|
96
|
+
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
|
97
|
+
]
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class QueryCollectionDocDocTypedDict(TypedDict):
|
|
101
|
+
pass
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class QueryCollectionDocDoc(BaseModel):
|
|
105
|
+
pass
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
class QueryCollectionDocTypedDict(TypedDict):
|
|
109
|
+
collection: NotRequired[str]
|
|
110
|
+
r"""Collection name."""
|
|
111
|
+
score: NotRequired[float]
|
|
112
|
+
r"""Document similarity score."""
|
|
113
|
+
doc: NotRequired[QueryCollectionDocDocTypedDict]
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
class QueryCollectionDoc(BaseModel):
|
|
117
|
+
collection: Optional[str] = None
|
|
118
|
+
r"""Collection name."""
|
|
119
|
+
|
|
120
|
+
score: Optional[float] = None
|
|
121
|
+
r"""Document similarity score."""
|
|
122
|
+
|
|
123
|
+
doc: Optional[QueryCollectionDocDoc] = None
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
class QueryCollectionResponseTypedDict(TypedDict):
|
|
127
|
+
r"""Documents selected by query."""
|
|
128
|
+
|
|
129
|
+
took: NotRequired[int]
|
|
130
|
+
r"""Elapsed time in milliseconds."""
|
|
131
|
+
max_score: NotRequired[float]
|
|
132
|
+
r"""Maximum score."""
|
|
133
|
+
total: NotRequired[int]
|
|
134
|
+
r"""Total number of documents returned."""
|
|
135
|
+
docs: NotRequired[List[QueryCollectionDocTypedDict]]
|
|
136
|
+
r"""List of documents."""
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
class QueryCollectionResponse(BaseModel):
|
|
140
|
+
r"""Documents selected by query."""
|
|
141
|
+
|
|
142
|
+
took: Optional[int] = None
|
|
143
|
+
r"""Elapsed time in milliseconds."""
|
|
144
|
+
|
|
145
|
+
max_score: Annotated[Optional[float], pydantic.Field(alias="maxScore")] = None
|
|
146
|
+
r"""Maximum score."""
|
|
147
|
+
|
|
148
|
+
total: Optional[int] = None
|
|
149
|
+
r"""Total number of documents returned."""
|
|
150
|
+
|
|
151
|
+
docs: Optional[List[QueryCollectionDoc]] = None
|
|
152
|
+
r"""List of documents."""
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from lambdadb.types import BaseModel
|
|
5
|
+
from lambdadb.utils import FieldMetadata, SecurityMetadata
|
|
6
|
+
from typing import Optional
|
|
7
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class SecurityTypedDict(TypedDict):
|
|
11
|
+
project_api_key: NotRequired[str]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Security(BaseModel):
|
|
15
|
+
project_api_key: Annotated[
|
|
16
|
+
Optional[str],
|
|
17
|
+
FieldMetadata(
|
|
18
|
+
security=SecurityMetadata(
|
|
19
|
+
scheme=True,
|
|
20
|
+
scheme_type="apiKey",
|
|
21
|
+
sub_type="header",
|
|
22
|
+
field_name="x-api-key",
|
|
23
|
+
)
|
|
24
|
+
),
|
|
25
|
+
] = None
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .indexconfigs_union import IndexConfigsUnion, IndexConfigsUnionTypedDict
|
|
5
|
+
from lambdadb.types import BaseModel
|
|
6
|
+
from lambdadb.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
|
7
|
+
import pydantic
|
|
8
|
+
from typing import Dict
|
|
9
|
+
from typing_extensions import Annotated, TypedDict
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class UpdateCollectionRequestBodyTypedDict(TypedDict):
|
|
13
|
+
index_configs: Dict[str, IndexConfigsUnionTypedDict]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class UpdateCollectionRequestBody(BaseModel):
|
|
17
|
+
index_configs: Annotated[
|
|
18
|
+
Dict[str, IndexConfigsUnion], pydantic.Field(alias="indexConfigs")
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class UpdateCollectionRequestTypedDict(TypedDict):
|
|
23
|
+
project_name: str
|
|
24
|
+
r"""Project name."""
|
|
25
|
+
collection_name: str
|
|
26
|
+
r"""Collection name."""
|
|
27
|
+
request_body: UpdateCollectionRequestBodyTypedDict
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class UpdateCollectionRequest(BaseModel):
|
|
31
|
+
project_name: Annotated[
|
|
32
|
+
str,
|
|
33
|
+
pydantic.Field(alias="projectName"),
|
|
34
|
+
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
|
35
|
+
]
|
|
36
|
+
r"""Project name."""
|
|
37
|
+
|
|
38
|
+
collection_name: Annotated[
|
|
39
|
+
str,
|
|
40
|
+
pydantic.Field(alias="collectionName"),
|
|
41
|
+
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
|
42
|
+
]
|
|
43
|
+
r"""Collection name."""
|
|
44
|
+
|
|
45
|
+
request_body: Annotated[
|
|
46
|
+
UpdateCollectionRequestBody,
|
|
47
|
+
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
|
48
|
+
]
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from lambdadb.types import BaseModel
|
|
5
|
+
from lambdadb.utils import (
|
|
6
|
+
FieldMetadata,
|
|
7
|
+
PathParamMetadata,
|
|
8
|
+
RequestMetadata,
|
|
9
|
+
SecurityMetadata,
|
|
10
|
+
)
|
|
11
|
+
import pydantic
|
|
12
|
+
from typing_extensions import Annotated, TypedDict
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class UpdateProjectSecurityTypedDict(TypedDict):
|
|
16
|
+
admin_api_key: str
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class UpdateProjectSecurity(BaseModel):
|
|
20
|
+
admin_api_key: Annotated[
|
|
21
|
+
str,
|
|
22
|
+
FieldMetadata(
|
|
23
|
+
security=SecurityMetadata(
|
|
24
|
+
scheme=True,
|
|
25
|
+
scheme_type="apiKey",
|
|
26
|
+
sub_type="header",
|
|
27
|
+
field_name="x-api-key",
|
|
28
|
+
)
|
|
29
|
+
),
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class UpdateProjectRequestBodyTypedDict(TypedDict):
|
|
34
|
+
rate_limit: float
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class UpdateProjectRequestBody(BaseModel):
|
|
38
|
+
rate_limit: Annotated[float, pydantic.Field(alias="rateLimit")]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class UpdateProjectRequestTypedDict(TypedDict):
|
|
42
|
+
project_name: str
|
|
43
|
+
r"""Project name."""
|
|
44
|
+
request_body: UpdateProjectRequestBodyTypedDict
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class UpdateProjectRequest(BaseModel):
|
|
48
|
+
project_name: Annotated[
|
|
49
|
+
str,
|
|
50
|
+
pydantic.Field(alias="projectName"),
|
|
51
|
+
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
|
52
|
+
]
|
|
53
|
+
r"""Project name."""
|
|
54
|
+
|
|
55
|
+
request_body: Annotated[
|
|
56
|
+
UpdateProjectRequestBody,
|
|
57
|
+
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
|
58
|
+
]
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from lambdadb.types import BaseModel
|
|
5
|
+
from lambdadb.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
|
6
|
+
import pydantic
|
|
7
|
+
from typing import List, Optional
|
|
8
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class UpsertDocsDocTypedDict(TypedDict):
|
|
12
|
+
pass
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class UpsertDocsDoc(BaseModel):
|
|
16
|
+
pass
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class UpsertDocsRequestBodyTypedDict(TypedDict):
|
|
20
|
+
docs: List[UpsertDocsDocTypedDict]
|
|
21
|
+
r"""A list of documents to upsert."""
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class UpsertDocsRequestBody(BaseModel):
|
|
25
|
+
docs: List[UpsertDocsDoc]
|
|
26
|
+
r"""A list of documents to upsert."""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class UpsertDocsRequestTypedDict(TypedDict):
|
|
30
|
+
project_name: str
|
|
31
|
+
r"""Project name."""
|
|
32
|
+
collection_name: str
|
|
33
|
+
r"""Collection name."""
|
|
34
|
+
request_body: UpsertDocsRequestBodyTypedDict
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class UpsertDocsRequest(BaseModel):
|
|
38
|
+
project_name: Annotated[
|
|
39
|
+
str,
|
|
40
|
+
pydantic.Field(alias="projectName"),
|
|
41
|
+
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
|
42
|
+
]
|
|
43
|
+
r"""Project name."""
|
|
44
|
+
|
|
45
|
+
collection_name: Annotated[
|
|
46
|
+
str,
|
|
47
|
+
pydantic.Field(alias="collectionName"),
|
|
48
|
+
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
|
49
|
+
]
|
|
50
|
+
r"""Collection name."""
|
|
51
|
+
|
|
52
|
+
request_body: Annotated[
|
|
53
|
+
UpsertDocsRequestBody,
|
|
54
|
+
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class UpsertDocsResponseTypedDict(TypedDict):
|
|
59
|
+
r"""Upsert request accepted."""
|
|
60
|
+
|
|
61
|
+
message: NotRequired[str]
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class UpsertDocsResponse(BaseModel):
|
|
65
|
+
r"""Upsert request accepted."""
|
|
66
|
+
|
|
67
|
+
message: Optional[str] = None
|