Skip to content

Commit

Permalink
Merge pull request #6 from erhant/main
Browse files Browse the repository at this point in the history
add `new_at` method for Executor
  • Loading branch information
andthattoo authored Jul 4, 2024
2 parents 1491595 + 41f1982 commit 4720e16
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 for an Ollama instance at a specific host and port.
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 4720e16

Please sign in to comment.