pub struct DefaultNegotiator { /* private fields */ }Expand description
Default negotiator implementation.
This implementation provides basic negotiation logic using an LLM:
- Uses structured LLM outputs to determine intent
- Asks clarifying questions when skill selection is ambiguous
- Transitions to task creation when a skill is clearly identified
- Rejects requests that are out of scope for available skills
§Examples
ⓘ
use radkit::runtime::DefaultNegotiator;
use radkit::models::providers::AnthropicLlm;
use radkit::models::Content;
let llm = Arc::new(AnthropicLlm::from_env("claude-sonnet-4")?);
// Use default prompt
let negotiator = DefaultNegotiator::new(llm.clone());
// Override the prompt
let negotiator = DefaultNegotiator::new(llm)
.with_prompt(Content::from_text("Custom negotiation prompt"));Implementations§
Trait Implementations§
Source§impl Clone for DefaultNegotiator
impl Clone for DefaultNegotiator
Source§fn clone(&self) -> DefaultNegotiator
fn clone(&self) -> DefaultNegotiator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Negotiator for DefaultNegotiator
impl Negotiator for DefaultNegotiator
Source§fn negotiate<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_auth_ctx: &'life1 AuthContext,
agent_def: &'life2 AgentDefinition,
_context_id: &'life3 str,
content: Content,
history: Vec<Message>,
) -> Pin<Box<dyn Future<Output = AgentResult<NegotiationDecision>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn negotiate<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_auth_ctx: &'life1 AuthContext,
agent_def: &'life2 AgentDefinition,
_context_id: &'life3 str,
content: Content,
history: Vec<Message>,
) -> Pin<Box<dyn Future<Output = AgentResult<NegotiationDecision>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Negotiates with the user to determine the next action. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for DefaultNegotiator
impl !UnwindSafe for DefaultNegotiator
impl Freeze for DefaultNegotiator
impl Send for DefaultNegotiator
impl Sync for DefaultNegotiator
impl Unpin for DefaultNegotiator
impl UnsafeUnpin for DefaultNegotiator
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
Mutably borrows from an owned value. Read more