This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

Trace LLM interaction

Tomas Carnecky (Jun 6, 2026, 4:19 PM +0200) 64bed2b2 70c25bf9

+28
+1
Cargo.lock
··· 1230 1230 "async-openai", 1231 1231 "reqwest 0.12.28", 1232 1232 "serde", 1233 + "serde_json", 1233 1234 "tokio", 1234 1235 "tracing", 1235 1236 "tracing-subscriber",
+1
bin/pudox-run/Cargo.toml
··· 14 14 tracing-subscriber = "0.3" 15 15 async-openai = { version = "0.38.2", features = ["chat-completion"] } 16 16 serde = { version = "1", features = ["derive"] } 17 + serde_json = "1"
+26
bin/pudox-run/src/main.rs
··· 114 114 messages: &Vec<ChatCompletionRequestMessage>, 115 115 tools: &Vec<ChatCompletionTools>, 116 116 ) -> Result<ChatCompletionResponseMessage, Box<dyn std::error::Error>> { 117 + tracing::info!("Sending {} message(s) to LLM", messages.len()); 118 + for (i, msg) in messages.iter().enumerate() { 119 + tracing::debug!( 120 + " [{}] {}", 121 + i, 122 + serde_json::to_string(msg).unwrap_or_else(|_| format!("{:?}", msg)) 123 + ); 124 + } 125 + 117 126 let request = CreateChatCompletionRequestArgs::default() 118 127 .model("caurea/gemma-4-26B-A4B-it") 119 128 .max_tokens(4000u32) ··· 126 135 let choice = &response.choices[0]; 127 136 let message = choice.message.clone(); 128 137 138 + if let Some(content) = &message.content { 139 + tracing::info!("LLM response content: {}", content); 140 + } 141 + if let Some(tool_calls) = &message.tool_calls { 142 + for tc in tool_calls { 143 + tracing::info!( 144 + "LLM tool call: {}", 145 + serde_json::to_string(tc).unwrap_or_else(|_| format!("{:?}", tc)) 146 + ); 147 + } 148 + } 149 + 129 150 Ok(message) 130 151 } 131 152 ··· 158 179 for tool_call in tool_calls { 159 180 match tool_call { 160 181 ChatCompletionMessageToolCalls::Function(f) => { 182 + tracing::info!( 183 + "Dispatching tool call: {} args={}", 184 + f.function.name, 185 + f.function.arguments 186 + ); 161 187 if f.function.name == "finish" { 162 188 return Ok(ToolCallResult::Finish); 163 189 }