0.2.0 builder model and crate re-export

This commit is contained in:
2025-10-24 02:44:26 +09:00
parent d03172610d
commit 48bbab0a69
35 changed files with 2491 additions and 773 deletions
-64
View File
@@ -341,70 +341,6 @@ pub enum StreamEvent {
},
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RoleConfig {
pub name: String,
pub description: String,
#[serde(default)]
pub version: Option<String>,
// 新しいテンプレートベースの設定
pub template: Option<String>,
pub partials: Option<HashMap<String, PartialConfig>>,
// 従来の prompt フィールドもサポート(後方互換性のため)
pub prompt: Option<PromptConfig>,
#[serde(skip)]
pub path: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PartialConfig {
pub path: String,
#[serde(default)]
pub description: Option<String>,
}
impl Default for RoleConfig {
fn default() -> Self {
Self {
name: String::new(),
description: String::new(),
version: None,
template: None,
partials: None,
prompt: None,
path: None,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(untagged)]
pub enum PromptComponent {
#[default]
None,
Single(PromptComponentDetail),
Multiple(Vec<PromptComponentDetail>),
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct PromptComponentDetail {
pub path: String,
#[serde(flatten)]
pub inner: Option<HashMap<String, PromptComponentDetail>>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct PromptConfig {
#[serde(rename = "ROLE_DEFINE")]
pub role_define: Option<PromptComponent>,
#[serde(rename = "BASIS")]
pub basis: Option<PromptComponent>,
#[serde(rename = "TOOL_USE")]
pub tool_use: Option<PromptComponent>,
#[serde(rename = "SECTIONS")]
pub sections: Option<PromptComponent>,
}
// Session management types
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SessionData {