langfuse

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package langfuse provides observability and tracing for LLM interactions via the Langfuse service.

It solves the problem of capturing traces, spans, and generations for Genie's agent runs so that teams can debug, monitor, and analyze LLM usage in one place. When configured (LANGFUSE_* credentials), the package exports traces to Langfuse and can optionally sync prompt definitions. Without it, debugging agent behavior would rely solely on local logs and audit files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrompt

func GetPrompt(ctx context.Context, name, defaultPrompt string) string

Types

type Client

type Client interface {
	// GetPrompt returns the prompt template by name, or the default if not found/disabled.
	GetPrompt(ctx context.Context, name, defaultPrompt string) string
}

Client defines the interface for fetching prompts from Langfuse.

type Config

type Config struct {
	PublicKey     string `json:"public_key" toml:"public_key,omitempty" yaml:"public_key,omitempty"`
	SecretKey     string `json:"secret_key" toml:"secret_key,omitempty" yaml:"secret_key,omitempty"`
	Host          string `json:"host" toml:"host,omitempty" yaml:"host,omitempty"`
	EnablePrompts bool   `json:"enable_prompts" toml:"enable_prompts,omitempty" yaml:"enable_prompts,omitempty"`
}

Config holds the configuration for the Langfuse integration, which provides observability and tracing for LLM interactions.

func DefaultConfig

func DefaultConfig(ctx context.Context, sp security.SecretProvider) Config

DefaultConfig builds the default Langfuse configuration by resolving credentials through the given SecretProvider. Without a SecretProvider, callers can pass security.NewEnvProvider() to preserve the legacy os.Getenv behavior.

func (Config) Init

func (c Config) Init(ctx context.Context)

func (Config) NewClient

func (c Config) NewClient() Client

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL