behest 0.2.2

A Rust-native cloud agent runtime with typed tools, pluggable memory, queues, and observability.
Documentation
//! Capability flags advertised by provider implementations.

use serde::{Deserialize, Serialize};

/// Describes which features a provider can serve.
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]
pub struct ProviderCapabilities {
    /// Provider can return a complete chat response.
    pub chat: bool,
    /// Provider can stream chat events.
    pub chat_stream: bool,
    /// Provider accepts tool definitions in chat requests.
    pub tool_calling: bool,
    /// Provider can execute or request multiple tool calls concurrently.
    pub parallel_tool_calls: bool,
    /// Provider can constrain output with a JSON schema.
    pub json_schema_output: bool,
    /// Provider can consume image content.
    pub vision: bool,
    /// Provider can produce embeddings.
    pub embeddings: bool,
    /// Maximum supported input tokens, when known.
    pub max_input_tokens: Option<u32>,
    /// Maximum supported output tokens, when known.
    pub max_output_tokens: Option<u32>,
}

impl ProviderCapabilities {
    /// Returns a capability set for basic non-streaming chat providers.
    #[must_use]
    pub const fn chat() -> Self {
        Self {
            chat: true,
            ..Self::empty()
        }
    }

    /// Returns a capability set for embedding-only providers.
    #[must_use]
    pub const fn embeddings() -> Self {
        Self {
            embeddings: true,
            ..Self::empty()
        }
    }

    /// Returns an empty capability set.
    #[must_use]
    pub const fn empty() -> Self {
        Self {
            chat: false,
            chat_stream: false,
            tool_calling: false,
            parallel_tool_calls: false,
            json_schema_output: false,
            vision: false,
            embeddings: false,
            max_input_tokens: None,
            max_output_tokens: None,
        }
    }
}