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.3.1.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.3.1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentforge_langfuse-0.3.1.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.3.1.tar.gz
Algorithm Hash digest
SHA256 f9b7afac9d85298ef6c19cc2937f9c80b7ed7c78fb94b84e0f49998b16260c52
MD5 bdfddc4de7b99c309b4573493d5e0960
BLAKE2b-256 cf5207a46ede06c53c2d1f6b5c2cbf1b6b79cd34bbabc87e5305c2575ab5b721

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_langfuse-0.3.1.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.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for agentforge_langfuse-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7f0933e5c4afef177f1f921b1b66ebbe37da2340f595285c91dcd0ee27183fc2
MD5 a443192d0dd7db7be3105480cf788a57
BLAKE2b-256 cb7eb1d4e4d6690df481c1cade083d7a45b0c904690134ef9bd73af29392f581

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_langfuse-0.3.1-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