lambdadb 0.3.4__py3-none-any.whl → 0.3.6__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/_version.py +3 -3
- lambdadb/basesdk.py +4 -4
- lambdadb/collections.py +234 -350
- lambdadb/docs.py +239 -367
- lambdadb/errors/__init__.py +9 -0
- lambdadb/errors/apierror.py +30 -14
- lambdadb/errors/badrequest_error.py +12 -6
- lambdadb/errors/internalservererror.py +12 -6
- lambdadb/errors/lambdadberror.py +26 -0
- lambdadb/errors/no_response_error.py +13 -0
- lambdadb/errors/resourcealreadyexists_error.py +12 -6
- lambdadb/errors/resourcenotfound_error.py +12 -6
- lambdadb/errors/responsevalidationerror.py +25 -0
- lambdadb/errors/toomanyrequests_error.py +12 -6
- lambdadb/errors/unauthenticated_error.py +12 -6
- lambdadb/models/__init__.py +0 -42
- lambdadb/models/deletedocsop.py +3 -11
- lambdadb/models/fetchdocsop.py +5 -13
- lambdadb/models/querycollectionop.py +11 -35
- lambdadb/models/updatedocsop.py +3 -11
- lambdadb/models/upsertdocsop.py +3 -11
- lambdadb/utils/__init__.py +3 -0
- lambdadb/utils/serializers.py +21 -3
- {lambdadb-0.3.4.dist-info → lambdadb-0.3.6.dist-info}/METADATA +49 -36
- {lambdadb-0.3.4.dist-info → lambdadb-0.3.6.dist-info}/RECORD +27 -24
- {lambdadb-0.3.4.dist-info → lambdadb-0.3.6.dist-info}/LICENSE +0 -0
- {lambdadb-0.3.4.dist-info → lambdadb-0.3.6.dist-info}/WHEEL +0 -0
lambdadb/errors/__init__.py
CHANGED
|
@@ -7,11 +7,14 @@ if TYPE_CHECKING:
|
|
|
7
7
|
from .apierror import APIError
|
|
8
8
|
from .badrequest_error import BadRequestError, BadRequestErrorData
|
|
9
9
|
from .internalservererror import InternalServerError, InternalServerErrorData
|
|
10
|
+
from .lambdadberror import LambdaDBError
|
|
11
|
+
from .no_response_error import NoResponseError
|
|
10
12
|
from .resourcealreadyexists_error import (
|
|
11
13
|
ResourceAlreadyExistsError,
|
|
12
14
|
ResourceAlreadyExistsErrorData,
|
|
13
15
|
)
|
|
14
16
|
from .resourcenotfound_error import ResourceNotFoundError, ResourceNotFoundErrorData
|
|
17
|
+
from .responsevalidationerror import ResponseValidationError
|
|
15
18
|
from .toomanyrequests_error import TooManyRequestsError, TooManyRequestsErrorData
|
|
16
19
|
from .unauthenticated_error import UnauthenticatedError, UnauthenticatedErrorData
|
|
17
20
|
|
|
@@ -21,10 +24,13 @@ __all__ = [
|
|
|
21
24
|
"BadRequestErrorData",
|
|
22
25
|
"InternalServerError",
|
|
23
26
|
"InternalServerErrorData",
|
|
27
|
+
"LambdaDBError",
|
|
28
|
+
"NoResponseError",
|
|
24
29
|
"ResourceAlreadyExistsError",
|
|
25
30
|
"ResourceAlreadyExistsErrorData",
|
|
26
31
|
"ResourceNotFoundError",
|
|
27
32
|
"ResourceNotFoundErrorData",
|
|
33
|
+
"ResponseValidationError",
|
|
28
34
|
"TooManyRequestsError",
|
|
29
35
|
"TooManyRequestsErrorData",
|
|
30
36
|
"UnauthenticatedError",
|
|
@@ -37,10 +43,13 @@ _dynamic_imports: dict[str, str] = {
|
|
|
37
43
|
"BadRequestErrorData": ".badrequest_error",
|
|
38
44
|
"InternalServerError": ".internalservererror",
|
|
39
45
|
"InternalServerErrorData": ".internalservererror",
|
|
46
|
+
"LambdaDBError": ".lambdadberror",
|
|
47
|
+
"NoResponseError": ".no_response_error",
|
|
40
48
|
"ResourceAlreadyExistsError": ".resourcealreadyexists_error",
|
|
41
49
|
"ResourceAlreadyExistsErrorData": ".resourcealreadyexists_error",
|
|
42
50
|
"ResourceNotFoundError": ".resourcenotfound_error",
|
|
43
51
|
"ResourceNotFoundErrorData": ".resourcenotfound_error",
|
|
52
|
+
"ResponseValidationError": ".responsevalidationerror",
|
|
44
53
|
"TooManyRequestsError": ".toomanyrequests_error",
|
|
45
54
|
"TooManyRequestsErrorData": ".toomanyrequests_error",
|
|
46
55
|
"UnauthenticatedError": ".unauthenticated_error",
|
lambdadb/errors/apierror.py
CHANGED
|
@@ -1,22 +1,38 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
|
-
from dataclasses import dataclass
|
|
4
|
-
from typing import Optional
|
|
5
3
|
import httpx
|
|
4
|
+
from typing import Optional
|
|
5
|
+
|
|
6
|
+
from lambdadb.errors import LambdaDBError
|
|
7
|
+
|
|
8
|
+
MAX_MESSAGE_LEN = 10_000
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class APIError(LambdaDBError):
|
|
12
|
+
"""The fallback error class if no more specific error class is matched."""
|
|
13
|
+
|
|
14
|
+
def __init__(
|
|
15
|
+
self, message: str, raw_response: httpx.Response, body: Optional[str] = None
|
|
16
|
+
):
|
|
17
|
+
body_display = body or raw_response.text or '""'
|
|
6
18
|
|
|
19
|
+
if message:
|
|
20
|
+
message += ": "
|
|
21
|
+
message += f"Status {raw_response.status_code}"
|
|
7
22
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
23
|
+
headers = raw_response.headers
|
|
24
|
+
content_type = headers.get("content-type", '""')
|
|
25
|
+
if content_type != "application/json":
|
|
26
|
+
if " " in content_type:
|
|
27
|
+
content_type = f'"{content_type}"'
|
|
28
|
+
message += f" Content-Type {content_type}"
|
|
11
29
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
30
|
+
if len(body_display) > MAX_MESSAGE_LEN:
|
|
31
|
+
truncated = body_display[:MAX_MESSAGE_LEN]
|
|
32
|
+
remaining = len(body_display) - MAX_MESSAGE_LEN
|
|
33
|
+
body_display = f"{truncated}...and {remaining} more chars"
|
|
16
34
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if len(self.body) > 0:
|
|
20
|
-
body = f"\n{self.body}"
|
|
35
|
+
message += f". Body: {body_display}"
|
|
36
|
+
message = message.strip()
|
|
21
37
|
|
|
22
|
-
|
|
38
|
+
super().__init__(message, raw_response, body)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
|
|
4
|
+
import httpx
|
|
5
|
+
from lambdadb.errors import LambdaDBError
|
|
5
6
|
from lambdadb.types import BaseModel
|
|
6
7
|
from typing import Optional
|
|
7
8
|
|
|
@@ -10,11 +11,16 @@ class BadRequestErrorData(BaseModel):
|
|
|
10
11
|
message: Optional[str] = None
|
|
11
12
|
|
|
12
13
|
|
|
13
|
-
class BadRequestError(
|
|
14
|
+
class BadRequestError(LambdaDBError):
|
|
14
15
|
data: BadRequestErrorData
|
|
15
16
|
|
|
16
|
-
def __init__(
|
|
17
|
+
def __init__(
|
|
18
|
+
self,
|
|
19
|
+
data: BadRequestErrorData,
|
|
20
|
+
raw_response: httpx.Response,
|
|
21
|
+
body: Optional[str] = None,
|
|
22
|
+
):
|
|
23
|
+
fallback = body or raw_response.text
|
|
24
|
+
message = str(data.message) or fallback
|
|
25
|
+
super().__init__(message, raw_response, body)
|
|
17
26
|
self.data = data
|
|
18
|
-
|
|
19
|
-
def __str__(self) -> str:
|
|
20
|
-
return utils.marshal_json(self.data, BadRequestErrorData)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
|
|
4
|
+
import httpx
|
|
5
|
+
from lambdadb.errors import LambdaDBError
|
|
5
6
|
from lambdadb.types import BaseModel
|
|
6
7
|
from typing import Optional
|
|
7
8
|
|
|
@@ -10,11 +11,16 @@ class InternalServerErrorData(BaseModel):
|
|
|
10
11
|
message: Optional[str] = None
|
|
11
12
|
|
|
12
13
|
|
|
13
|
-
class InternalServerError(
|
|
14
|
+
class InternalServerError(LambdaDBError):
|
|
14
15
|
data: InternalServerErrorData
|
|
15
16
|
|
|
16
|
-
def __init__(
|
|
17
|
+
def __init__(
|
|
18
|
+
self,
|
|
19
|
+
data: InternalServerErrorData,
|
|
20
|
+
raw_response: httpx.Response,
|
|
21
|
+
body: Optional[str] = None,
|
|
22
|
+
):
|
|
23
|
+
fallback = body or raw_response.text
|
|
24
|
+
message = str(data.message) or fallback
|
|
25
|
+
super().__init__(message, raw_response, body)
|
|
17
26
|
self.data = data
|
|
18
|
-
|
|
19
|
-
def __str__(self) -> str:
|
|
20
|
-
return utils.marshal_json(self.data, InternalServerErrorData)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
from typing import Optional
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class LambdaDBError(Exception):
|
|
8
|
+
"""The base class for all HTTP error responses."""
|
|
9
|
+
|
|
10
|
+
message: str
|
|
11
|
+
status_code: int
|
|
12
|
+
body: str
|
|
13
|
+
headers: httpx.Headers
|
|
14
|
+
raw_response: httpx.Response
|
|
15
|
+
|
|
16
|
+
def __init__(
|
|
17
|
+
self, message: str, raw_response: httpx.Response, body: Optional[str] = None
|
|
18
|
+
):
|
|
19
|
+
self.message = message
|
|
20
|
+
self.status_code = raw_response.status_code
|
|
21
|
+
self.body = body if body is not None else raw_response.text
|
|
22
|
+
self.headers = raw_response.headers
|
|
23
|
+
self.raw_response = raw_response
|
|
24
|
+
|
|
25
|
+
def __str__(self):
|
|
26
|
+
return self.message
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
class NoResponseError(Exception):
|
|
4
|
+
"""Error raised when no HTTP response is received from the server."""
|
|
5
|
+
|
|
6
|
+
message: str
|
|
7
|
+
|
|
8
|
+
def __init__(self, message: str = "No response received"):
|
|
9
|
+
self.message = message
|
|
10
|
+
super().__init__(message)
|
|
11
|
+
|
|
12
|
+
def __str__(self):
|
|
13
|
+
return self.message
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
|
|
4
|
+
import httpx
|
|
5
|
+
from lambdadb.errors import LambdaDBError
|
|
5
6
|
from lambdadb.types import BaseModel
|
|
6
7
|
from typing import Optional
|
|
7
8
|
|
|
@@ -10,11 +11,16 @@ class ResourceAlreadyExistsErrorData(BaseModel):
|
|
|
10
11
|
message: Optional[str] = None
|
|
11
12
|
|
|
12
13
|
|
|
13
|
-
class ResourceAlreadyExistsError(
|
|
14
|
+
class ResourceAlreadyExistsError(LambdaDBError):
|
|
14
15
|
data: ResourceAlreadyExistsErrorData
|
|
15
16
|
|
|
16
|
-
def __init__(
|
|
17
|
+
def __init__(
|
|
18
|
+
self,
|
|
19
|
+
data: ResourceAlreadyExistsErrorData,
|
|
20
|
+
raw_response: httpx.Response,
|
|
21
|
+
body: Optional[str] = None,
|
|
22
|
+
):
|
|
23
|
+
fallback = body or raw_response.text
|
|
24
|
+
message = str(data.message) or fallback
|
|
25
|
+
super().__init__(message, raw_response, body)
|
|
17
26
|
self.data = data
|
|
18
|
-
|
|
19
|
-
def __str__(self) -> str:
|
|
20
|
-
return utils.marshal_json(self.data, ResourceAlreadyExistsErrorData)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
|
|
4
|
+
import httpx
|
|
5
|
+
from lambdadb.errors import LambdaDBError
|
|
5
6
|
from lambdadb.types import BaseModel
|
|
6
7
|
from typing import Optional
|
|
7
8
|
|
|
@@ -10,11 +11,16 @@ class ResourceNotFoundErrorData(BaseModel):
|
|
|
10
11
|
message: Optional[str] = None
|
|
11
12
|
|
|
12
13
|
|
|
13
|
-
class ResourceNotFoundError(
|
|
14
|
+
class ResourceNotFoundError(LambdaDBError):
|
|
14
15
|
data: ResourceNotFoundErrorData
|
|
15
16
|
|
|
16
|
-
def __init__(
|
|
17
|
+
def __init__(
|
|
18
|
+
self,
|
|
19
|
+
data: ResourceNotFoundErrorData,
|
|
20
|
+
raw_response: httpx.Response,
|
|
21
|
+
body: Optional[str] = None,
|
|
22
|
+
):
|
|
23
|
+
fallback = body or raw_response.text
|
|
24
|
+
message = str(data.message) or fallback
|
|
25
|
+
super().__init__(message, raw_response, body)
|
|
17
26
|
self.data = data
|
|
18
|
-
|
|
19
|
-
def __str__(self) -> str:
|
|
20
|
-
return utils.marshal_json(self.data, ResourceNotFoundErrorData)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
import httpx
|
|
4
|
+
from typing import Optional
|
|
5
|
+
|
|
6
|
+
from lambdadb.errors import LambdaDBError
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ResponseValidationError(LambdaDBError):
|
|
10
|
+
"""Error raised when there is a type mismatch between the response data and the expected Pydantic model."""
|
|
11
|
+
|
|
12
|
+
def __init__(
|
|
13
|
+
self,
|
|
14
|
+
message: str,
|
|
15
|
+
raw_response: httpx.Response,
|
|
16
|
+
cause: Exception,
|
|
17
|
+
body: Optional[str] = None,
|
|
18
|
+
):
|
|
19
|
+
message = f"{message}: {cause}"
|
|
20
|
+
super().__init__(message, raw_response, body)
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
def cause(self):
|
|
24
|
+
"""Normally the Pydantic ValidationError"""
|
|
25
|
+
return self.__cause__
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
|
|
4
|
+
import httpx
|
|
5
|
+
from lambdadb.errors import LambdaDBError
|
|
5
6
|
from lambdadb.types import BaseModel
|
|
6
7
|
from typing import Optional
|
|
7
8
|
|
|
@@ -10,11 +11,16 @@ class TooManyRequestsErrorData(BaseModel):
|
|
|
10
11
|
message: Optional[str] = None
|
|
11
12
|
|
|
12
13
|
|
|
13
|
-
class TooManyRequestsError(
|
|
14
|
+
class TooManyRequestsError(LambdaDBError):
|
|
14
15
|
data: TooManyRequestsErrorData
|
|
15
16
|
|
|
16
|
-
def __init__(
|
|
17
|
+
def __init__(
|
|
18
|
+
self,
|
|
19
|
+
data: TooManyRequestsErrorData,
|
|
20
|
+
raw_response: httpx.Response,
|
|
21
|
+
body: Optional[str] = None,
|
|
22
|
+
):
|
|
23
|
+
fallback = body or raw_response.text
|
|
24
|
+
message = str(data.message) or fallback
|
|
25
|
+
super().__init__(message, raw_response, body)
|
|
17
26
|
self.data = data
|
|
18
|
-
|
|
19
|
-
def __str__(self) -> str:
|
|
20
|
-
return utils.marshal_json(self.data, TooManyRequestsErrorData)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
|
|
4
|
+
import httpx
|
|
5
|
+
from lambdadb.errors import LambdaDBError
|
|
5
6
|
from lambdadb.types import BaseModel
|
|
6
7
|
from typing import Optional
|
|
7
8
|
|
|
@@ -10,11 +11,16 @@ class UnauthenticatedErrorData(BaseModel):
|
|
|
10
11
|
message: Optional[str] = None
|
|
11
12
|
|
|
12
13
|
|
|
13
|
-
class UnauthenticatedError(
|
|
14
|
+
class UnauthenticatedError(LambdaDBError):
|
|
14
15
|
data: UnauthenticatedErrorData
|
|
15
16
|
|
|
16
|
-
def __init__(
|
|
17
|
+
def __init__(
|
|
18
|
+
self,
|
|
19
|
+
data: UnauthenticatedErrorData,
|
|
20
|
+
raw_response: httpx.Response,
|
|
21
|
+
body: Optional[str] = None,
|
|
22
|
+
):
|
|
23
|
+
fallback = body or raw_response.text
|
|
24
|
+
message = str(data.message) or fallback
|
|
25
|
+
super().__init__(message, raw_response, body)
|
|
17
26
|
self.data = data
|
|
18
|
-
|
|
19
|
-
def __str__(self) -> str:
|
|
20
|
-
return utils.marshal_json(self.data, UnauthenticatedErrorData)
|
lambdadb/models/__init__.py
CHANGED
|
@@ -28,13 +28,9 @@ if TYPE_CHECKING:
|
|
|
28
28
|
DeleteDocsRequestBody,
|
|
29
29
|
DeleteDocsRequestBodyTypedDict,
|
|
30
30
|
DeleteDocsRequestTypedDict,
|
|
31
|
-
Filter,
|
|
32
|
-
FilterTypedDict,
|
|
33
31
|
)
|
|
34
32
|
from .fetchdocsop import (
|
|
35
33
|
FetchDocsDoc,
|
|
36
|
-
FetchDocsDocDoc,
|
|
37
|
-
FetchDocsDocDocTypedDict,
|
|
38
34
|
FetchDocsDocTypedDict,
|
|
39
35
|
FetchDocsRequest,
|
|
40
36
|
FetchDocsRequestBody,
|
|
@@ -80,10 +76,7 @@ if TYPE_CHECKING:
|
|
|
80
76
|
)
|
|
81
77
|
from .messageresponse import MessageResponse, MessageResponseTypedDict
|
|
82
78
|
from .querycollectionop import (
|
|
83
|
-
Query,
|
|
84
79
|
QueryCollectionDoc,
|
|
85
|
-
QueryCollectionDocDoc,
|
|
86
|
-
QueryCollectionDocDocTypedDict,
|
|
87
80
|
QueryCollectionDocTypedDict,
|
|
88
81
|
QueryCollectionRequest,
|
|
89
82
|
QueryCollectionRequestBody,
|
|
@@ -91,9 +84,6 @@ if TYPE_CHECKING:
|
|
|
91
84
|
QueryCollectionRequestTypedDict,
|
|
92
85
|
QueryCollectionResponse,
|
|
93
86
|
QueryCollectionResponseTypedDict,
|
|
94
|
-
QueryTypedDict,
|
|
95
|
-
Sort,
|
|
96
|
-
SortTypedDict,
|
|
97
87
|
)
|
|
98
88
|
from .security import Security, SecurityTypedDict
|
|
99
89
|
from .status import Status
|
|
@@ -106,16 +96,12 @@ if TYPE_CHECKING:
|
|
|
106
96
|
UpdateCollectionResponseTypedDict,
|
|
107
97
|
)
|
|
108
98
|
from .updatedocsop import (
|
|
109
|
-
UpdateDocsDoc,
|
|
110
|
-
UpdateDocsDocTypedDict,
|
|
111
99
|
UpdateDocsRequest,
|
|
112
100
|
UpdateDocsRequestBody,
|
|
113
101
|
UpdateDocsRequestBodyTypedDict,
|
|
114
102
|
UpdateDocsRequestTypedDict,
|
|
115
103
|
)
|
|
116
104
|
from .upsertdocsop import (
|
|
117
|
-
UpsertDocsDoc,
|
|
118
|
-
UpsertDocsDocTypedDict,
|
|
119
105
|
UpsertDocsRequest,
|
|
120
106
|
UpsertDocsRequestBody,
|
|
121
107
|
UpsertDocsRequestBodyTypedDict,
|
|
@@ -143,8 +129,6 @@ __all__ = [
|
|
|
143
129
|
"DeleteDocsRequestBodyTypedDict",
|
|
144
130
|
"DeleteDocsRequestTypedDict",
|
|
145
131
|
"FetchDocsDoc",
|
|
146
|
-
"FetchDocsDocDoc",
|
|
147
|
-
"FetchDocsDocDocTypedDict",
|
|
148
132
|
"FetchDocsDocTypedDict",
|
|
149
133
|
"FetchDocsRequest",
|
|
150
134
|
"FetchDocsRequestBody",
|
|
@@ -152,8 +136,6 @@ __all__ = [
|
|
|
152
136
|
"FetchDocsRequestTypedDict",
|
|
153
137
|
"FetchDocsResponse",
|
|
154
138
|
"FetchDocsResponseTypedDict",
|
|
155
|
-
"Filter",
|
|
156
|
-
"FilterTypedDict",
|
|
157
139
|
"GetBulkUpsertDocsRequest",
|
|
158
140
|
"GetBulkUpsertDocsRequestTypedDict",
|
|
159
141
|
"GetBulkUpsertDocsResponse",
|
|
@@ -178,10 +160,7 @@ __all__ = [
|
|
|
178
160
|
"ListCollectionsResponseTypedDict",
|
|
179
161
|
"MessageResponse",
|
|
180
162
|
"MessageResponseTypedDict",
|
|
181
|
-
"Query",
|
|
182
163
|
"QueryCollectionDoc",
|
|
183
|
-
"QueryCollectionDocDoc",
|
|
184
|
-
"QueryCollectionDocDocTypedDict",
|
|
185
164
|
"QueryCollectionDocTypedDict",
|
|
186
165
|
"QueryCollectionRequest",
|
|
187
166
|
"QueryCollectionRequestBody",
|
|
@@ -189,12 +168,9 @@ __all__ = [
|
|
|
189
168
|
"QueryCollectionRequestTypedDict",
|
|
190
169
|
"QueryCollectionResponse",
|
|
191
170
|
"QueryCollectionResponseTypedDict",
|
|
192
|
-
"QueryTypedDict",
|
|
193
171
|
"Security",
|
|
194
172
|
"SecurityTypedDict",
|
|
195
173
|
"Similarity",
|
|
196
|
-
"Sort",
|
|
197
|
-
"SortTypedDict",
|
|
198
174
|
"Status",
|
|
199
175
|
"Type",
|
|
200
176
|
"TypeText",
|
|
@@ -205,14 +181,10 @@ __all__ = [
|
|
|
205
181
|
"UpdateCollectionRequestTypedDict",
|
|
206
182
|
"UpdateCollectionResponse",
|
|
207
183
|
"UpdateCollectionResponseTypedDict",
|
|
208
|
-
"UpdateDocsDoc",
|
|
209
|
-
"UpdateDocsDocTypedDict",
|
|
210
184
|
"UpdateDocsRequest",
|
|
211
185
|
"UpdateDocsRequestBody",
|
|
212
186
|
"UpdateDocsRequestBodyTypedDict",
|
|
213
187
|
"UpdateDocsRequestTypedDict",
|
|
214
|
-
"UpsertDocsDoc",
|
|
215
|
-
"UpsertDocsDocTypedDict",
|
|
216
188
|
"UpsertDocsRequest",
|
|
217
189
|
"UpsertDocsRequestBody",
|
|
218
190
|
"UpsertDocsRequestBodyTypedDict",
|
|
@@ -238,11 +210,7 @@ _dynamic_imports: dict[str, str] = {
|
|
|
238
210
|
"DeleteDocsRequestBody": ".deletedocsop",
|
|
239
211
|
"DeleteDocsRequestBodyTypedDict": ".deletedocsop",
|
|
240
212
|
"DeleteDocsRequestTypedDict": ".deletedocsop",
|
|
241
|
-
"Filter": ".deletedocsop",
|
|
242
|
-
"FilterTypedDict": ".deletedocsop",
|
|
243
213
|
"FetchDocsDoc": ".fetchdocsop",
|
|
244
|
-
"FetchDocsDocDoc": ".fetchdocsop",
|
|
245
|
-
"FetchDocsDocDocTypedDict": ".fetchdocsop",
|
|
246
214
|
"FetchDocsDocTypedDict": ".fetchdocsop",
|
|
247
215
|
"FetchDocsRequest": ".fetchdocsop",
|
|
248
216
|
"FetchDocsRequestBody": ".fetchdocsop",
|
|
@@ -279,10 +247,7 @@ _dynamic_imports: dict[str, str] = {
|
|
|
279
247
|
"ListCollectionsResponseTypedDict": ".listcollectionsop",
|
|
280
248
|
"MessageResponse": ".messageresponse",
|
|
281
249
|
"MessageResponseTypedDict": ".messageresponse",
|
|
282
|
-
"Query": ".querycollectionop",
|
|
283
250
|
"QueryCollectionDoc": ".querycollectionop",
|
|
284
|
-
"QueryCollectionDocDoc": ".querycollectionop",
|
|
285
|
-
"QueryCollectionDocDocTypedDict": ".querycollectionop",
|
|
286
251
|
"QueryCollectionDocTypedDict": ".querycollectionop",
|
|
287
252
|
"QueryCollectionRequest": ".querycollectionop",
|
|
288
253
|
"QueryCollectionRequestBody": ".querycollectionop",
|
|
@@ -290,9 +255,6 @@ _dynamic_imports: dict[str, str] = {
|
|
|
290
255
|
"QueryCollectionRequestTypedDict": ".querycollectionop",
|
|
291
256
|
"QueryCollectionResponse": ".querycollectionop",
|
|
292
257
|
"QueryCollectionResponseTypedDict": ".querycollectionop",
|
|
293
|
-
"QueryTypedDict": ".querycollectionop",
|
|
294
|
-
"Sort": ".querycollectionop",
|
|
295
|
-
"SortTypedDict": ".querycollectionop",
|
|
296
258
|
"Security": ".security",
|
|
297
259
|
"SecurityTypedDict": ".security",
|
|
298
260
|
"Status": ".status",
|
|
@@ -302,14 +264,10 @@ _dynamic_imports: dict[str, str] = {
|
|
|
302
264
|
"UpdateCollectionRequestTypedDict": ".updatecollectionop",
|
|
303
265
|
"UpdateCollectionResponse": ".updatecollectionop",
|
|
304
266
|
"UpdateCollectionResponseTypedDict": ".updatecollectionop",
|
|
305
|
-
"UpdateDocsDoc": ".updatedocsop",
|
|
306
|
-
"UpdateDocsDocTypedDict": ".updatedocsop",
|
|
307
267
|
"UpdateDocsRequest": ".updatedocsop",
|
|
308
268
|
"UpdateDocsRequestBody": ".updatedocsop",
|
|
309
269
|
"UpdateDocsRequestBodyTypedDict": ".updatedocsop",
|
|
310
270
|
"UpdateDocsRequestTypedDict": ".updatedocsop",
|
|
311
|
-
"UpsertDocsDoc": ".upsertdocsop",
|
|
312
|
-
"UpsertDocsDocTypedDict": ".upsertdocsop",
|
|
313
271
|
"UpsertDocsRequest": ".upsertdocsop",
|
|
314
272
|
"UpsertDocsRequestBody": ".upsertdocsop",
|
|
315
273
|
"UpsertDocsRequestBodyTypedDict": ".upsertdocsop",
|
lambdadb/models/deletedocsop.py
CHANGED
|
@@ -4,22 +4,14 @@ from __future__ import annotations
|
|
|
4
4
|
from lambdadb.types import BaseModel
|
|
5
5
|
from lambdadb.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
|
6
6
|
import pydantic
|
|
7
|
-
from typing import List, Optional
|
|
7
|
+
from typing import Any, Dict, List, Optional
|
|
8
8
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class FilterTypedDict(TypedDict):
|
|
12
|
-
r"""Query filter."""
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class Filter(BaseModel):
|
|
16
|
-
r"""Query filter."""
|
|
17
|
-
|
|
18
|
-
|
|
19
11
|
class DeleteDocsRequestBodyTypedDict(TypedDict):
|
|
20
12
|
ids: NotRequired[List[str]]
|
|
21
13
|
r"""A list of document IDs."""
|
|
22
|
-
filter_: NotRequired[
|
|
14
|
+
filter_: NotRequired[Dict[str, Any]]
|
|
23
15
|
r"""Query filter."""
|
|
24
16
|
|
|
25
17
|
|
|
@@ -27,7 +19,7 @@ class DeleteDocsRequestBody(BaseModel):
|
|
|
27
19
|
ids: Optional[List[str]] = None
|
|
28
20
|
r"""A list of document IDs."""
|
|
29
21
|
|
|
30
|
-
filter_: Annotated[Optional[
|
|
22
|
+
filter_: Annotated[Optional[Dict[str, Any]], pydantic.Field(alias="filter")] = None
|
|
31
23
|
r"""Query filter."""
|
|
32
24
|
|
|
33
25
|
|
lambdadb/models/fetchdocsop.py
CHANGED
|
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
from lambdadb.types import BaseModel
|
|
5
5
|
from lambdadb.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
|
6
6
|
import pydantic
|
|
7
|
-
from typing import List, Optional
|
|
7
|
+
from typing import Any, Dict, List, Optional
|
|
8
8
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
9
9
|
|
|
10
10
|
|
|
@@ -61,23 +61,15 @@ class FetchDocsRequest(BaseModel):
|
|
|
61
61
|
]
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
class FetchDocsDocDocTypedDict(TypedDict):
|
|
65
|
-
pass
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
class FetchDocsDocDoc(BaseModel):
|
|
69
|
-
pass
|
|
70
|
-
|
|
71
|
-
|
|
72
64
|
class FetchDocsDocTypedDict(TypedDict):
|
|
73
|
-
collection:
|
|
74
|
-
doc:
|
|
65
|
+
collection: str
|
|
66
|
+
doc: Dict[str, Any]
|
|
75
67
|
|
|
76
68
|
|
|
77
69
|
class FetchDocsDoc(BaseModel):
|
|
78
|
-
collection:
|
|
70
|
+
collection: str
|
|
79
71
|
|
|
80
|
-
doc:
|
|
72
|
+
doc: Dict[str, Any]
|
|
81
73
|
|
|
82
74
|
|
|
83
75
|
class FetchDocsResponseTypedDict(TypedDict):
|
|
@@ -4,36 +4,20 @@ from __future__ import annotations
|
|
|
4
4
|
from lambdadb.types import BaseModel
|
|
5
5
|
from lambdadb.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
|
6
6
|
import pydantic
|
|
7
|
-
from typing import List, Optional
|
|
7
|
+
from typing import Any, Dict, List, Optional
|
|
8
8
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
9
9
|
|
|
10
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
11
|
class QueryCollectionRequestBodyTypedDict(TypedDict):
|
|
28
12
|
size: int
|
|
29
13
|
r"""Number of documents to return. Note that the maximum number of documents is 100."""
|
|
30
|
-
query: NotRequired[
|
|
14
|
+
query: NotRequired[Dict[str, Any]]
|
|
31
15
|
r"""Query object."""
|
|
32
16
|
consistent_read: NotRequired[bool]
|
|
33
17
|
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
18
|
include_vectors: NotRequired[bool]
|
|
35
19
|
r"""If your application need to include vector values in the response, set includeVectors to true."""
|
|
36
|
-
sort: NotRequired[List[
|
|
20
|
+
sort: NotRequired[List[Dict[str, Any]]]
|
|
37
21
|
r"""List of field name, sort direction pairs."""
|
|
38
22
|
fields: NotRequired[List[str]]
|
|
39
23
|
r"""List of field name to include in results"""
|
|
@@ -43,7 +27,7 @@ class QueryCollectionRequestBody(BaseModel):
|
|
|
43
27
|
size: int
|
|
44
28
|
r"""Number of documents to return. Note that the maximum number of documents is 100."""
|
|
45
29
|
|
|
46
|
-
query: Optional[
|
|
30
|
+
query: Optional[Dict[str, Any]] = None
|
|
47
31
|
r"""Query object."""
|
|
48
32
|
|
|
49
33
|
consistent_read: Annotated[
|
|
@@ -56,7 +40,7 @@ class QueryCollectionRequestBody(BaseModel):
|
|
|
56
40
|
] = False
|
|
57
41
|
r"""If your application need to include vector values in the response, set includeVectors to true."""
|
|
58
42
|
|
|
59
|
-
sort: Optional[List[
|
|
43
|
+
sort: Optional[List[Dict[str, Any]]] = None
|
|
60
44
|
r"""List of field name, sort direction pairs."""
|
|
61
45
|
|
|
62
46
|
fields: Optional[List[str]] = None
|
|
@@ -92,30 +76,22 @@ class QueryCollectionRequest(BaseModel):
|
|
|
92
76
|
]
|
|
93
77
|
|
|
94
78
|
|
|
95
|
-
class QueryCollectionDocDocTypedDict(TypedDict):
|
|
96
|
-
pass
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
class QueryCollectionDocDoc(BaseModel):
|
|
100
|
-
pass
|
|
101
|
-
|
|
102
|
-
|
|
103
79
|
class QueryCollectionDocTypedDict(TypedDict):
|
|
104
|
-
collection:
|
|
80
|
+
collection: str
|
|
105
81
|
r"""Collection name."""
|
|
106
|
-
score:
|
|
82
|
+
score: float
|
|
107
83
|
r"""Document similarity score."""
|
|
108
|
-
doc:
|
|
84
|
+
doc: Dict[str, Any]
|
|
109
85
|
|
|
110
86
|
|
|
111
87
|
class QueryCollectionDoc(BaseModel):
|
|
112
|
-
collection:
|
|
88
|
+
collection: str
|
|
113
89
|
r"""Collection name."""
|
|
114
90
|
|
|
115
|
-
score:
|
|
91
|
+
score: float
|
|
116
92
|
r"""Document similarity score."""
|
|
117
93
|
|
|
118
|
-
doc:
|
|
94
|
+
doc: Dict[str, Any]
|
|
119
95
|
|
|
120
96
|
|
|
121
97
|
class QueryCollectionResponseTypedDict(TypedDict):
|