Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
290 changes: 290 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
"release:patch:all": "npm run release:python patch && npm run release:ts patch",
"release:minor:all": "npm run release:python minor && npm run release:ts minor",
"release:major:all": "npm run release:python major && npm run release:ts major",
"download-spec": "curl -fs -o ./vectorize_api.json https://platform.vectorize.io/api/openapi",
"download-spec:dev": "curl -fs -o ./vectorize_api.json http://localhost:3000/api/openapi"
"download-spec": "curl -fs -o ./vectorize_api.json https://platform.vectorize.io/api/openapi",
"download-spec:dev": "curl -fs -o ./vectorize_api.json http://localhost:3000/api/openapi"
},
"author": "",
"license": "ISC",
"dependencies": {
"@iarna/toml": "^2.2.5",
"axios": "^1.10.0",
"axis": "^1.0.0",
"toml": "^3.0.0"
},
"devDependencies": {
Expand Down
13 changes: 13 additions & 0 deletions src/python/vectorize_client/models/advanced_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class AdvancedQuery(BaseModel):
match_type: Optional[StrictStr] = Field(default=None, alias="match-type")
text_boost: Optional[Union[StrictFloat, StrictInt]] = Field(default=1.0, alias="text-boost")
filters: Optional[Dict[str, Any]] = None
additional_properties: Dict[str, Any] = {}
__properties: ClassVar[List[str]] = ["mode", "text-fields", "match-type", "text-boost", "filters"]

@field_validator('mode')
Expand Down Expand Up @@ -83,15 +84,22 @@ def to_dict(self) -> Dict[str, Any]:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
* Fields in `self.additional_properties` are added to the output dict.
"""
excluded_fields: Set[str] = set([
"additional_properties",
])

_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
_dict[_key] = _value

return _dict

@classmethod
Expand All @@ -110,6 +118,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"text-boost": obj.get("text-boost") if obj.get("text-boost") is not None else 1.0,
"filters": obj.get("filters")
})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)

return _obj


Loading
Loading