MCPcopy Create free account
hub / github.com/alibaba/zvec / _validate

Method _validate

python/zvec/model/param/query.py:117–130  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

115 return False
116
117 def _validate(self) -> None:
118 if self.field_name is None:
119 raise ValueError("Field name cannot be empty")
120 if self.has_id() and self.has_vector():
121 raise ValueError("Cannot provide both id and vector")
122 if self.has_fts() and (self.has_vector() or self.has_id()):
123 raise ValueError(
124 "Cannot combine fts with vector search fields (id/vector) in a single Query"
125 )
126 if self.fts is not None and self.fts.query_string and self.fts.match_string:
127 raise ValueError(
128 "Cannot provide both query_string and match_string in Fts; "
129 "they are mutually exclusive"
130 )
131
132
133class VectorQuery(Query):

Calls 3

has_idMethod · 0.95
has_vectorMethod · 0.95
has_ftsMethod · 0.95