inferential 1.3.0

Rust client SDK for Inferential inference orchestration
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
fn main() {
    let manifest = std::path::Path::new(env!("CARGO_MANIFEST_DIR"));
    let proto_root = manifest.parent().unwrap().join("proto");
    let proto_file = proto_root.join("inferential.proto");

    if proto_file.exists() {
        prost_build::compile_protos(&[&proto_file], &[&proto_root]).unwrap();
    } else {
        // Fallback for `cargo publish`: proto dir is outside the package tarball.
        // Copy the committed pre-generated bindings into OUT_DIR.
        let out = std::path::PathBuf::from(std::env::var("OUT_DIR").unwrap());
        std::fs::copy(
            manifest.join("src/inferential_generated.rs"),
            out.join("inferential.rs"),
        )
        .unwrap();
    }
}