use thiserror::Error; #[derive(Error, Debug)] pub enum AgentError { #[error("openai error: {0}")] OpenAi(String), #[error("qdrant error: {0}")] Qdrant(String), #[error("internal error: {0}")] Internal(String), } pub type Result = std::result::Result; impl From for AgentError { fn from(e: async_openai::error::OpenAIError) -> Self { AgentError::OpenAi(e.to_string()) } } impl From for AgentError { fn from(e: qdrant_client::QdrantError) -> Self { AgentError::Qdrant(e.to_string()) } } impl From for AgentError { fn from(e: sea_orm::DbErr) -> Self { AgentError::Internal(e.to_string()) } }