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.4.0.tar.gz (11.0 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.4.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for agentforge_langfuse-0.4.0.tar.gz
Algorithm Hash digest
SHA256 3d40e7189b015c40069b110a12804e0f0d11fb45ffaa549c286ee498d3b6f371
MD5 d12d83bdecab20d6182917cae9d4033a
BLAKE2b-256 d7a92231a896eeacbfbec7b4d28bb338ede9a54fb3c393a26d9cde0884c29139

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_langfuse-0.4.0.tar.gz:

Publisher: release.yml on Scaffoldic/agentforge-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for agentforge_langfuse-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82ef3873066a6347655f9568296a77d9353d38d64355b7e2b582f792570b319d
MD5 8fba6479aeba8bd87a8df653eb6f2844
BLAKE2b-256 3a77d6c5668e49f554e3dafdd3b9afc987d58f63685c16ca0d404b8a7911f2f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_langfuse-0.4.0-py3-none-any.whl:

Publisher: release.yml on Scaffoldic/agentforge-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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