llama_cpp_bindings/
raw_chat_message.rs1pub struct RawChatMessage {
2 pub tools_json: String,
3 pub text: String,
4 pub is_partial: bool,
5 pub ffi_error_message: String,
6}
7
8#[cfg(test)]
9mod tests {
10 use super::RawChatMessage;
11
12 #[test]
13 fn carries_tools_json_text_partial_flag_and_ffi_error_message() {
14 let raw = RawChatMessage {
15 tools_json: "[]".to_owned(),
16 text: "hello".to_owned(),
17 is_partial: true,
18 ffi_error_message: "parser bailed".to_owned(),
19 };
20
21 assert_eq!(raw.tools_json, "[]");
22 assert_eq!(raw.text, "hello");
23 assert!(raw.is_partial);
24 assert_eq!(raw.ffi_error_message, "parser bailed");
25 }
26}