Skip to content

Commit

Permalink
add new_with_client method for Executor
Browse files Browse the repository at this point in the history
  • Loading branch information
erhant committed Jul 4, 2024
1 parent 58915f3 commit 9f455ad
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/program/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,20 @@ pub struct Executor {
}

impl Executor {
/// Create a new Executor
/// Create a new Executor with a default Ollama instance.
pub fn new(model: Model) -> Self {
let llm = Ollama::default();
Executor { model, llm }
Self {
model,
llm: Ollama::default(),
}
}

/// Create a new Executor with a given Ollama instance
pub fn new_at(model: Model, host: &str, port: u16) -> Self {
Self {
model,
llm: Ollama::new(host, port),
}
}

/// Executes the workflow
Expand Down

0 comments on commit 9f455ad

Please sign in to comment.