diff options
| author | sigoden <sigoden@gmail.com> | 2024-07-31 07:57:19 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-31 07:57:19 +0800 |
| commit | 227cd5891f7b997a0936b3302aa636935d9d6ace (patch) | |
| tree | fa4d22bc968cc8178ae1ed6e86353cf2e619323e /src/config/agent.rs | |
| parent | 3ab489ebac3ebb1ac20ca56a4716785e203212e4 (diff) | |
| download | aichat-227cd5891f7b997a0936b3302aa636935d9d6ace.tar.gz | |
feat: add agent-scoped `agent_prelude` config (#770)
Diffstat (limited to 'src/config/agent.rs')
| -rw-r--r-- | src/config/agent.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/config/agent.rs b/src/config/agent.rs index 0025095..b20e108 100644 --- a/src/config/agent.rs +++ b/src/config/agent.rs @@ -139,6 +139,10 @@ impl Agent { self.definition.interpolated_instructions() } + pub fn agent_prelude(&self) -> Option<&str> { + self.config.agent_prelude.as_deref() + } + pub fn variables(&self) -> &[AgentVariable] { &self.definition.variables } @@ -211,7 +215,9 @@ pub struct AgentConfig { #[serde(skip_serializing_if = "Option::is_none")] pub top_p: Option<f64>, #[serde(skip_serializing_if = "Option::is_none")] - use_tools: Option<String>, + pub use_tools: Option<String>, + #[serde(skip_serializing_if = "Option::is_none")] + pub agent_prelude: Option<String>, } impl AgentConfig { |
