-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regen REST model for StrictModeConfig output type #916
Draft
agourlay
wants to merge
5
commits into
dev
Choose a base branch
from
regen-rest-model-for-strict-config-output-type
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7b83229
Regen REST model for StrictModeConfig output type
agourlay a633e61
fix conversion type
agourlay d285665
regen with new telemetry
agourlay bfca8d0
Update gRPC as well because other types are involved
agourlay eef5010
Clean script
agourlay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,9 @@ | |
Payload = Dict[str, Any] | ||
SparseVectorsConfig = Dict[str, "SparseVectorParams"] | ||
StrictModeMultivectorConfig = Dict[str, "StrictModeMultivector"] | ||
StrictModeMultivectorConfigOutput = Dict[str, "StrictModeMultivectorOutput"] | ||
StrictModeSparseConfig = Dict[str, "StrictModeSparse"] | ||
StrictModeSparseConfigOutput = Dict[str, "StrictModeSparseOutput"] | ||
VectorsConfigDiff = Dict[str, "VectorParamsDiff"] | ||
|
||
|
||
|
@@ -27,6 +29,10 @@ class AbortTransferOperation(BaseModel, extra="forbid"): | |
abort_transfer: "AbortShardTransfer" = Field(..., description="") | ||
|
||
|
||
class AbsExpression(BaseModel, extra="forbid"): | ||
abs: "Expression" = Field(..., description="") | ||
|
||
|
||
class AliasDescription(BaseModel): | ||
alias_name: str = Field(..., description="") | ||
collection_name: str = Field(..., description="") | ||
|
@@ -164,18 +170,18 @@ class CollectionConfig(BaseModel): | |
quantization_config: Optional["QuantizationConfig"] = Field( | ||
default=None, description="Information about the collection configuration" | ||
) | ||
strict_mode_config: Optional["StrictModeConfig"] = Field( | ||
strict_mode_config: Optional["StrictModeConfigOutput"] = Field( | ||
default=None, description="Information about the collection configuration" | ||
) | ||
|
||
|
||
class CollectionConfigInternal(BaseModel): | ||
class CollectionConfigTelemetry(BaseModel): | ||
params: "CollectionParams" = Field(..., description="") | ||
hnsw_config: "HnswConfig" = Field(..., description="") | ||
optimizer_config: "OptimizersConfig" = Field(..., description="") | ||
wal_config: "WalConfig" = Field(..., description="") | ||
quantization_config: Optional["QuantizationConfig"] = Field(default=None, description="") | ||
strict_mode_config: Optional["StrictModeConfig"] = Field(default=None, description="") | ||
strict_mode_config: Optional["StrictModeConfigOutput"] = Field(default=None, description="") | ||
uuid: Optional[UUID] = Field(default=None, description="") | ||
|
||
|
||
|
@@ -276,7 +282,7 @@ def __str__(self) -> str: | |
class CollectionTelemetry(BaseModel): | ||
id: str = Field(..., description="") | ||
init_time_ms: int = Field(..., description="") | ||
config: "CollectionConfigInternal" = Field(..., description="") | ||
config: "CollectionConfigTelemetry" = Field(..., description="") | ||
shards: List["ReplicaSetTelemetry"] = Field(..., description="") | ||
transfers: List["ShardTransferInfo"] = Field(..., description="") | ||
resharding: List["ReshardingInfo"] = Field(..., description="") | ||
|
@@ -632,6 +638,16 @@ def __str__(self) -> str: | |
MANHATTAN = "Manhattan" | ||
|
||
|
||
class DivExpression(BaseModel, extra="forbid"): | ||
div: "DivParams" = Field(..., description="") | ||
|
||
|
||
class DivParams(BaseModel, extra="forbid"): | ||
left: "Expression" = Field(..., description="") | ||
right: "Expression" = Field(..., description="") | ||
by_zero_default: Optional[float] = Field(default=None, description="") | ||
|
||
|
||
class Document(BaseModel, extra="forbid"): | ||
""" | ||
WARN: Work-in-progress, unimplemented Text document for embedding. Requires inference infrastructure, unimplemented. | ||
|
@@ -668,6 +684,10 @@ class ErrorResponseStatus(BaseModel): | |
error: Optional[str] = Field(default=None, description="Description of the occurred error.") | ||
|
||
|
||
class ExpExpression(BaseModel, extra="forbid"): | ||
exp: "Expression" = Field(..., description="") | ||
|
||
|
||
class FacetRequest(BaseModel, extra="forbid"): | ||
shard_key: Optional["ShardKeySelector"] = Field(default=None, description="") | ||
key: str = Field(..., description="Payload key to use for faceting.") | ||
|
@@ -699,13 +719,21 @@ class FieldCondition(BaseModel, extra="forbid"): | |
match: Optional["Match"] = Field(default=None, description="Check if point has field with a given value") | ||
range: Optional["RangeInterface"] = Field(default=None, description="Check if points value lies in a given range") | ||
geo_bounding_box: Optional["GeoBoundingBox"] = Field( | ||
default=None, description="Check if points geo location lies in a given area" | ||
default=None, description="Check if points geolocation lies in a given area" | ||
) | ||
geo_radius: Optional["GeoRadius"] = Field(default=None, description="Check if geo point is within a given radius") | ||
geo_polygon: Optional["GeoPolygon"] = Field( | ||
default=None, description="Check if geo point is within a given polygon" | ||
) | ||
values_count: Optional["ValuesCount"] = Field(default=None, description="Check number of values of the field") | ||
is_empty: Optional[bool] = Field( | ||
default=None, | ||
description="Check that the field is empty, alternative syntax for `is_empty: \"field_name\"`", | ||
) | ||
is_null: Optional[bool] = Field( | ||
default=None, | ||
description="Check that the field is null, alternative syntax for `is_null: \"field_name\"`", | ||
) | ||
|
||
|
||
class Filter(BaseModel, extra="forbid"): | ||
|
@@ -739,6 +767,11 @@ class FloatIndexType(str, Enum): | |
FLOAT = "float" | ||
|
||
|
||
class FormulaQuery(BaseModel, extra="forbid"): | ||
formula: "Expression" = Field(..., description="") | ||
defaults: Optional[Dict[str, Any]] = Field(default={}, description="") | ||
|
||
|
||
class Fusion(str, Enum): | ||
""" | ||
Fusion algorithm allows to combine results of multiple prefetches. Available fusion algorithms: * `rrf` - Reciprocal Rank Fusion * `dbsf` - Distribution-Based Score Fusion | ||
|
@@ -770,6 +803,15 @@ class GeoBoundingBox(BaseModel, extra="forbid"): | |
) | ||
|
||
|
||
class GeoDistance(BaseModel, extra="forbid"): | ||
geo_distance: "GeoDistanceParams" = Field(..., description="") | ||
|
||
|
||
class GeoDistanceParams(BaseModel, extra="forbid"): | ||
origin: "GeoPoint" = Field(..., description="") | ||
to: str = Field(..., description="Payload field with the destination geo point") | ||
|
||
|
||
class GeoIndexParams(BaseModel, extra="forbid"): | ||
type: "GeoIndexType" = Field(..., description="") | ||
on_disk: Optional[bool] = Field(default=None, description="If true, store the index on disk. Default: false.") | ||
|
@@ -1224,6 +1266,10 @@ class KeywordIndexType(str, Enum): | |
KEYWORD = "keyword" | ||
|
||
|
||
class LnExpression(BaseModel, extra="forbid"): | ||
ln: "Expression" = Field(..., description="") | ||
|
||
|
||
class LocalShardInfo(BaseModel): | ||
shard_id: int = Field(..., description="Local shard id") | ||
shard_key: Optional["ShardKey"] = Field(default=None, description="User-defined sharding key") | ||
|
@@ -1245,6 +1291,10 @@ class LocksOption(BaseModel, extra="forbid"): | |
write: bool = Field(..., description="") | ||
|
||
|
||
class Log10Expression(BaseModel, extra="forbid"): | ||
log10: "Expression" = Field(..., description="") | ||
|
||
|
||
class LookupLocation(BaseModel, extra="forbid"): | ||
""" | ||
Defines a location to use for looking up the vector. Specifies collection and vector field name. | ||
|
@@ -1349,6 +1399,10 @@ class MoveShardOperation(BaseModel, extra="forbid"): | |
move_shard: "MoveShard" = Field(..., description="") | ||
|
||
|
||
class MultExpression(BaseModel, extra="forbid"): | ||
mult: List["Expression"] = Field(..., description="") | ||
|
||
|
||
class MultiVectorComparator(str, Enum): | ||
MAX_SIM = "max_sim" | ||
|
||
|
@@ -1379,6 +1433,10 @@ class NearestQuery(BaseModel, extra="forbid"): | |
nearest: "VectorInput" = Field(..., description="") | ||
|
||
|
||
class NegExpression(BaseModel, extra="forbid"): | ||
neg: "Expression" = Field(..., description="") | ||
|
||
|
||
class Nested(BaseModel, extra="forbid"): | ||
""" | ||
Select points with payload for a specified nested field | ||
|
@@ -1641,6 +1699,15 @@ class PointsList(BaseModel, extra="forbid"): | |
shard_key: Optional["ShardKeySelector"] = Field(default=None, description="") | ||
|
||
|
||
class PowExpression(BaseModel, extra="forbid"): | ||
pow: "PowParams" = Field(..., description="") | ||
|
||
|
||
class PowParams(BaseModel, extra="forbid"): | ||
base: "Expression" = Field(..., description="") | ||
exponent: "Expression" = Field(..., description="") | ||
|
||
|
||
class Prefetch(BaseModel, extra="forbid"): | ||
prefetch: Optional[Union[List["Prefetch"], "Prefetch"]] = Field( | ||
default=None, | ||
|
@@ -2632,6 +2699,10 @@ def __str__(self) -> str: | |
MMAP = "mmap" | ||
|
||
|
||
class SqrtExpression(BaseModel, extra="forbid"): | ||
sqrt: "Expression" = Field(..., description="") | ||
|
||
|
||
class StartResharding(BaseModel, extra="forbid"): | ||
direction: "ReshardingDirection" = Field(..., description="") | ||
peer_id: Optional[int] = Field(default=None, description="") | ||
|
@@ -2663,10 +2734,10 @@ class StrictModeConfig(BaseModel, extra="forbid"): | |
) | ||
max_timeout: Optional[int] = Field(default=None, description="Max allowed `timeout` parameter.") | ||
unindexed_filtering_retrieve: Optional[bool] = Field( | ||
default=None, description="Allow usage of unindexed fields in retrieval based (eg. search) filters." | ||
default=None, description="Allow usage of unindexed fields in retrieval based (e.g. search) filters." | ||
) | ||
unindexed_filtering_update: Optional[bool] = Field( | ||
default=None, description="Allow usage of unindexed fields in filtered updates (eg. delete by payload)." | ||
default=None, description="Allow usage of unindexed fields in filtered updates (e.g. delete by payload)." | ||
) | ||
search_max_hnsw_ef: Optional[int] = Field(default=None, description="Max HNSW value allowed in search parameters.") | ||
search_allow_exact: Optional[bool] = Field(default=None, description="Whether exact search is allowed or not.") | ||
|
@@ -2697,14 +2768,69 @@ class StrictModeConfig(BaseModel, extra="forbid"): | |
sparse_config: Optional["StrictModeSparseConfig"] = Field(default=None, description="Sparse vector configuration") | ||
|
||
|
||
class StrictModeConfigOutput(BaseModel): | ||
enabled: Optional[bool] = Field(default=None, description="Whether strict mode is enabled for a collection or not.") | ||
max_query_limit: Optional[int] = Field( | ||
default=None, description="Max allowed `limit` parameter for all APIs that don't have their own max limit." | ||
) | ||
max_timeout: Optional[int] = Field(default=None, description="Max allowed `timeout` parameter.") | ||
unindexed_filtering_retrieve: Optional[bool] = Field( | ||
default=None, description="Allow usage of unindexed fields in retrieval based (e.g. search) filters." | ||
) | ||
unindexed_filtering_update: Optional[bool] = Field( | ||
default=None, description="Allow usage of unindexed fields in filtered updates (e.g. delete by payload)." | ||
) | ||
search_max_hnsw_ef: Optional[int] = Field(default=None, description="Max HNSW value allowed in search parameters.") | ||
search_allow_exact: Optional[bool] = Field(default=None, description="Whether exact search is allowed or not.") | ||
search_max_oversampling: Optional[float] = Field( | ||
default=None, description="Max oversampling value allowed in search." | ||
) | ||
upsert_max_batchsize: Optional[int] = Field(default=None, description="Max batchsize when upserting") | ||
max_collection_vector_size_bytes: Optional[int] = Field( | ||
default=None, description="Max size of a collections vector storage in bytes, ignoring replicas." | ||
) | ||
read_rate_limit: Optional[int] = Field( | ||
default=None, description="Max number of read operations per minute per replica" | ||
) | ||
write_rate_limit: Optional[int] = Field( | ||
default=None, description="Max number of write operations per minute per replica" | ||
) | ||
max_collection_payload_size_bytes: Optional[int] = Field( | ||
default=None, description="Max size of a collections payload storage in bytes" | ||
) | ||
max_points_count: Optional[int] = Field(default=None, description="Max number of points estimated in a collection") | ||
filter_max_conditions: Optional[int] = Field(default=None, description="Max conditions a filter can have.") | ||
condition_max_size: Optional[int] = Field( | ||
default=None, description="Max size of a condition, eg. items in `MatchAny`." | ||
) | ||
multivector_config: Optional["StrictModeMultivectorConfigOutput"] = Field( | ||
default=None, description="Multivector configuration" | ||
) | ||
sparse_config: Optional["StrictModeSparseConfigOutput"] = Field( | ||
default=None, description="Sparse vector configuration" | ||
) | ||
|
||
|
||
class StrictModeMultivector(BaseModel, extra="forbid"): | ||
max_vectors: Optional[int] = Field(default=None, description="Max number of vectors in a multivector") | ||
|
||
|
||
class StrictModeMultivectorOutput(BaseModel): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no |
||
max_vectors: Optional[int] = Field(default=None, description="Max number of vectors in a multivector") | ||
|
||
|
||
class StrictModeSparse(BaseModel, extra="forbid"): | ||
max_length: Optional[int] = Field(default=None, description="Max length of sparse vector") | ||
|
||
|
||
class StrictModeSparseOutput(BaseModel): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no |
||
max_length: Optional[int] = Field(default=None, description="Max length of sparse vector") | ||
|
||
|
||
class SumExpression(BaseModel, extra="forbid"): | ||
sum: List["Expression"] = Field(..., description="") | ||
|
||
|
||
class TelemetryData(BaseModel): | ||
id: str = Field(..., description="") | ||
app: "AppBuildTelemetry" = Field(..., description="") | ||
|
@@ -3161,6 +3287,7 @@ def __str__(self) -> str: | |
ContextQuery, | ||
OrderByQuery, | ||
FusionQuery, | ||
FormulaQuery, | ||
SampleQuery, | ||
] | ||
RangeInterface = Union[ | ||
|
@@ -3270,6 +3397,22 @@ def __str__(self) -> str: | |
List[Image], | ||
List[InferenceObject], | ||
] | ||
Expression = Union[ | ||
StrictFloat, | ||
StrictStr, | ||
Condition, | ||
MultExpression, | ||
SumExpression, | ||
NegExpression, | ||
AbsExpression, | ||
DivExpression, | ||
SqrtExpression, | ||
PowExpression, | ||
ExpExpression, | ||
Log10Expression, | ||
LnExpression, | ||
GeoDistance, | ||
] | ||
PayloadFieldSchema = Union[ | ||
PayloadSchemaType, | ||
PayloadSchemaParams, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no
extra="forbid"