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
38
//! Chat message types, templates and tool calling.
//!
//! This module is the public entry-point for everything related to
//! multi-turn chat: messages, templates (a Jinja2 subset), tool/function
//! calling, and the streaming state needed to parse the model's output.
//!
//! # Quick tour
//!
//! ```
//! use llama_crab::chat::{ChatMessage, Role, render_template};
//!
//! let prompt = render_template(
//! "{% for m in messages %}{{ m.role }}: {{ m.content }}\n{% endfor %}assistant:",
//! &[ChatMessage::new(Role::User, "Hi")],
//! &[], // no tools
//! true, // add generation prompt
//! ).unwrap();
//! assert!(prompt.contains("user: Hi"));
//! assert!(prompt.ends_with("assistant:"));
//! ```
pub use ;
pub use ChatParseState;
pub use ;
pub use ;
pub use ;