helicone-rb 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30551d818f767a29ad080d1ec1beffc42a5346e0e4f94f9cbe112b6c7aaaa9b5
4
- data.tar.gz: 3505af534452304f15f075a0fbde6d334c8a1b3cc8a4a85f61abc292fe564226
3
+ metadata.gz: e88e12d27963faaf420d13dc78cda2eada0f86fd97fb22570c310ac91610bf03
4
+ data.tar.gz: fa8f16816537172ec4ef2c859791e63e816860fe23a5e72bc78b361177587d9a
5
5
  SHA512:
6
- metadata.gz: 2e09d82c356de9e0ca25af6846e582c63bbc773fab7c7f257e0e06a2dcf4ebbb0ee6af983457a7fd61fa9b5ec84116e7621017cf4fb8216649bdfc23fd6d14a9
7
- data.tar.gz: 44affe9ff8922ba1254567b88cb7ac4b280aa3b95eac4162969c6ac606e6be5194f8b2b1784feaba1cdc73d340d67cef078f5bf7e63b4caa36b401a02ce384d8
6
+ metadata.gz: 5a3b285e947a350c25e2b7d68b5c415b38ed1415eaaa366078ed356405e19989f1fc4674e4709113dfc09a3b089534edbb03fbebdfa169d5f0b1d13ec28612fb
7
+ data.tar.gz: b8feec47c41a127a1108328c729ee11398d83c360b8498aacb71781c9a035aba6cba874851647cfc706dd93a08961593ce1f889cabc087c472850f8e427a3b5b
data/README.md CHANGED
@@ -1,7 +1,11 @@
1
+ > **Beta** - This library is under active development. APIs may change.
2
+
1
3
  # Helicone Ruby Client
2
4
 
3
5
  A Ruby client for the [Helicone AI Gateway](https://helicone.ai), wrapping the OpenAI API with built-in session tracking, cost attribution, and an agentic framework for building AI applications with tool/function calling.
4
6
 
7
+
8
+
5
9
  ## Why Helicone?
6
10
 
7
11
  [Helicone](https://helicone.ai) is an AI gateway that sits between your application and LLM providers (OpenAI, Anthropic, etc.). It provides:
@@ -16,6 +20,35 @@ A Ruby client for the [Helicone AI Gateway](https://helicone.ai), wrapping the O
16
20
 
17
21
  *The Helicone dashboard shows all your LLM requests with latency, cost, and token usage at a glance.*
18
22
 
23
+ ### Under the hood
24
+ This is an API that interacts with **any OpenAI-format /chat/completions LLM endpoint.**
25
+ [Helicone](https://helicone.ai) acts as a proxy, similar to OpenRouter, with built in telemetry and more.
26
+
27
+ This library adds the ability to interact with Helicone specific features like [Session waterfall tracking](https://github.com/genevere-inc/helicone-rb/tree/main?tab=readme-ov-file#session-and-account-tracking).
28
+
29
+ ### Alternatives
30
+
31
+ **[RubyLLM](https://rubyllm.com/)**
32
+
33
+ This library is great for an opinioned quick start, but I found it has too much magic under the hood that makes using proxies like Helicone and OpenRouter very difficult.
34
+
35
+ **[`alexrudall/ruby-openai`](https://github.com/alexrudall/ruby-openai)**
36
+
37
+ This gem uses this great library under the hood. If you don't need tool calling or helicone, you can use this instead.
38
+
39
+ **[`openai/openai-ruby`](https://github.com/openai/openai-ruby)**
40
+
41
+ This is the official gem from OpenAI. It's severely lacking in functionality.
42
+
43
+ **[`Traceloop`](https://traceloop.com/)**
44
+
45
+ A telemetry tool built on top of OpenTelemetry. Their `traceloop-sdk` gem did not work out of the box as of June 2025, but accepts OpenTelemetry endpoints and works quite well for visualizing agentic workflows.
46
+
47
+ Note that it **does not** act as a _proxy_ in the way Helicone and OpenRouter do, which may help if you need to use LLM hosts directly, or may be a drawback given it lacks the fallback mechanisms the proxies include.
48
+
49
+ _Note:_ I've used this in production and it works very reliably for tracking, but cost aggregation has never worked correctly. For that and other challenges, switched to Helicone.
50
+
51
+
19
52
  ## Installation
20
53
 
21
54
  Add this line to your application's Gemfile:
@@ -223,7 +256,7 @@ end
223
256
  ```ruby
224
257
  agent = Helicone::Agent.new(
225
258
  tools: [WeatherTool, CalendarTool],
226
- system: "You are a helpful assistant with access to weather and calendar tools.",
259
+ system_prompt: "You are a helpful assistant with access to weather and calendar tools.",
227
260
  context: current_user # Passed to tool#initialize
228
261
  )
229
262
 
@@ -11,17 +11,17 @@ module Helicone
11
11
  # @param client [Helicone::Client] Optional client (creates new one if not provided)
12
12
  # @param tools [Array<Class>] Array of Tool subclasses
13
13
  # @param context [Object] Context object passed to tool#initialize
14
- # @param system [String] System prompt
14
+ # @param system_prompt [String] System prompt
15
15
  # @param messages [Array<Helicone::Message>] Initial messages (for continuing conversations)
16
- def initialize(client: nil, tools: [], context: nil, system: nil, messages: [])
16
+ def initialize(client: nil, tools: [], context: nil, system_prompt: nil, messages: [])
17
17
  @client = client || Client.new
18
18
  @tools = tools
19
19
  @context = context
20
20
  @messages = messages.dup
21
21
 
22
22
  # Add system message at the start if provided and not already present
23
- if system && @messages.none? { |m| m.respond_to?(:role) && m.role == "system" }
24
- @messages.unshift(Message.system(system))
23
+ if system_prompt && @messages.none? { |m| m.respond_to?(:role) && m.role == "system" }
24
+ @messages.unshift(Message.system(system_prompt))
25
25
  end
26
26
  end
27
27
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Helicone
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: helicone-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genevere