-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic_usage.rs
More file actions
37 lines (30 loc) · 1.27 KB
/
basic_usage.rs
File metadata and controls
37 lines (30 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use rullm_core::ChatRequestBuilder;
// This example demonstrates the unified interface without actual provider implementations
// It shows how the library would be used once provider modules are implemented
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("LLM Library - Unified Interface Example");
println!("=======================================");
// This demonstrates the builder pattern for creating requests
let request = ChatRequestBuilder::new()
.system("You are a helpful assistant that provides concise answers")
.user("What is the capital of France?")
.temperature(0.7)
.max_tokens(100)
.build();
println!("Created chat request:");
println!(" Messages: {} total", request.messages.len());
println!(" Temperature: {:?}", request.temperature);
println!(" Max tokens: {:?}", request.max_tokens);
for (i, message) in request.messages.iter().enumerate() {
println!(
" Message {}: {:?} - {}",
i + 1,
message.role,
message.content
);
}
println!("\nThis example shows the unified interface design.");
println!("Actual provider implementations will be added in subsequent tasks.");
Ok(())
}