diff --git a/src/client.rs b/src/client.rs index e85a34c..f110338 100644 --- a/src/client.rs +++ b/src/client.rs @@ -6,8 +6,6 @@ use tokio_stream::{Stream, StreamExt}; use tokio_util::codec::LinesCodecError; use tracing::error; -pub static AUTH_SCOPE: &[&str] = &["https://www.googleapis.com/auth/cloud-platform"]; - #[derive(Clone, Debug)] pub struct GeminiClient { client: reqwest::Client, diff --git a/src/error.rs b/src/error.rs index bee7f70..77b1692 100644 --- a/src/error.rs +++ b/src/error.rs @@ -34,7 +34,7 @@ impl Display for Error { write!(f, "No candidates returned for the prompt") } Error::EventSourceError(e) => { - write!(f, "EventSourrce Error: {e}") + write!(f, "EventSource Error: {e}") } Error::EventSourceClosedError => { write!(f, "EventSource closed error") diff --git a/src/types/error.rs b/src/types/error.rs index 80b69f1..8c0e6ae 100644 --- a/src/types/error.rs +++ b/src/types/error.rs @@ -26,42 +26,12 @@ pub struct GeminiApiError { impl core::fmt::Display for GeminiApiError { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), std::fmt::Error> { - write!(f, "Gemini API Error {} - {}", self.error.code, self.error.message) + write!( + f, + "Gemini API Error {} - {}", + self.error.code, self.error.message + ) } } impl std::error::Error for GeminiApiError {} - -#[derive(Clone, Debug, Serialize, Deserialize)] -pub struct Link { - pub description: String, - pub url: String, -} - -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(tag = "@type")] -pub enum ErrorType { - #[serde(rename = "type.googleapis.com/google.rpc.ErrorInfo")] - ErrorInfo { metadata: ErrorInfoMetadata }, - - #[serde(rename = "type.googleapis.com/google.rpc.Help")] - Help { links: Vec }, - - #[serde(rename = "type.googleapis.com/google.rpc.BadRequest")] - BadRequest { - #[serde(rename = "fieldViolations")] - field_violations: Vec, - }, -} - -#[derive(Clone, Debug, Serialize, Deserialize)] -pub struct ErrorInfoMetadata { - pub service: String, - pub consumer: String, -} - -#[derive(Clone, Debug, Serialize, Deserialize)] -pub struct FieldViolation { - pub field: String, - pub description: String, -}