-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use crate::qdrant::*; | ||
|
||
pub struct HasVectorConditionBuilder { | ||
pub(crate) vector_name: String, | ||
} | ||
|
||
impl HasVectorConditionBuilder { | ||
pub fn new(vector_name: impl Into<String>) -> Self { | ||
Self { | ||
vector_name: vector_name.into(), | ||
} | ||
} | ||
|
||
/// Builds the desired type. Can often be omitted. | ||
fn build(self) -> HasVectorCondition { | ||
HasVectorCondition { | ||
has_vector: self.vector_name, | ||
} | ||
} | ||
} | ||
|
||
impl From<String> for HasVectorConditionBuilder { | ||
fn from(vector_name: String) -> Self { | ||
Self::new(vector_name) | ||
} | ||
} | ||
|
||
impl From<HasVectorConditionBuilder> for HasVectorCondition { | ||
fn from(value: HasVectorConditionBuilder) -> Self { | ||
value.build() | ||
} | ||
} | ||
|
||
impl From<String> for HasVectorCondition { | ||
fn from(vector_name: String) -> Self { | ||
HasVectorConditionBuilder::from(vector_name).into() | ||
} | ||
} |
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