From 8be8caf6fbe39dec8877ecbfd52d5d9a0187f902 Mon Sep 17 00:00:00 2001 From: "nicolas.borges" Date: Fri, 15 May 2026 10:56:20 -0300 Subject: [PATCH] =?UTF-8?q?Adi=C3=A7=C3=A3o=20de=20filtro=20de=20type=3Dou?= =?UTF-8?q?t=20no=20.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index f6851fd..85e8edf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -232,7 +232,6 @@ fn main() -> anyhow::Result<()> { )) .expect("Failed to create response_time.csv"); } - */ // Read system prompt @@ -507,6 +506,14 @@ fn main() -> anyhow::Result<()> { .expect("Wrong message type received from talk histories") .iter() .rev() +//filtro para escrever somente as mensagens out no .txt + .filter(|(message_object)| { + let message_type = message_object["type"] + .as_str() + .expect("Failed to decode message as string"); + message_type == "out".to_string() + }) +//fim do filtro .map(|message_object| { let new_json_filtered = format!( "{{ @@ -535,7 +542,6 @@ fn main() -> anyhow::Result<()> { serde_json::json!({ "model": OLLAMA_AI_MODEL, "prompt": format!("{prompt} \n{talk}"), - // "options": serde_json::json!({"temperature": 0.1}), "stream": false, }) .to_string(),