feat: add oauth field to ProviderModels

This commit is contained in:
2026-07-20 12:46:18 -06:00
parent aa0270602d
commit 1acaad223f
2 changed files with 5 additions and 3 deletions
+2
View File
@@ -357,6 +357,8 @@ impl ModelData {
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProviderModels { pub struct ProviderModels {
pub provider: String, pub provider: String,
#[serde(default)]
pub oauth: Option<super::oauth::OAuthConfig>,
pub models: Vec<ModelData>, pub models: Vec<ModelData>,
} }
+3 -3
View File
@@ -18,14 +18,14 @@ use std::net::TcpListener;
use url::Url; use url::Url;
use uuid::Uuid; use uuid::Uuid;
#[derive(Debug, Clone, Copy, Deserialize)] #[derive(Debug, Clone, Copy, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
pub enum TokenRequestFormat { pub enum TokenRequestFormat {
Json, Json,
FormUrlEncoded, FormUrlEncoded,
} }
#[derive(Debug, Clone, Copy, Deserialize, Default)] #[derive(Debug, Clone, Copy, Serialize, Deserialize, Default)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
pub enum OAuthFlow { pub enum OAuthFlow {
#[default] #[default]
@@ -38,7 +38,7 @@ pub enum OAuthFlow {
/// ///
/// Every field except `client_id`, `token_url`, and `flow` is optional so that /// Every field except `client_id`, `token_url`, and `flow` is optional so that
/// user config can override individual fields without restating the entire block. /// user config can override individual fields without restating the entire block.
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OAuthConfig { pub struct OAuthConfig {
pub client_id: String, pub client_id: String,
pub token_url: String, pub token_url: String,