1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! # OpenInference Semantic Conventions for Rust
//!
//! This crate provides attribute constants and types for the
//! [OpenInference semantic conventions](https://github.com/Arize-ai/openinference/blob/main/spec/semantic_conventions.md).
//!
//! OpenInference is a set of conventions for instrumenting LLM applications,
//! compatible with OpenTelemetry and designed to work with observability platforms
//! like [Arize Phoenix](https://phoenix.arize.com/).
//!
//! ## Usage
//!
//! ```rust
//! use openinference_semantic_conventions::{SpanKind, attributes};
//! use opentelemetry::KeyValue;
//!
//! // Set the span kind
//! let kind = KeyValue::new(attributes::OPENINFERENCE_SPAN_KIND, SpanKind::Llm.as_str());
//!
//! // Set LLM attributes
//! let model = KeyValue::new(attributes::llm::MODEL_NAME, "gpt-4");
//! let tokens = KeyValue::new(attributes::llm::token_count::TOTAL, 150i64);
//! ```
//!
//! ## OTel GenAI Compatibility
//!
//! This crate also provides aliases for [OpenTelemetry GenAI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/)
//! via the [`gen_ai`] module, enabling compatibility with both OpenInference and OTel backends.
pub use SpanKind;
/// Re-export commonly used items