mod conversation_summarizer;
mod env_setup;
mod running_agent;
mod tool_summarizer;
pub mod tools;
mod util;
mod v1;
use std::sync::Arc;
use swiftide::chat_completion::Tool;
use anyhow::Result;
#[tracing::instrument(skip(repository, command_responder))]
pub async fn start_agent(
uuid: Uuid,
repository: &Repository,
initial_query: &str,
command_responder: Arc<dyn Responder>,
) -> Result<RunningAgent> {
command_responder.update("starting up agent for the first time, this might take a while");
match repository.config().agent {
crate::config::SupportedAgents::V1 => {
v1::start(initial_query, uuid, repository, command_responder).await
}
}
}
pub fn available_tools(
repository: &Repository,
github_session: Option<&Arc<GithubSession>>,
agent_env: Option<&env_setup::AgentEnvironment>,
) -> Result<Vec<Box<dyn Tool>>> {
match repository.config().agent {
crate::config::SupportedAgents::V1 => {
v1::available_tools(repository, github_session, agent_env)
}
}
}
pub use running_agent::RunningAgent;
use uuid::Uuid;
use crate::{commands::Responder, git::github::GithubSession, repository::Repository};