Skip to main content

langfuse/
lib.rs

1#![warn(missing_docs)]
2
3//! Langfuse SDK for Rust — LLM observability, prompt management, and evaluation.
4//!
5//! # Quick Start
6//! ```no_run
7//! use langfuse::Langfuse;
8//!
9//! let client = Langfuse::new(
10//!     langfuse_core::LangfuseConfig::builder()
11//!         .public_key("pk-lf-...")
12//!         .secret_key("sk-lf-...")
13//!         .build()
14//!         .unwrap()
15//! ).unwrap();
16//! ```
17
18pub mod client;
19pub mod datasets;
20pub mod http;
21#[path = "tracing/mod.rs"]
22pub mod langfuse_tracing;
23pub mod media;
24pub mod prompts;
25pub mod scoring;
26
27// Re-exports for ergonomic usage
28pub use client::Langfuse;
29pub use langfuse_macros::observe;
30
31pub use langfuse_core::types::*;
32pub use langfuse_core::{LangfuseConfig, LangfuseError, Result};
33
34pub use langfuse_tracing::context::{
35    get_current_observation_id, get_current_trace_id, propagate_as_baggage, propagate_attributes,
36};
37pub use langfuse_tracing::context_apis::{
38    get_current_trace_url, score_current_span, score_current_span_with, score_current_trace,
39    set_current_trace_as_public, update_current_generation, update_current_span,
40};
41pub use langfuse_tracing::embedding::LangfuseEmbedding;
42pub use langfuse_tracing::generation::LangfuseGeneration;
43pub use langfuse_tracing::observe::{
44    with_agent, with_chain, with_embedding, with_evaluator, with_generation, with_guardrail,
45    with_observation, with_retriever, with_span, with_tool,
46};
47pub use langfuse_tracing::span::LangfuseSpan;
48pub use langfuse_tracing::stream_wrapper::{ObservingIterator, ObservingStream};