mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-07-29 17:31:45 +08:00
feat: 新增 Computer Use Agent 初步支持
This commit is contained in:
30
src/config/schema/computer_use.rs
Normal file
30
src/config/schema/computer_use.rs
Normal file
@@ -0,0 +1,30 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use typeshare::typeshare;
|
||||
|
||||
#[typeshare]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(default)]
|
||||
pub struct ComputerUseConfig {
|
||||
pub enabled: bool,
|
||||
pub provider: String,
|
||||
pub base_url: String,
|
||||
pub model: String,
|
||||
#[typeshare(skip)]
|
||||
pub openai_api_key: Option<String>,
|
||||
pub max_steps: u32,
|
||||
pub timeout_seconds: u32,
|
||||
}
|
||||
|
||||
impl Default for ComputerUseConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
enabled: false,
|
||||
provider: "openai".to_string(),
|
||||
base_url: "https://api.openai.com/v1/responses".to_string(),
|
||||
model: "gpt-5.5".to_string(),
|
||||
openai_api_key: None,
|
||||
max_steps: 30,
|
||||
timeout_seconds: 600,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,12 +6,14 @@ pub use crate::rustdesk::config::RustDeskConfig;
|
||||
|
||||
mod atx;
|
||||
mod common;
|
||||
mod computer_use;
|
||||
mod hid;
|
||||
mod stream;
|
||||
mod web;
|
||||
|
||||
pub use atx::*;
|
||||
pub use common::*;
|
||||
pub use computer_use::*;
|
||||
pub use hid::*;
|
||||
pub use stream::*;
|
||||
pub use web::*;
|
||||
@@ -30,6 +32,7 @@ pub struct AppConfig {
|
||||
pub audio: AudioConfig,
|
||||
pub stream: StreamConfig,
|
||||
pub web: WebConfig,
|
||||
pub computer_use: ComputerUseConfig,
|
||||
pub extensions: ExtensionsConfig,
|
||||
pub rustdesk: RustDeskConfig,
|
||||
pub rtsp: RtspConfig,
|
||||
|
||||
Reference in New Issue
Block a user