pub mod action_helper;
pub mod actions; pub mod agent_queue; pub mod bridge; pub mod circuit_breaker; pub mod conversation; pub mod conversation_state; pub mod default_instructions; pub mod event_handler_executor; pub mod event_instructions; pub mod feedback; pub mod model_selection;
pub mod ollama_client;
pub mod prompt;
pub mod rate_limiter; pub mod reference_parser; pub mod response_handler;
pub mod template_engine;
#[cfg(feature = "embedded-llm")]
pub mod embedded_inference;
pub mod config;
#[cfg(feature = "embedded-llm")]
pub mod hybrid_manager;
pub use actions::{
common::{
get_all_common_actions, get_network_event_common_actions, get_user_input_common_actions,
CommonAction,
},
executor::{execute_actions, ActionFailure, ExecutionResult, FAILED_ACTION_TYPE_PREFIX},
protocol_trait::{ActionResult, Server},
ActionDefinition, ActionResponse, Parameter,
};
pub use action_helper::{
call_llm_for_client, call_llm_with_actions, call_llm_with_custom_actions,
call_llm_with_protocol, ClientLlmResult,
};
pub use ollama_client::{
accumulate_ollama_stream, accumulate_openai_stream, CommandAction, CommandInterpretation,
GenerateResponse, HttpLlmResponse, LlmResponse, OllamaClient, OllamaResponseKind,
OpenAiStreamAcc, SamplingOptions, StreamAccumulation, TokenUsage,
};
pub use prompt::PromptBuilder;
pub use response_handler::{handle_llm_response, ProcessedResponse};
pub use conversation::ConversationHandler;
pub use conversation_state::{ConversationMessage, ConversationState, MessageRole, MessageType};
pub use ollama_client::Message;
pub use agent_queue::{LlmRequestQueue, PendingLlmRequest};
pub use bridge::{BridgeReply, BridgeRequest, BridgeRequestKind, LlmBridge};
pub use circuit_breaker::{
BreakerOpen, BreakerState, BreakerStatus, CircuitBreaker, DEFAULT_COOLDOWN,
DEFAULT_FAILURE_THRESHOLD,
};
pub use default_instructions::{resolve_instructions, DEFAULT_INSTRUCTIONS};
pub use event_instructions::{
EventInstructions, Example, InstructionSource, ServerInstructionConfig,
};
pub use model_selection::{
check_ollama_availability, ensure_model_selected, select_or_validate_model, ModelInfo,
};
#[cfg(feature = "embedded-llm")]
pub use embedded_inference::{EmbeddedLLMBackend, InferenceConfig};
#[cfg(feature = "embedded-llm")]
pub use config::EmbeddedLlmConfig;
pub use config::{LlmBackendType, NetGetConfig, OllamaConfig, OpenAIConfig};
#[cfg(feature = "embedded-llm")]
pub use hybrid_manager::{ActiveBackend, HybridLLMManager};
pub use rate_limiter::{
is_overload_error, RateLimitError, RateLimiter, RateLimiterConfig, RateLimiterPermit,
RateLimiterStats, RequestSource, DEFAULT_MAX_QUEUED, DEFAULT_QUEUE_TIMEOUT_SECS,
};
pub fn format_indented_dimmed_lines(text: &str, indent_spaces: usize) -> Vec<String> {
let indent = " ".repeat(indent_spaces);
text.lines()
.map(|line| format!("{}\x1b[2m{}\x1b[0m", indent, line))
.collect()
}
pub fn format_indented_dimmed(text: &str, indent_spaces: usize) -> String {
format_indented_dimmed_lines(text, indent_spaces).join("\n")
}