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

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentforge_langfuse-0.3.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.3.0.tar.gz
Algorithm Hash digest
SHA256 5ddcf5ddd8baba5ca5b797cb1456e3844909ee50411a2ad9c84fb55386ca3258
MD5 153512553ebf5063f2ae11ee5a05b4e0
BLAKE2b-256 908ce89ebfb92e3d117eed830c90685d0a9864f2c2dbc46639a958dd6fa00530

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for agentforge_langfuse-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58587a11bcd6c570e5634b880e187dc8f08a8517986e20bc50540f2aad5c7323
MD5 887d5742c00fef84720e1b9926143053
BLAKE2b-256 9b6402d5368eca1add9c52c1c9aec526c5d69cd478038e9eea52e20335a1a0c7

See more details on using hashes here.

Provenance

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