summaryrefslogtreecommitdiffstats
path: root/src/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/config')
-rw-r--r--src/config/agent.rs2
-rw-r--r--src/config/mod.rs14
2 files changed, 6 insertions, 10 deletions
diff --git a/src/config/agent.rs b/src/config/agent.rs
index 2b319ed..5f36097 100644
--- a/src/config/agent.rs
+++ b/src/config/agent.rs
@@ -36,7 +36,7 @@ impl Agent {
let definition_file_path = functions_dir.join("index.yaml");
let functions_file_path = functions_dir.join("functions.json");
let variables_path = Config::agent_variables_file(name)?;
- let rag_path = Config::agent_rag_file(name)?;
+ let rag_path = Config::agent_rag_file(name, "rag")?;
let config_path = Config::agent_config_file(name)?;
let agent_config = if config_path.exists() {
AgentConfig::load(&config_path)?
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 9ebf34b..c9a4a73 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -49,7 +49,6 @@ const FUNCTIONS_DIR_NAME: &str = "functions";
const FUNCTIONS_FILE_NAME: &str = "functions.json";
const FUNCTIONS_BIN_DIR_NAME: &str = "bin";
const AGENTS_DIR_NAME: &str = "agents";
-const AGENT_RAG_FILE_NAME: &str = "rag.bin";
const AGENT_VARIABLES_FILE_NAME: &str = "variables.yaml";
pub const TEMP_ROLE_NAME: &str = "%%";
@@ -331,12 +330,9 @@ impl Config {
}
pub fn rag_file(&self, name: &str) -> Result<PathBuf> {
- let path = if self.agent.is_none() {
- Self::rags_dir()?.join(format!("{name}.bin"))
- } else {
- Self::rags_dir()?
- .join(AGENTS_DIR_NAME)
- .join(format!("{name}.bin"))
+ let path = match &self.agent {
+ Some(agent) => Self::agent_rag_file(agent.name(), name)?,
+ None => Self::rags_dir()?.join(format!("{name}.bin")),
};
Ok(path)
}
@@ -356,8 +352,8 @@ impl Config {
Ok(Self::agent_config_dir(name)?.join(CONFIG_FILE_NAME))
}
- pub fn agent_rag_file(name: &str) -> Result<PathBuf> {
- Ok(Self::agent_config_dir(name)?.join(AGENT_RAG_FILE_NAME))
+ pub fn agent_rag_file(agent_name: &str, rag_name: &str) -> Result<PathBuf> {
+ Ok(Self::agent_config_dir(agent_name)?.join(format!("{rag_name}.bin")))
}
pub fn agent_variables_file(name: &str) -> Result<PathBuf> {