pub struct SemanticOptions {Show 13 fields
pub provider: Provider,
pub threshold: f32,
pub same_threshold: Option<f32>,
pub scope: SemanticScope,
pub model: String,
pub url: String,
pub dimensions: Option<u32>,
pub params: Map<String, Value>,
pub prefix: Option<String>,
pub cache: bool,
pub url_from_config: bool,
pub on_command_line: bool,
pub rebuild_cache: bool,
}Expand description
What --semantic runs with, after merging flags and the config file.
Fields§
§provider: Provider§threshold: f32Lowest cosine similarity of a pair across languages.
same_threshold: Option<f32>Lowest cosine similarity of a pair within one language; None
keeps the model’s gap above threshold (see catalog::thresholds).
scope: SemanticScope§model: String§url: StringThe embeddings API; only the http provider uses it.
dimensions: Option<u32>§params: Map<String, Value>Extra request fields for an API, e.g. {"task": "code2code.query"}.
prefix: Option<String>Put before every function text; None is the prefix of a model in
catalog, or none.
cache: bool§url_from_config: boolWhether url came from a config file rather than the command line.
A config file is shared, and can arrive with the code being scanned,
so such a URL, unless it is on this machine, gets no API key, and
gets code only when --semantic itself was typed.
on_command_line: boolWhether --semantic was given on the command line, rather than
turned on by a config file.
rebuild_cache: bool--semantic-rebuild-cache: embed every function again and replace
the cached vectors of this model and request shape.
Implementations§
Source§impl SemanticOptions
impl SemanticOptions
Sourcepub fn thresholds(&self) -> Thresholds
pub fn thresholds(&self) -> Thresholds
The thresholds of the rules: the model’s (see catalog), with
Self::threshold and Self::same_threshold put in.
Trait Implementations§
Source§impl Clone for SemanticOptions
impl Clone for SemanticOptions
Source§impl Debug for SemanticOptions
impl Debug for SemanticOptions
Source§impl Default for SemanticOptions
impl Default for SemanticOptions
Source§impl PartialEq for SemanticOptions
impl PartialEq for SemanticOptions
Source§impl Serialize for SemanticOptions
impl Serialize for SemanticOptions
impl StructuralPartialEq for SemanticOptions
Auto Trait Implementations§
impl Freeze for SemanticOptions
impl RefUnwindSafe for SemanticOptions
impl Send for SemanticOptions
impl Sync for SemanticOptions
impl Unpin for SemanticOptions
impl UnsafeUnpin for SemanticOptions
impl UnwindSafe for SemanticOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more