openfunctions-rs 0.1.0

A universal framework for creating and managing LLM tools and agents
Documentation
//! Manages the environment variables for tool execution.

use std::collections::HashMap;

/// Environment manager for tool execution.
pub struct Environment {
    variables: HashMap<String, String>,
}

impl Environment {
    /// Create a new environment manager.
    pub fn new() -> Self {
        Self {
            variables: HashMap::new(),
        }
    }

    /// Get the base environment variables.
    pub fn get_base_env(&self) -> HashMap<String, String> {
        self.variables.clone()
    }

    /// Set an environment variable.
    pub fn set(&mut self, key: String, value: String) {
        self.variables.insert(key, value);
    }
}

impl Default for Environment {
    fn default() -> Self {
        Self::new()
    }
}