summaryrefslogtreecommitdiffstats
path: root/src/utils/mod.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-07-28 10:15:43 +0800
committerGitHub <noreply@github.com>2024-07-28 10:15:43 +0800
commitc5b2be641acd43375f92fa04fb679911840c1c56 (patch)
tree1654b09766b87c41e707da7fcf75dbc6b1b2c7c9 /src/utils/mod.rs
parent49b61129c95a3528eaf25dabcb55825b5ed7be72 (diff)
downloadaichat-c5b2be641acd43375f92fa04fb679911840c1c56.tar.gz
feat: ask for confirmation when some rag documents fail to load (#760)
Diffstat (limited to 'src/utils/mod.rs')
-rw-r--r--src/utils/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/mod.rs b/src/utils/mod.rs
index 4e5428a..0c1a0c4 100644
--- a/src/utils/mod.rs
+++ b/src/utils/mod.rs
@@ -145,6 +145,10 @@ pub fn temp_file(prefix: &str, suffix: &str) -> PathBuf {
))
}
+pub fn is_url(path: &str) -> bool {
+ path.starts_with("http://") || path.starts_with("https://")
+}
+
pub fn set_proxy(
builder: reqwest::ClientBuilder,
proxy: Option<&String>,