Skip to main content

Langfuse trace dashboard hook for AgentForge

Project description

agentforge-langfuse

Langfuse trace dashboard hook for the AgentForge framework.

Implements the StepHook + FinishHook contracts and registers as agentforge.hooks:langfuse.

Installation

pip install agentforge-langfuse[langfuse]

The [langfuse] extra pulls in the langfuse>=2.0 SDK. Without it, the production factory raises ModuleError with pip remediation.

Usage

from agentforge import Agent
from agentforge_langfuse import LangfuseHook

hook = LangfuseHook.from_config(
    public_key="pk-lf-...",
    secret_key="sk-lf-...",
    host="https://cloud.langfuse.com",
    trace_name_prefix="agentforge.pr-reviewer",
)

agent = Agent(
    model="bedrock:...",
    on_step=hook,
    on_finish=hook,
)

Trace shape

  • One trace per run, opened on the first step (keyed by run_id).
  • One span per step (name = "step:<kind>").
  • A nested span per tool_call (name = "tool:<name>").
  • Two scores on finish: cost_usd and duration_ms.
  • The trace is flush()-ed at finish so it lands in the dashboard without waiting for the SDK's batch interval.

License

Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentforge_langfuse-0.2.4.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentforge_langfuse-0.2.4-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file agentforge_langfuse-0.2.4.tar.gz.

File metadata

  • Download URL: agentforge_langfuse-0.2.4.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentforge_langfuse-0.2.4.tar.gz
Algorithm Hash digest
SHA256 b540bab7ec5c6a37193ea5e8d6f685d61fb2e3b80884713a85047bfa3796a8b4
MD5 5998bdf1dfeeee611fadcb42f992ca1e
BLAKE2b-256 45daca52823f996d61c051224c3553c8c5f7c5ce48d57ff6ff2bc151c9c178fb

See more details on using hashes here.

File details

Details for the file agentforge_langfuse-0.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for agentforge_langfuse-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8af6da990c6b56b91bc9380968ef993d0d4c10689cb4388e781bc337ba928fea
MD5 01223c0237a10c91bf9d71f046d1720c
BLAKE2b-256 28a136fe823d776b87be6bcccca907b18aabd55dc5ec0d11aa8ce621a0ba301a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page