helicone-rb 0.3.1 → 0.3.4

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: 3d7fc91958e3632fb91f474bfa20a5523bf2997ab33b2b0c5222977ff8a0b2e9
4
- data.tar.gz: 967e53e49f3e2ddd480102ae5552ce3e3074c2a8f412c7bc35aa519f74e20bad
3
+ metadata.gz: ce9db5e8198fb863f8dd612b39b70a6d7b533e88d8a6ba19ec584d411f718541
4
+ data.tar.gz: 9ade07a85413d98df255a94b56099610c468d7644ace498392dc38b2799123b5
5
5
  SHA512:
6
- metadata.gz: 70cc843edb4833e83aaee85d0af7703610f98ebff7e679e04ce5dde54419eaac22027d9c97ddccd0df55f75ff9ce1891d03686509c925ce8d7ab3fc37a2032ae
7
- data.tar.gz: '082978063ff56855409433acc6969bb0a244d5e1a34e2050824ad76534beeaff2f9051005fa83a698a932982712929547fc5801312486a9a12bb03c12c09b459'
6
+ metadata.gz: be9bfec349c828c30865d22c32004769b650eca02252fa2401fe097d2fd87ad09711228b8d9980333ded71a6df990b0734ced95b935818c159c238a75502e61d
7
+ data.tar.gz: f3d70faaeffb523d07f329d0919c6c648f610f0b643314842d533dd9c73ab9c5b3c97d405bcf208ebfd2f895c7bf8c104bc475192e476061676d86829d1ae452
@@ -4,7 +4,7 @@ module Helicone
4
4
  class Agent
5
5
  MAX_ITERATIONS = 10
6
6
 
7
- attr_reader :client, :tools, :messages, :context, :model
7
+ attr_reader :client, :tools, :messages, :context, :model, :options
8
8
 
9
9
  # Create an agent with tools and optional context
10
10
  #
@@ -16,11 +16,13 @@ module Helicone
16
16
  # @param system_prompt [String] System prompt
17
17
  # @param messages [Array<Helicone::Message>] Initial messages (for continuing conversations)
18
18
  # @param model [String] Model to use (defaults to Helicone.configuration.default_model)
19
- def initialize(client: nil, session: nil, user: nil, tools: [], context: nil, system_prompt: nil, messages: [], model: nil)
19
+ # @param options [Hash] Additional options passed through to chat calls (e.g., reasoning_effort)
20
+ def initialize(client: nil, session: nil, user: nil, tools: [], context: nil, system_prompt: nil, messages: [], model: nil, **options)
20
21
  @client = client || build_client(session: session, user: user)
21
22
  @tools = tools
22
23
  @context = context
23
24
  @model = model
25
+ @options = options
24
26
  @messages = messages.dup
25
27
 
26
28
  # Add system message at the start if provided and not already present
@@ -100,7 +102,8 @@ module Helicone
100
102
  messages: @messages,
101
103
  model: @model,
102
104
  tools: tools_for_api,
103
- tool_choice: "auto"
105
+ tool_choice: "auto",
106
+ **@options
104
107
  )
105
108
  end
106
109
 
@@ -114,10 +114,9 @@ module Helicone
114
114
  # @return [Hash] Message formatted for the API
115
115
  def to_h
116
116
  if @raw_message
117
- # Select only the fields needed for the API
118
- hash = { role: @raw_message[:role], content: @raw_message[:content] }
119
- hash[:tool_calls] = @raw_message[:tool_calls] if @raw_message[:tool_calls]
120
- hash
117
+ # Return the full raw message to preserve extra_content (thought signatures)
118
+ # and any other provider-specific fields (e.g., Gemini 3 requires thought_signature)
119
+ @raw_message
121
120
  else
122
121
  hash = { role: role, content: content }
123
122
  hash[:tool_call_id] = tool_call_id if tool_call_id
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Helicone
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.4"
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.3.1
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genevere