coolhand 0.4.0 → 0.5.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 +4 -4
- data/CHANGELOG.md +51 -0
- data/README.md +70 -149
- data/SECURITY.md +20 -0
- data/docs/configuration.md +59 -0
- data/docs/feedback.md +79 -0
- data/docs/openai.md +60 -0
- data/docs/vertex.md +54 -0
- data/lib/coolhand/api_service.rb +12 -1
- data/lib/coolhand/base_interceptor.rb +35 -107
- data/lib/coolhand/configuration.rb +2 -2
- data/lib/coolhand/logger_service.rb +3 -2
- data/lib/coolhand/net_http_interceptor.rb +28 -5
- data/lib/coolhand/open_ai/batch_result_processor.rb +2 -0
- data/lib/coolhand/open_ai/webhook_validator.rb +6 -2
- data/lib/coolhand/version.rb +1 -1
- data/lib/coolhand/vertex/batch_result_processor.rb +97 -40
- data/lib/coolhand/webhook_interceptor.rb +11 -0
- data/lib/coolhand.rb +1 -1
- metadata +15 -8
- data/.idea/coolhand-ruby.iml +0 -6
- data/CLAUDE.md +0 -34
metadata
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: coolhand
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Carroll
|
|
8
8
|
- Yaroslav Malyk
|
|
9
|
+
autorequire:
|
|
9
10
|
bindir: exe
|
|
10
11
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
12
|
+
date: 2026-08-02 00:00:00.000000000 Z
|
|
12
13
|
dependencies:
|
|
13
14
|
- !ruby/object:Gem::Dependency
|
|
14
15
|
name: base64
|
|
@@ -25,26 +26,30 @@ dependencies:
|
|
|
25
26
|
- !ruby/object:Gem::Version
|
|
26
27
|
version: '0.2'
|
|
27
28
|
description: Automatically intercept and log LLM requests from Ruby applications.
|
|
28
|
-
Supports OpenAI, official Anthropic gem, ruby-anthropic gem,
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
Supports OpenAI, official Anthropic gem, ruby-anthropic gem, Google Gemini, Google
|
|
30
|
+
Vertex AI, AWS Bedrock, OpenRouter, and any other library using Net::HTTP (directly,
|
|
31
|
+
or via Faraday's default adapter). Features a single unified Net::HTTP interceptor,
|
|
32
|
+
streaming support, thread-safe operation, and automatic duplicate request prevention.
|
|
31
33
|
email:
|
|
32
34
|
- mc@coolhandlabs.com
|
|
33
35
|
executables: []
|
|
34
36
|
extensions: []
|
|
35
37
|
extra_rdoc_files: []
|
|
36
38
|
files:
|
|
37
|
-
- ".idea/coolhand-ruby.iml"
|
|
38
39
|
- ".rspec"
|
|
39
40
|
- ".rubocop.yml"
|
|
40
41
|
- ".simplecov"
|
|
41
42
|
- CHANGELOG.md
|
|
42
|
-
- CLAUDE.md
|
|
43
43
|
- LICENSE
|
|
44
44
|
- README.md
|
|
45
45
|
- Rakefile
|
|
46
|
+
- SECURITY.md
|
|
46
47
|
- docs/anthropic.md
|
|
48
|
+
- docs/configuration.md
|
|
47
49
|
- docs/elevenlabs.md
|
|
50
|
+
- docs/feedback.md
|
|
51
|
+
- docs/openai.md
|
|
52
|
+
- docs/vertex.md
|
|
48
53
|
- lib/coolhand.rb
|
|
49
54
|
- lib/coolhand/api_service.rb
|
|
50
55
|
- lib/coolhand/base_interceptor.rb
|
|
@@ -70,6 +75,7 @@ metadata:
|
|
|
70
75
|
source_code_uri: https://github.com/Coolhand-Labs/coolhand-ruby
|
|
71
76
|
changelog_uri: https://github.com/Coolhand-Labs/coolhand-ruby/blob/main/CHANGELOG.md
|
|
72
77
|
rubygems_mfa_required: 'true'
|
|
78
|
+
post_install_message:
|
|
73
79
|
rdoc_options: []
|
|
74
80
|
require_paths:
|
|
75
81
|
- lib
|
|
@@ -84,7 +90,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
84
90
|
- !ruby/object:Gem::Version
|
|
85
91
|
version: '0'
|
|
86
92
|
requirements: []
|
|
87
|
-
rubygems_version: 3.
|
|
93
|
+
rubygems_version: 3.5.22
|
|
94
|
+
signing_key:
|
|
88
95
|
specification_version: 4
|
|
89
96
|
summary: Monitor and log LLM API calls from OpenAI, Anthropic, and other providers
|
|
90
97
|
to Coolhand analytics.
|
data/.idea/coolhand-ruby.iml
DELETED
data/CLAUDE.md
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Development Guidelines
|
|
2
|
-
|
|
3
|
-
## Optional Provider Dependencies
|
|
4
|
-
|
|
5
|
-
Coolhand supports multiple LLM providers (OpenAI, Anthropic, Google Gemini, etc.). These provider gems should **never** be required at gem load time, as clients may not use all providers and shouldn't be forced to install unnecessary dependencies.
|
|
6
|
-
|
|
7
|
-
**Rule**: Any require for provider SDKs (openai, anthropic, google-generativeai, etc.) must be:
|
|
8
|
-
1. Placed in the file where it's actually used (not in the main coolhand.rb)
|
|
9
|
-
2. Only executed when that provider's functionality is accessed
|
|
10
|
-
3. Not declared as a hard dependency in coolhand-ruby.gemspec
|
|
11
|
-
|
|
12
|
-
Example pattern:
|
|
13
|
-
```ruby
|
|
14
|
-
# ❌ DON'T: In lib/coolhand.rb (loads unconditionally)
|
|
15
|
-
require "openai"
|
|
16
|
-
|
|
17
|
-
# ✅ DO: In lib/coolhand/open_ai/batch_result_processor.rb (only when needed)
|
|
18
|
-
require "openai"
|
|
19
|
-
|
|
20
|
-
module Coolhand
|
|
21
|
-
module OpenAi
|
|
22
|
-
class BatchResultProcessor
|
|
23
|
-
def client
|
|
24
|
-
@client ||= OpenAI::Client.new
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
This ensures:
|
|
32
|
-
- Gem loads cleanly regardless of what providers are installed
|
|
33
|
-
- Apps using path gems (local development) don't break from missing optional dependencies
|
|
34
|
-
- Users only need gems for providers they actually use
|