pub struct Hint {
pub keywords: Vec<String>,
pub text: String,
pub regex: bool,
}Expand description
[[hints]] — one once-per-session keyword hint (CONTEXT.md §keyword hints).
The adapter’s user-prompt hook pipes the full user message to spt api hint;
a matching keyword surfaces text to the agent’s context channel, at most
once per session and once per message.
Fields§
§keywords: Vec<String>Keywords that fire the hint — literal case-insensitive substrings by
default; compiled as regex patterns when regex = true.
text: StringThe hint text surfaced when a keyword matches.
regex: boolTreat keywords as regex patterns instead of literal substrings.
Implementations§
Source§impl Hint
impl Hint
Sourcepub fn matched_keyword(&self, message: &str) -> Option<&str>
pub fn matched_keyword(&self, message: &str) -> Option<&str>
The first keyword that fires against message (literal case-insensitive
substring, or regex when regex = true); None if none match. An invalid
regex never matches — a bad pattern silences its own hint, never panics
(best-effort, the opaque-template stance).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Hint
impl<'de> Deserialize<'de> for Hint
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 Hint
impl JsonSchema for Hint
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