|
1 | | -mod executor; |
2 | | -pub use executor::WorkflowsExt; |
3 | | - |
4 | 1 | mod postprocess; |
5 | 2 |
|
6 | | -#[cfg(test)] |
7 | | -mod tests { |
8 | | - use super::*; |
9 | | - use alloy::primitives::Bytes; |
10 | | - use dkn_workflows::{Entry, Executor, Model, ProgramMemory}; |
11 | | - |
12 | | - #[tokio::test] |
13 | | - #[ignore = "run this manually"] |
14 | | - async fn test_ollama_generation() { |
15 | | - dotenvy::dotenv().unwrap(); |
16 | | - let executor = Executor::new(Model::Llama3_1_8B); |
17 | | - let (output, _, _) = executor |
18 | | - .execute_raw(&Bytes::from_static(b"What is the result of 2 + 2?"), "") |
19 | | - .await |
20 | | - .unwrap(); |
21 | | - |
22 | | - // funny test but it should pass |
23 | | - println!("Output:\n{}", output); |
24 | | - // assert!(output.contains('4')); // FIXME: make this use bytes |
25 | | - } |
26 | | - |
27 | | - #[tokio::test] |
28 | | - #[ignore = "run this manually"] |
29 | | - async fn test_openai_generation() { |
30 | | - dotenvy::dotenv().unwrap(); |
31 | | - let executor = Executor::new(Model::Llama3_1_8B); |
32 | | - let (output, _, _) = executor |
33 | | - .execute_raw(&Bytes::from_static(b"What is the result of 2 + 2?"), "") |
34 | | - .await |
35 | | - .unwrap(); |
36 | | - |
37 | | - // funny test but it should pass |
38 | | - println!("Output:\n{}", output); |
39 | | - // assert!(output.contains('4')); // FIXME: make this use bytes |
40 | | - } |
| 3 | +mod presets; |
41 | 4 |
|
42 | | - /// Test the generation workflow with a plain input. |
43 | | - #[tokio::test] |
44 | | - async fn test_workflow_plain() { |
45 | | - dotenvy::dotenv().unwrap(); |
46 | | - let executor = Executor::new(Model::GPT4o); |
47 | | - let mut memory = ProgramMemory::new(); |
48 | | - let workflow = executor.get_generation_workflow().unwrap(); |
49 | | - let input = Entry::try_value_or_str("What is 2 + 2?"); |
50 | | - let output = executor |
51 | | - .execute(Some(&input), workflow, &mut memory) |
52 | | - .await |
53 | | - .unwrap(); |
54 | | - println!("Output:\n{}", output); |
55 | | - } |
56 | | -} |
| 5 | +mod requests; |
| 6 | +pub use requests::Request; |
0 commit comments