Skip to content

Commit b025020

Browse files
committed
made schema field skipped but kept backwards compatibility
1 parent a3622f8 commit b025020

File tree

1 file changed

+5
-0
lines changed
  • crates/chat-cli/src/cli/agent

1 file changed

+5
-0
lines changed

crates/chat-cli/src/cli/agent/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ pub enum AgentConfigError {
129129
#[serde(rename_all = "camelCase", deny_unknown_fields)]
130130
#[schemars(description = "An Agent is a declarative way of configuring a given instance of q chat.")]
131131
pub struct Agent {
132+
#[serde(rename = "$schema", skip_serializing_if = "Option::is_none", default)]
133+
#[schemars(skip)]
134+
pub schema: Option<String>,
132135
/// Name of the agent
133136
pub name: String,
134137
/// This field is not model facing and is mostly here for users to discern between agents
@@ -178,6 +181,7 @@ pub struct Agent {
178181
impl Default for Agent {
179182
fn default() -> Self {
180183
Self {
184+
schema: None,
181185
name: DEFAULT_AGENT_NAME.to_string(),
182186
description: Some("Default agent".to_string()),
183187
prompt: Default::default(),
@@ -1270,6 +1274,7 @@ mod tests {
12701274
allowed_tools.insert("@server3/tool_*".to_string());
12711275

12721276
let agent = Agent {
1277+
schema: None,
12731278
name: "test-agent".to_string(),
12741279
description: None,
12751280
prompt: None,

0 commit comments

Comments
 (0)