pub mod ast_chunker;
pub mod preflight;
pub mod schema;
pub use codescout_embed::{chunk_markdown, split, split_markdown, RawChunk};
pub use codescout_embed::{chunk_size_for_model, create_embedder, create_embedder_with_config};
pub use codescout_embed::{Embedder, Embedding};
pub fn lang_for_ext(ext: &str) -> Option<&'static str> {
Some(match ext {
"rs" => "rust",
"py" => "python",
"ts" | "tsx" => "typescript",
"js" | "jsx" => "javascript",
"go" => "go",
"java" => "java",
"kt" => "kotlin",
"md" | "mdx" => "markdown",
"sh" | "bash" => "shell",
"toml" => "toml",
_ => return None,
})
}
#[cfg(test)]
mod tests {
#[test]
fn unknown_prefix_returns_error() {
let rt = tokio::runtime::Runtime::new().unwrap();
let result = rt.block_on(super::create_embedder("bogus:model"));
assert!(result.is_err(), "unknown prefix must error");
}
#[test]
fn chunk_size_for_local_model_uses_table() {
let sz = super::chunk_size_for_model("local:JinaEmbeddingsV2BaseCode");
assert!(sz > 0);
}
}