mirror of
https://github.com/katanemo/plano.git
synced 2026-06-29 15:49:40 +02:00
add draft change
This commit is contained in:
parent
a03aef8b4c
commit
3f21e29703
6 changed files with 55 additions and 7 deletions
|
|
@ -1,2 +1,3 @@
|
|||
pub mod chat_completions;
|
||||
pub mod models;
|
||||
pub mod preferences;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
use brightstaff::handlers::chat_completions::chat_completions;
|
||||
use brightstaff::handlers::models::list_models;
|
||||
use brightstaff::handlers::preferences::{list_preferences, update_preferences};
|
||||
use brightstaff::router::llm_router::RouterService;
|
||||
use brightstaff::utils::tracing::init_tracer;
|
||||
use bytes::Bytes;
|
||||
|
|
@ -16,7 +17,7 @@ use opentelemetry_http::HeaderExtractor;
|
|||
use std::sync::Arc;
|
||||
use std::{env, fs};
|
||||
use tokio::net::TcpListener;
|
||||
use tracing::{debug, info};
|
||||
use tracing::{debug, info, warn};
|
||||
|
||||
pub mod router;
|
||||
|
||||
|
|
@ -101,6 +102,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
|||
.with_context(parent_cx)
|
||||
.await
|
||||
}
|
||||
(&Method::GET, "/v1/router/preferences") => Ok(list_preferences(llm_providers).await),
|
||||
(&Method::PUT, "/v1/router/preferences") => {
|
||||
update_preferences(req, llm_providers).await
|
||||
},
|
||||
(&Method::GET, "/v1/models") => Ok(list_models(llm_providers).await),
|
||||
(&Method::OPTIONS, "/v1/models") => {
|
||||
let mut response = Response::new(empty());
|
||||
|
|
@ -141,7 +146,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
|||
.serve_connection(io, service)
|
||||
.await
|
||||
{
|
||||
info!("Error serving connection: {:?}", err);
|
||||
warn!("Error serving connection: {:?}", err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue