More logging

This commit is contained in:
2026-01-15 20:47:19 +00:00
parent a9ab4e6d60
commit f87a8497da
4 changed files with 515 additions and 147 deletions

View File

@@ -5,7 +5,7 @@ use tokio_util::{
codec::{FramedRead, LinesCodec},
io::StreamReader,
};
use tracing::info;
use tracing::{debug, info};
use crate::{
error::{OllamaError, OllamaResult},
@@ -80,7 +80,7 @@ impl OllamaClient {
.await?
.error_for_status()?;
println!("{:?}", response);
debug!("{:?}", response);
let bytes_stream = response.bytes_stream();
let body_reader = StreamReader::new(
@@ -92,6 +92,7 @@ impl OllamaClient {
while let Some(line_result) = lines_stream.next().await {
match line_result {
Ok(line_content) => {
debug!(chunk = line_content, "ollama response chunk");
if let Ok(parsed) = serde_json::from_str::<T>(&line_content) {
yield Ok(parsed);
}