pub async fn try_into_core(&self, name: &str) -> Result<AgentCore, Report> {
        let metrics = Arc::new(crate::metrics::CoreMetrics::new(
            name,
            self.metrics
                .as_ref()
                .map(|v| v.parse::<u16>().expect("metrics port must be u16")),
            Arc::new(prometheus::Registry::new()),
        )?);

        let db = DB::from_path(&self.db)?;
        let home = Arc::new(self.try_caching_home(db.clone()).await?);
        let replicas = self.try_caching_replicas(db.clone()).await?;

        Ok(AgentCore {
            home,
            replicas,
            db,
            settings: self.clone(),
            metrics,
            indexer: self.index.clone(),
        })
    }
/// Try to generate an agent core for a named agent
Try to generate an agent core for a named agent
Try to generate an agent core for a named agent
pub async fn try_into_core(&self, name: &str) -> Result<AgentCore, Report> {
        let metrics = Arc::new(crate::metrics::CoreMetrics::new(
            name,
            self.metrics
                .as_ref()
                .map(|v| v.parse::<u16>().expect("metrics port must be u16")),
            Arc::new(prometheus::Registry::new()),
        )?);
        let db = DB::from_path(&self.db)?;
        let home = Arc::new(self.try_caching_home(db.clone()).await?);
        let replicas = self.try_caching_replicas(db.clone()).await?;
        Ok(AgentCore {
            home,
            replicas,
            db,
            settings: self.clone(),
            metrics,
            indexer: self.index.clone(),
        })
    }
pub async fn try_into_core ( & self , name : & str ) -> Result < AgentCore , Report > { let metrics = Arc :: new ( crate :: metrics :: CoreMetrics :: new ( name , self . metrics . as_ref ( ) . map ( | v | v . parse :: < u16 > ( ) . expect ( " " ) ) , Arc :: new ( prometheus :: Registry :: new ( ) ) , ) ? ) ; let db = DB :: from_path ( & self . db ) ? ; let home = Arc :: new ( self . try_caching_home ( db . clone ( ) ) . await ? ) ; let replicas = self . try_caching_replicas ( db . clone ( ) ) . await ? ; Ok ( AgentCore { home , replicas , db , settings : self . clone ( ) , metrics , indexer : self . index . clone ( ) , } ) }
Try to generate an agent core for a named agent
Try to generate an agent core for a named agent
&self
name
&str
&self
name
&str