use noether_engine::executor::composite::CompositeExecutor;
use noether_engine::executor::isolation::IsolationBackend;
use noether_engine::providers;
use noether_store::StageStore;
pub fn build_executor(store: &dyn StageStore) -> CompositeExecutor {
build_executor_with_isolation(store, IsolationBackend::None)
}
pub fn build_executor_with_isolation(
store: &dyn StageStore,
isolation: IsolationBackend,
) -> CompositeExecutor {
let (llm_provider, llm_name) = providers::build_llm_provider();
if llm_name != "mock" {
eprintln!("LLM provider: {llm_name}");
}
CompositeExecutor::from_store(store)
.with_llm(llm_provider, noether_engine::llm::LlmConfig::default())
.with_isolation(isolation)
}
pub fn build_executor_with_embeddings(store: &dyn StageStore) -> CompositeExecutor {
let (llm_provider, llm_name) = providers::build_llm_provider();
let (emb_provider, emb_name) = providers::build_embedding_provider();
if llm_name != "mock" {
eprintln!("LLM provider: {llm_name}");
}
if emb_name != "mock" {
eprintln!("Embedding provider: {emb_name}");
}
CompositeExecutor::from_store(store)
.with_llm(llm_provider, noether_engine::llm::LlmConfig::default())
.with_embedding(emb_provider)
}