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

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentforge_langfuse-0.2.3.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agentforge_langfuse-0.2.3.tar.gz
Algorithm Hash digest
SHA256 4a0f2c52ff4c6f375069204897720d626281efffcbeac11f2c65c3fef167d01b
MD5 803917aa7a9f7601c12fadb973c99f34
BLAKE2b-256 702da42a1609cd7e88df544c405d8334501500032b948509792132871cfe8755

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agentforge_langfuse-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for agentforge_langfuse-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 936d6e38f7da2ea7fcedcceb186baa828a9017e08c85ec602f5aa421cc495e71
MD5 e47acd86e32bd84048d58ad77b69cb8f
BLAKE2b-256 1870c165b809966189530692d974ca2bad43e3d852f3491b2c1d9f8fe1dfa02d

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