You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: mod.rs
    path of file: ./repos/ninja/crates/openai/src/serve/proxy/toapi
    
    the code of the file until where you have to start completion: mod model;
mod stream;

use axum::http::header;
use axum::http::Method;
use axum::{
    response::{IntoResponse, Sse},
    Json,
};
use eventsource_stream::Eventsource;
use reqwest::StatusCode;
use std::str::FromStr;

use crate::arkose::ArkoseContext;
use crate::chatgpt::model::req::Metadata;
use crate::chatgpt::model::Role;
use crate::gpt_model::GPTModel;
use crate::now_duration;
use crate::serve::error::ProxyError;
use crate::serve::ProxyResult;
u
    
fn handle_error_response(err: reqwest::Error) -> Result<impl IntoResponse, ResponseError> {
    if let Some(status_code) = err.status() {
        match status_code {
            StatusCode::UNAUTHORIZED => {
                let body = serde_json::json!({
                    "error": {
                        "message": "You didn't provide an API key...",
                        "type": "invalid_request_error",
                        "param": null,
                        "code": null
                    }
                });
                Ok(Json(body).into_response())
            }
            _ => Err(ResponseError::new(err.to_string(), status_code)),
        }
    } else {
        Err(ResponseError::InternalServerError(err))
    }
}