Skip to main content

wae_ai/
lib.rs

1//! WAE AI - AI 服务抽象层
2//!
3//! 提供统一的 AI 能力抽象,支持多种 AI 服务商。
4//!
5//! 深度融合 tokio 运行时,所有 API 都是异步优先设计。
6//! 微服务架构友好,支持服务发现、链路追踪等特性。
7#![warn(missing_docs)]
8
9/// AI 能力模块
10pub mod capabilities;
11/// AI 服务提供商模块
12pub mod providers;
13
14pub use capabilities::{
15    ai_image::{AiImageCapability, AiImageInput, AiImageOutput, AiImageTask, LoRAConfig},
16    chat::{ChatCapability, ChatMessage},
17    text_to_image::{TextToImageCapability, TextToImageParams},
18};
19
20use serde::{Deserialize, Serialize};
21pub use wae_types::{WaeError, WaeResult};
22
23/// AI 操作结果类型
24pub type AiResult<T> = WaeResult<T>;
25/// AI 错误类型
26pub type AiError = WaeError;
27
28/// AI 服务配置
29#[derive(Clone, Debug, Serialize, Deserialize)]
30pub struct AiConfig {
31    /// 密钥 ID
32    pub secret_id: String,
33    /// 密钥
34    pub secret_key: String,
35    /// 服务端点
36    pub endpoint: Option<String>,
37    /// 区域
38    pub region: Option<String>,
39}