type ask to target as Ident (#2621)
This commit is contained in:
parent
0ab6b764be
commit
3df565789c
6 changed files with 12 additions and 3 deletions
|
|
@ -181,13 +181,17 @@ impl AgentServer {
|
|||
async fn ask(&self, Parameters(args): Parameters<AskArgs>) -> String {
|
||||
let log = format!("{args:?}");
|
||||
run_tool_envelope("ask", log, async move {
|
||||
let to = match args.to.map(|t| hive_types::Ident::parse(&t)).transpose() {
|
||||
Ok(to) => to,
|
||||
Err(reason) => return format!("invalid `to` agent name: {reason}"),
|
||||
};
|
||||
let (resp, retries) = self
|
||||
.dispatch(hive_core_agent_sock::Request::Ask {
|
||||
question: args.question,
|
||||
options: args.options,
|
||||
multi: args.multi,
|
||||
ttl_seconds: args.ttl_seconds,
|
||||
to: args.to,
|
||||
to,
|
||||
})
|
||||
.await;
|
||||
let s = match resp {
|
||||
|
|
|
|||
Loading…
Reference in a new issue