1use serde::Serialize;
7
8#[derive(Debug, Clone, Serialize)]
14pub struct AgentIdentity {
15 pub name: String,
17
18 pub creator: Option<String>,
20
21 pub description: Option<String>,
23
24 pub language: Option<String>,
26
27 pub custom_prompt: Option<String>,
29}
30
31impl Default for AgentIdentity {
32 fn default() -> Self {
33 Self {
34 name: "aster".to_string(),
35 creator: Some("Block".to_string()),
36 description: Some(
37 "aster is being developed as an open-source software project.\n\
38 aster uses LLM providers with tool calling capability."
39 .to_string(),
40 ),
41 language: None,
42 custom_prompt: None,
43 }
44 }
45}
46
47impl AgentIdentity {
48 pub fn new(name: impl Into<String>) -> Self {
50 Self {
51 name: name.into(),
52 creator: None,
53 description: None,
54 language: None,
55 custom_prompt: None,
56 }
57 }
58
59 pub fn with_creator(mut self, creator: impl Into<String>) -> Self {
61 self.creator = Some(creator.into());
62 self
63 }
64
65 pub fn with_description(mut self, desc: impl Into<String>) -> Self {
67 self.description = Some(desc.into());
68 self
69 }
70
71 pub fn with_language(mut self, lang: impl Into<String>) -> Self {
73 self.language = Some(lang.into());
74 self
75 }
76
77 pub fn with_custom_prompt(mut self, prompt: impl Into<String>) -> Self {
79 self.custom_prompt = Some(prompt.into());
80 self
81 }
82}