Skip to content

Commit aa0ee34

Browse files
committed
#305 proxy for LLM p7
1 parent cace6a4 commit aa0ee34

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub async fn run() -> Result<()> {
6464
"octopus_server=error,runtime=error,tokio=error,tower_http=error".into()
6565
}),
6666
)
67-
.with(tracing_subscriber::fmt::layer().with_writer(log_file))
67+
.with(tracing_subscriber::fmt::layer()/* .with_writer(log_file)*/)
6868
.init();
6969

7070
let args = Args::parse();

src/ollama/proxy.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ pub async fn request(
7373

7474
return Ok((status_code, Json(body)).into_response());
7575
}
76+
"application/x-ndjson" => {
77+
let bytes = response.bytes().await?.to_vec();
78+
let body: serde_json::Value = serde_json::from_slice(&bytes)?;
79+
80+
return Ok((status_code, Json(body)).into_response());
81+
}
7682
&_ => return Ok((StatusCode::OK, Json("{}")).into_response()),
7783
}
7884
}

0 commit comments

Comments
 (0)