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 +4 -4
- data/lib/helicone/agent.rb +6 -3
- data/lib/helicone/message.rb +3 -4
- data/lib/helicone/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ce9db5e8198fb863f8dd612b39b70a6d7b533e88d8a6ba19ec584d411f718541
|
|
4
|
+
data.tar.gz: 9ade07a85413d98df255a94b56099610c468d7644ace498392dc38b2799123b5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: be9bfec349c828c30865d22c32004769b650eca02252fa2401fe097d2fd87ad09711228b8d9980333ded71a6df990b0734ced95b935818c159c238a75502e61d
|
|
7
|
+
data.tar.gz: f3d70faaeffb523d07f329d0919c6c648f610f0b643314842d533dd9c73ab9c5b3c97d405bcf208ebfd2f895c7bf8c104bc475192e476061676d86829d1ae452
|
data/lib/helicone/agent.rb
CHANGED
|
@@ -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
|
-
|
|
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
|
|
data/lib/helicone/message.rb
CHANGED
|
@@ -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
|
-
#
|
|
118
|
-
|
|
119
|
-
|
|
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
|
data/lib/helicone/version.rb
CHANGED