pub struct AdvisorDeclaration {
pub id: String,
pub title: String,
pub transport: AdvisorTransport,
pub adapter: String,
pub provider: Option<String>,
pub vendor: Option<String>,
pub model: Option<String>,
pub executable: Option<String>,
pub capabilities: Vec<String>,
pub note: Option<String>,
}Expand description
One declared advisor: its id, how it is reached and through which adapter, what it references in the provider and model tables, the executable that says it is installed, and the advisory capabilities it offers.
use majordomus_cli::reasoning::catalogue::{AdvisorDeclaration, AdvisorTransport};
let a: AdvisorDeclaration = majordomus_cli::metadata::yaml::parse_into(
"id: b\ntitle: B\ntransport: cli\nadapter: b-cli\nexecutable: b\ncapabilities: [code_review]\n",
).unwrap();
assert_eq!(a.transport, AdvisorTransport::Cli);
assert_eq!(a.executable.as_deref(), Some("b"));
assert!(a.vendor.is_none() && a.model.is_none());Fields§
§id: StringThe advisor id, unique in the catalogue: what records and configuration name.
title: StringThe human name.
transport: AdvisorTransportHow it is reached.
adapter: StringThe transport adapter that speaks to it: a module scripts/lib/advisors/<adapter>.mjs.
provider: Option<String>The provider it runs as (share/providers.yaml), for a client tool.
vendor: Option<String>The vendor that serves it (share/models.yaml), for an API or a local runtime.
model: Option<String>The model it asks (share/models.yaml), when the catalogue declares it.
executable: Option<String>The executable whose presence on PATH says it is installed.
capabilities: Vec<String>The advisory capabilities it offers, from the declared vocabulary.
note: Option<String>One line a person needs when choosing.
Trait Implementations§
Source§impl Clone for AdvisorDeclaration
impl Clone for AdvisorDeclaration
Source§fn clone(&self) -> AdvisorDeclaration
fn clone(&self) -> AdvisorDeclaration
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AdvisorDeclaration
impl Debug for AdvisorDeclaration
Source§impl<'de> Deserialize<'de> for AdvisorDeclaration
impl<'de> Deserialize<'de> for AdvisorDeclaration
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for AdvisorDeclaration
impl JsonSchema for AdvisorDeclaration
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more