ai_agent/utils/
prompt_editor.rs1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct PromptEditorConfig {
8 pub auto_save: bool,
9 pub syntax_highlighting: bool,
10 pub line_numbers: bool,
11 pub word_wrap: bool,
12}
13
14impl Default for PromptEditorConfig {
15 fn default() -> Self {
16 Self {
17 auto_save: true,
18 syntax_highlighting: true,
19 line_numbers: true,
20 word_wrap: false,
21 }
22 }
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27pub struct PromptTemplate {
28 pub name: String,
29 pub content: String,
30 pub description: Option<String>,
31}
32
33impl PromptTemplate {
34 pub fn new(name: &str, content: &str) -> Self {
35 Self {
36 name: name.to_string(),
37 content: content.to_string(),
38 description: None,
39 }
40 }
41}