aipack 0.8.21

Command Agent runner to accelerate production coding with genai.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::Result;
use crate::hub::{Hub, HubEvent};
use crate::tui_v1::PromptParams;

// region:    --- Prompt Via Hub

pub async fn hub_prompt(hub: &Hub, msg: impl Into<String>) -> Result<String> {
	let (params, rx) = PromptParams::new(msg);

	hub.publish(HubEvent::Prompt(params)).await;

	let result = rx.recv().await?;

	Ok(result)
}

// endregion: --- Prompt Via Hub