summaryrefslogtreecommitdiffstats
path: root/src/config/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config/mod.rs')
-rw-r--r--src/config/mod.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 10718df..693c9f5 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -2,6 +2,7 @@ mod agent;
mod input;
mod role;
mod session;
+mod subquery;
pub use self::agent::{complete_agent_variables, list_agents, Agent, AgentVariables};
pub use self::input::Input;
@@ -9,6 +10,7 @@ pub use self::role::{
Role, RoleLike, CODE_ROLE, CREATE_TITLE_ROLE, EXPLAIN_SHELL_ROLE, SHELL_ROLE,
};
use self::session::Session;
+pub use self::subquery::{eval_subquery, SubqueryContext};
use crate::client::{
create_client_config, list_client_types, list_models, ClientConfig, MessageContentToolCalls,
@@ -117,6 +119,9 @@ pub struct Config {
pub mapping_tools: IndexMap<String, String>,
pub use_tools: Option<String>,
+ pub subquery: bool,
+ pub subquery_max_depth: usize,
+
pub repl_prelude: Option<String>,
pub cmd_prelude: Option<String>,
pub agent_prelude: Option<String>,
@@ -193,6 +198,9 @@ impl Default for Config {
mapping_tools: Default::default(),
use_tools: None,
+ subquery: false,
+ subquery_max_depth: 3,
+
repl_prelude: None,
cmd_prelude: None,
agent_prelude: None,
@@ -599,6 +607,8 @@ impl Config {
("rag_top_k", rag_top_k.to_string()),
("dry_run", self.dry_run.to_string()),
("function_calling", self.function_calling.to_string()),
+ ("subquery", self.subquery.to_string()),
+ ("subquery_max_depth", self.subquery_max_depth.to_string()),
("stream", self.stream.to_string()),
("save", self.save.to_string()),
("keybindings", self.keybindings.clone()),
@@ -677,6 +687,14 @@ impl Config {
}
config.write().function_calling = value;
}
+ "subquery" => {
+ let value = value.parse().with_context(|| "Invalid value")?;
+ config.write().subquery = value;
+ }
+ "subquery_max_depth" => {
+ let value = value.parse().with_context(|| "Invalid value")?;
+ config.write().subquery_max_depth = value;
+ }
"stream" => {
let value = value.parse().with_context(|| "Invalid value")?;
config.write().stream = value;
@@ -1710,6 +1728,10 @@ impl Config {
);
functions = agent_functions;
}
+
+ if self.subquery {
+ functions.push(self::subquery::subquery_declaration());
+ }
};
if functions.is_empty() {
None