generalbots/botserver/build.rs
Rodrigo Rodriguez 1a36f4aed2 fix: Embedding server auto-config and KB indexing fixes
- botserver/src/llm/local.rs:
  * Auto-configure embedding-url when empty (http://localhost:8082/v1/embeddings)
  * Auto-configure llm-url when empty (http://localhost:8081/v1/chat/completions)
  * Persist defaults to bot_configuration table via ConfigManager
  * Fix llama-server command path and add LD_LIBRARY_PATH
  * Fix working_dir for Linux (not just Windows)
  * Fix embedding server args: --embeddings --pooling mean --ctx-size 512

- botserver/src/core/bootstrap/bootstrap_manager.rs:
  * Temp disable alm-ci startup (causes 20s hang in bootstrap)
  * Remove unused alm_ci_health_check import

- Database changes:
  * bot_configuration.embedding-model: 'bge-small-en-v1.5-f32.gguf' (full filename)
  * bot_configuration.embedding-url: 'http://localhost:8082/v1/embeddings' (auto-generated)

- Testing:
  * Embedding server responds on port 8082
  * Generates 384-dimension embeddings
  * KB file exists: minio://default.gbai/default.gbkb/manual/test-kb-manual.txt
  * Next: Verify KB indexing and search functionality

Refs: #498
2026-04-28 14:27:00 -03:00

48 lines
1.3 KiB
Rust

fn main() {
if std::path::Path::new("../botui/ui/suite/").exists() {
println!("cargo:rerun-if-changed=../botui/ui/suite/");
}
println!("cargo:rerun-if-changed=3rdparty.toml");
println!("cargo:rerun-if-changed=.env.embedded");
if let Ok(date) = std::env::var("BOTSERVER_BUILD_DATE") {
println!("cargo:rustc-env=BOTSERVER_BUILD_DATE={}", date);
} else {
println!("cargo:rustc-env=BOTSERVER_BUILD_DATE={}", chrono_now());
}
let commit = std::env::var("BOTSERVER_COMMIT")
.ok()
.or_else(|| git_commit_hash());
if let Some(hash) = commit {
println!("cargo:rustc-env=BOTSERVER_COMMIT={}", hash);
}
}
fn git_commit_hash() -> Option<String> {
let output = std::process::Command::new("git")
.args(["rev-parse", "--short", "HEAD"])
.output()
.ok()?;
if !output.status.success() {
return None;
}
String::from_utf8(output.stdout).ok().map(|s| s.trim().to_string())
}
fn chrono_now() -> String {
let output = match std::process::Command::new("date")
.args(["+%Y-%m-%dT%H:%M:%S"])
.output()
{
Ok(o) => o,
Err(_) => return "unknown".to_string(),
};
if !output.status.success() {
return "unknown".to_string();
}
String::from_utf8(output.stdout)
.ok()
.map(|s| s.trim().to_string())
.unwrap_or_else(|| "unknown".to_string())
}