Class: Langsmith::Railtie

Inherits:
Rails::Railtie
  • Object
show all
Defined in:
lib/langsmith/railtie.rb

Overview

Rails integration for automatic configuration and lifecycle management.

When Rails is detected, this Railtie will:

  • Automatically configure Langsmith from Rails credentials or environment
  • Register shutdown hooks to flush traces before the application exits
  • Provide a generator for creating an initializer

Examples:

Using Rails credentials (config/credentials.yml.enc)

langsmith:
  api_key: ls_...
  project: my-rails-app

Using environment variables

LANGSMITH_API_KEY=ls_...
LANGSMITH_PROJECT=my-rails-app
LANGSMITH_TRACING=true