refactor prompt gateway (#204)

This commit is contained in:
Adil Hafeez 2024-10-21 15:04:15 -07:00 committed by GitHub
parent dced8a5708
commit 2f374df034
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 500 additions and 441 deletions

View file

@ -22,11 +22,12 @@ pub enum ServerError {
Serialization(serde_json::Error),
#[error("{0}")]
LogicError(String),
#[error("upstream error response authority={authority}, path={path}, status={status}")]
#[error("upstream application error host={host}, path={path}, status={status}, body={body}")]
Upstream {
authority: String,
host: String,
path: String,
status: String,
body: String,
},
#[error("jailbreak detected: {0}")]
Jailbreak(String),

View file

@ -1,4 +1,7 @@
use crate::{errors::ClientError, stats::{Gauge, IncrementingMetric}};
use crate::{
errors::ClientError,
stats::{Gauge, IncrementingMetric},
};
use derivative::Derivative;
use log::debug;
use proxy_wasm::{traits::Context, types::Status};

View file

@ -4,10 +4,10 @@ pub mod common_types;
pub mod configuration;
pub mod consts;
pub mod embeddings;
pub mod errors;
pub mod http;
pub mod llm_providers;
pub mod ratelimit;
pub mod routing;
pub mod stats;
pub mod tokenizer;
pub mod errors;