Skip to content

Commit f40152c

Browse files
committed
feat: support /v1/files endpoints
Signed-off-by: Xin Liu <[email protected]>
1 parent 6d3a6ad commit f40152c

File tree

2 files changed

+394
-2
lines changed

2 files changed

+394
-2
lines changed

src/backend/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ use piper::audio_speech_handler;
77
pub(crate) async fn handle_llama_request(req: Request<Body>) -> Response<Body> {
88
match req.uri().path() {
99
"/v1/audio/speech" => audio_speech_handler(req).await,
10-
_ => error::invalid_endpoint(req.uri().path()),
10+
"/v1/files" => piper::files_handler(req).await,
11+
path => {
12+
if path.starts_with("/v1/files/") {
13+
piper::files_handler(req).await
14+
} else {
15+
error::invalid_endpoint(path)
16+
}
17+
}
1118
}
1219
}

0 commit comments

Comments
 (0)