Skip to main content

troupekit_ffi_core/
lib.rs

1mod agent;
2mod error;
3mod graph;
4mod host;
5mod host_model;
6#[cfg(test)]
7mod host_model_tests;
8#[cfg(test)]
9mod host_tests;
10mod host_transport;
11#[cfg(test)]
12mod host_transport_tests;
13mod records;
14mod runtime;
15mod stream;
16#[cfg(test)]
17mod stream_tests;
18
19pub use agent::{AgentBuilder, AgentHandle};
20pub use error::{ErrorCode, FfiError};
21pub use graph::{GraphBuilder, GraphHandle};
22#[cfg(feature = "knowledge")]
23pub use host::HostEmbedder;
24pub use host::{
25    EventListener, HostModel, HostTool, HostTransport, HttpSink, TokenSink, TraceListener,
26};
27pub use records::{
28    FfiEvent, FfiEventKind, FfiPause, FfiUsage, GraphResult, HostError, HostHeader,
29    HostHttpRequest, HostMessage, HostModelCaps, HostReply, HostRequest, Progress, RunResult,
30};
31#[cfg(feature = "knowledge")]
32pub use records::{KnowledgeConfig, MemoryConfig};
33pub use runtime::{init, RuntimeSettings};
34pub use stream::RunStream;
35
36/// Returns the troupekit version this library was built from.
37/// Input: none. Output: the workspace package version, for example `0.1.0`,
38/// which every troupekit crate shares, so it matches `troupekit-core`.
39pub fn version() -> String {
40    let value = env!("CARGO_PKG_VERSION");
41    assert!(!value.is_empty());
42    assert!(value.split('.').count() == 3);
43    value.to_owned()
44}