phi-agent 0.12.1

phi-agent — Rust AI Agent runtime framework: orchestration, sessions, streaming built-in. You define tools, prompts, domain knowledge.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Configuration resolution helpers.
//!
//! Handles LLM configuration (API key, model, base URL) with multi-source
//! resolution: CLI argument → environment variable (`.env`) → default.

pub mod llm;

pub use llm::{LlmConfig, resolve_llm_config};

use std::env;

/// Read an optional environment variable. Empty strings are treated as unset.
pub(crate) fn optional_env(key: &str) -> Option<String> {
    env::var(key).ok().filter(|v| !v.is_empty())
}