hypersteeldb 0.2.3

A database that compiles questions instead of guessing answers: typed vocabulary discovered from your documents, queries type-checked before they run, roaring-bitmap set algebra over reified hyperedges, and Dempster-Shafer evidence with an explicit conflict guard.
Documentation
//! Neutral message/tool types the agent loop speaks. Each provider translates these to/from its own
//! wire format (Bedrock Converse blocks; OpenAI/Paddock chat messages).

use serde_json::Value;

#[derive(Clone, Copy, Debug, PartialEq)]
pub enum Role {
    User,
    Assistant,
}

#[derive(Clone, Debug)]
pub enum Block {
    Text(String),
    /// model asked to call a tool
    ToolUse { id: String, name: String, input: Value },
    /// our result for a prior tool call
    ToolResult { id: String, content: String, is_error: bool },
}

#[derive(Clone, Debug)]
pub struct Msg {
    pub role: Role,
    pub blocks: Vec<Block>,
}

impl Msg {
    pub fn user_text(s: impl Into<String>) -> Msg {
        Msg { role: Role::User, blocks: vec![Block::Text(s.into())] }
    }
}

/// A tool the model may call — a JSON-Schema `input_schema` plus a name/description.
#[derive(Clone, Debug)]
pub struct ToolSpec {
    pub name: String,
    pub description: String,
    pub schema: Value,
}

#[derive(Clone, Copy, Debug, PartialEq)]
pub enum Stop {
    EndTurn,
    ToolUse,
    Other,
}

/// One provider response.
#[derive(Clone, Debug)]
pub struct Turn {
    pub text: String,
    /// (id, name, input) per requested tool call
    pub tool_uses: Vec<(String, String, Value)>,
    pub stop: Stop,
}