llm-sdk-rs 0.3.0

A Rust library that enables the development of applications that can interact with different language models through a unified interface.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::{Part, SourcePart};

pub(crate) fn get_compatible_parts_without_source_parts(parts: Vec<Part>) -> Vec<Part> {
    parts
        .into_iter()
        .flat_map(|part| match part {
            Part::Source(SourcePart { content, .. }) => {
                get_compatible_parts_without_source_parts(content)
            }
            _ => vec![part],
        })
        .collect()
}