langsmith_rust/utils/
validation.rs

1use crate::models::run::Run;
2use crate::error::Result;
3
4/// Validates a Run before sending to LangSmith
5pub fn validate_run(run: &Run) -> Result<()> {
6    if run.name.is_empty() {
7        return Err(crate::error::LangSmithError::Config(
8            "Run name cannot be empty".to_string()
9        ));
10    }
11
12    if !run.inputs.is_object() {
13        return Err(crate::error::LangSmithError::Config(
14            "Run inputs must be an object".to_string()
15        ));
16    }
17
18    Ok(())
19}
20