-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
831a236
commit 24a7721
Showing
8 changed files
with
81 additions
and
290 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use dotenv::dotenv; | ||
use env_logger::Env; | ||
use ollama_workflows::{Executor, Model, ProgramMemory, Workflow}; | ||
|
||
fn main() { | ||
// Initialize environment | ||
dotenv().ok(); | ||
let env = Env::default().filter_or("LOG_LEVEL", "info"); | ||
env_logger::Builder::from_env(env).init(); | ||
|
||
// Create runtime for async execution | ||
let rt = tokio::runtime::Runtime::new().unwrap(); | ||
rt.block_on(async { | ||
// Initialize the executor with desired model | ||
let exe = Executor::new(Model::Phi3Medium); | ||
|
||
// Load workflow from JSON file | ||
let workflow = Workflow::new_from_json("./tests/test_workflows/simple.json").unwrap(); | ||
|
||
// Initialize program memory | ||
let mut memory = ProgramMemory::new(); | ||
|
||
// Execute workflow and handle the result | ||
match exe.execute(None, &workflow, &mut memory).await { | ||
Ok(result) => println!("Generated poem:\n{}", result), | ||
Err(err) => eprintln!("Error executing workflow: {:?}", err), | ||
} | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.