use crate::abi::{call_host, raw};
use crate::types::*;
pub fn history_get(filter: &str) -> Result<Vec<HistoryMessage>, SkillError> {
#[derive(serde::Serialize)]
struct Req<'a> { filter: &'a str }
call_host(raw::history_get, &Req { filter })
}
pub fn prompt_complete(req: PromptRequest) -> Result<PromptResponse, SkillError> {
let resp: PromptResponse = call_host(raw::prompt_complete, &req)?;
if !resp.error.is_empty() {
return Err(SkillError(resp.error));
}
Ok(resp)
}
pub fn unmarshal_batch_result(payload: &[u8]) -> Result<BatchResult, SkillError> {
Ok(rmp_serde::from_slice(payload)?)
}