pub struct AgentBehaviorConfig {
pub visibility: Visibility,
pub instructions: Option<String>,
pub persona: Option<String>,
pub greeting: Option<String>,
pub conversation_workflow: Option<ConversationWorkflow>,
pub enabled_tools: Vec<EnabledTool>,
}Expand description
The resolved per-agent behavior knobs. Every field is optional so a partial
or malformed agents row degrades cleanly to the org default.
Fields§
§visibility: VisibilityWhere the agent is reachable — gates tool auth. Defaults to Public.
instructions: Option<String>instructions.prompt — the agent’s system prompt / persona. When present
it overrides the org default persona for this agent’s conversations.
persona: Option<String>personality.persona — an optional custom-persona addendum appended to
the system prompt.
greeting: Option<String>greeting — an optional opening line, injected into the prompt only on
the first turn of a conversation (see [greeting_section]).
conversation_workflow: Option<ConversationWorkflow>conversation_workflow — the optional stepped guided flow. None (or a
malformed / empty-steps value) means the agent runs freeform.
enabled_tools: Vec<EnabledTool>tool_config.enabledTools — a tool allow-list. When non-empty, this
agent’s turns are restricted to the enabled == true entries’ tool_id
(empty ⇒ the full server tool set). Unknown tool ids are ignored.
Implementations§
Source§impl AgentBehaviorConfig
impl AgentBehaviorConfig
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
true when the row carried nothing usable — the runner should stay on the
org default persona and take no workflow path.
Sourcepub fn system_prompt(&self) -> Option<String>
pub fn system_prompt(&self) -> Option<String>
Build the per-agent system prompt from instructions (+ optional persona),
or None when there are no instructions to anchor it.
None is the signal to fall back to the org default persona — a bare
persona with no instructions is not enough to define an agent. The greeting
is handled separately (greeting_section) because
it is injected first-turn-only.
Sourcepub fn greeting_section(&self) -> Option<String>
pub fn greeting_section(&self) -> Option<String>
The <GreetingAwareness> prompt section, or None when no greeting is set.
The caller injects it only on the FIRST turn (empty prior history), so the
agent opens with it once. Mirrors the sibling lanes’ first-turn greeting.
Sourcepub fn enabled_tool_ids(&self) -> Option<Vec<String>>
pub fn enabled_tool_ids(&self) -> Option<Vec<String>>
The enabled tool-id allow-list, or None when unrestricted (no
tool_config / empty enabledTools ⇒ the full server tool set).
Some(ids) restricts the turn to those snake_case ids (enabled == true
entries only); unknown ids simply match nothing.
Sourcepub fn auth_level_for(&self, tool_id: &str) -> AuthLevel
pub fn auth_level_for(&self, tool_id: &str) -> AuthLevel
The configured AuthLevel for a tool id (from its enabledTools
entry), or AuthLevel::None when unconfigured.
Sourcepub fn tool_configs(&self) -> HashMap<String, Value>
pub fn tool_configs(&self) -> HashMap<String, Value>
The per-tool config object delivered to a tool at execution (the
enabledTools entry’s config), for every entry that carries one. Empty
when no tool has config. Mirrors registry.ts’s toolSpecificConfig.
Sourcepub fn from_row_values(
instructions: Option<Value>,
personality: Option<Value>,
greeting: Option<String>,
conversation_workflow: Option<Value>,
tool_config: Option<Value>,
visibility: Option<String>,
) -> Self
pub fn from_row_values( instructions: Option<Value>, personality: Option<Value>, greeting: Option<String>, conversation_workflow: Option<Value>, tool_config: Option<Value>, visibility: Option<String>, ) -> Self
Parse from the raw agents-row jsonb / text columns, tolerating any
malformed shape (a bad value drops just that field — never an error).
instructions— jsonb{ "prompt": string },personality— jsonb{ "persona"?: string, ... },greeting— text,conversation_workflow— jsonb{ goal, steps: [...] },tool_config— jsonb{ enabledTools: [{ toolId, enabled, authLevel, config }] },visibility— textpublic|internal(defaultspublic).
Trait Implementations§
Source§impl Clone for AgentBehaviorConfig
impl Clone for AgentBehaviorConfig
Source§fn clone(&self) -> AgentBehaviorConfig
fn clone(&self) -> AgentBehaviorConfig
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 AgentBehaviorConfig
impl Debug for AgentBehaviorConfig
Source§impl Default for AgentBehaviorConfig
impl Default for AgentBehaviorConfig
Source§fn default() -> AgentBehaviorConfig
fn default() -> AgentBehaviorConfig
Source§impl<'de> Deserialize<'de> for AgentBehaviorConfig
impl<'de> Deserialize<'de> for AgentBehaviorConfig
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>,
impl Eq for AgentBehaviorConfig
Source§impl PartialEq for AgentBehaviorConfig
impl PartialEq for AgentBehaviorConfig
Source§fn eq(&self, other: &AgentBehaviorConfig) -> bool
fn eq(&self, other: &AgentBehaviorConfig) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for AgentBehaviorConfig
impl Serialize for AgentBehaviorConfig
impl StructuralPartialEq for AgentBehaviorConfig
Auto Trait Implementations§
impl Freeze for AgentBehaviorConfig
impl RefUnwindSafe for AgentBehaviorConfig
impl Send for AgentBehaviorConfig
impl Sync for AgentBehaviorConfig
impl Unpin for AgentBehaviorConfig
impl UnsafeUnpin for AgentBehaviorConfig
impl UnwindSafe for AgentBehaviorConfig
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FromResponse for Twhere
T: DeserializeOwned,
impl<T> FromResponse for Twhere
T: DeserializeOwned,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request