Created
March 13, 2026 18:18
-
-
Save stympy/3b6700c1e994335ca1e60979099c5370 to your computer and use it in GitHub Desktop.
Honeybadger RubyLLM test script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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