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 ¶
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.