Skip to content

Commit 737daaf

Browse files
CopilotCBenoit
andauthored
refactor(dgw): move AI provider module to crate::ai and flatten api/ai (#1589)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: CBenoit <3809077+CBenoit@users.noreply.github.com>
1 parent b11f050 commit 737daaf

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

devolutions-gateway/src/ai/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//! AI module for provider configuration and utilities.
2+
//!
3+
//! This module contains shared types and utilities for AI provider integration.
4+
5+
mod provider;
6+
7+
pub use provider::{AuthMethod, ProviderConfig, ProviderConfigBuilder};
File renamed without changes.
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
//! It handles authentication via a gateway API key and forwards requests to the
66
//! configured AI provider endpoints.
77
8-
mod provider;
9-
108
use std::time::Duration;
119

1210
use axum::Router;
@@ -18,10 +16,9 @@ use axum::routing::{get, post};
1816
use http_body_util::BodyExt as _; // into_data_stream
1917

2018
use crate::DgwState;
19+
use crate::ai::{AuthMethod, ProviderConfig, ProviderConfigBuilder};
2120
use crate::http::HttpError;
2221

23-
pub use provider::{AuthMethod, ProviderConfig, ProviderConfigBuilder};
24-
2522
/// Anthropic API version header value
2623
const ANTHROPIC_API_VERSION: &str = "2023-06-01";
2724

devolutions-gateway/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ extern crate tracing;
1313
#[cfg(feature = "openapi")]
1414
pub mod openapi;
1515

16+
pub mod ai;
1617
pub mod api;
1718
pub mod config;
1819
pub mod credential;

0 commit comments

Comments
 (0)