harn-vm 0.10.42

Async bytecode virtual machine for the Harn programming language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::llm::tools::TextToolParseResult;
use crate::value::VmValue;

pub(super) async fn parse_text_tool_formats(
    content: &str,
    tools: &VmValue,
) -> Result<(TextToolParseResult, TextToolParseResult), String> {
    let tagged = crate::llm::api::parse_text_tools_with_harn(None, content, Some(tools), "")
        .await
        .map_err(|error| format!("text-tool parser failed: {error}"))?;
    let fenced = crate::llm::api::parse_text_tools_with_harn(None, content, Some(tools), "json")
        .await
        .map_err(|error| format!("JSON text-tool parser failed: {error}"))?;
    Ok((tagged, fenced))
}