Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ thiserror = "2"
# multi-threaded runtime stays a dev-dependency for examples and tests.
tokio = { version = "1", default-features = false, features = ["sync", "time", "macros"] }

# Optional HTTP client, pulled in only by hosted-provider features. The `stream`
# feature enables `Response::bytes_stream` for Server-Sent-Events streaming.
# HTTP client used by hosted providers and the embedded Langfuse exporter. The
# `stream` feature enables `Response::bytes_stream` for Server-Sent-Events
# streaming.
reqwest = { version = "0.12", default-features = false, features = [
"json",
"rustls-tls",
"stream",
], optional = true }
] }

# Optional embedded SQLite checkpointer backend (`graph::checkpoint::sqlite`).
# `bundled` compiles SQLite from vendored C source so no system library is
Expand All @@ -47,7 +48,7 @@ rhai = { version = "1", features = ["sync"], optional = true }
[features]
default = []
# Hosted OpenAI Chat Completions provider (`harness::providers::openai`).
openai = ["dep:reqwest"]
openai = []
# Embedded SQLite-backed checkpointer (`graph::checkpoint::SqliteCheckpointer`).
sqlite = ["dep:rusqlite"]
# Embedded Rhai-backed `.ragsh` REPL session runtime (`repl::session`).
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,29 @@ export OPENAI_API_KEY=...
cargo run --features openai --example openai_chat
```

Export durable harness observations to Langfuse with the embedded client:

```rust
use tinyagents::{LangfuseClient, LangfuseTraceConfig};

let client = LangfuseClient::proxy("https://api.tinyhumans.ai", backend_jwt)?;
client
.send_observations(
LangfuseTraceConfig {
user_id: Some("user_123".to_string()),
session_id: Some("thread_abc".to_string()),
..Default::default()
},
&observations,
)
.await?;
```

`LangfuseClient::proxy` sends to the backend
`/telemetry/langfuse/ingestion` endpoint with bearer auth. Use
`LangfuseClient::direct(langfuse_url, public_key, secret_key)` when an
application is allowed to talk to Langfuse directly.

## Examples to explore

All live in [`examples/`](examples/):
Expand Down
Loading