Skip to content

Instantly share code, notes, and snippets.

@stympy
Created March 13, 2026 18:18
Show Gist options
  • Select an option

  • Save stympy/3b6700c1e994335ca1e60979099c5370 to your computer and use it in GitHub Desktop.

Select an option

Save stympy/3b6700c1e994335ca1e60979099c5370 to your computer and use it in GitHub Desktop.
Honeybadger RubyLLM test script
require "ruby_llm"
require "honeybadger"
Honeybadger.configure do |config|
config.api_key = ENV.fetch("HONEYBADGER_API_KEY")
config.env = "production"
config.debug = true
end
Honeybadger.load_plugins!
RubyLLM.configure do |config|
config.openai_api_key = ENV.fetch("OPENAI_API_KEY")
end
# 1. Chat completion
chat = RubyLLM.chat
response = chat.ask("What is a honeybadger?")
puts "Chat: #{response.content}"
# 2. Embedding
embedding = RubyLLM.embed("Honeybadger monitors your apps")
puts "Embedding dims: #{embedding.vectors.length}"
# Flush events to Honeybadger
Honeybadger.flush
puts "Done! Check Honeybadger Insights for ruby_llm events."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment