verica-observability 0.1.2 → 0.1.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -34
  3. data/lib/verica/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a4717918614705eb9e9cd8af630733bc40c6e3ba73ae69823acf02b7bb4343b
4
- data.tar.gz: d026c3e15ca4e5c22e709032118672cd7815945643a16caee3d079679a61fbdd
3
+ metadata.gz: 438dcb9a5e21879ac0078d2a16a33424936a998bf89abb80aafb5948581de805
4
+ data.tar.gz: a3297755e16825869ab659f288d4b6ffe5dfbca5161880aecd103b106af7c68b
5
5
  SHA512:
6
- metadata.gz: 9f9e443254d7a5e73bbd4cc63b8824c4ffcf620fc60245df34807994bba1f27a9688c0262b0848783f49553d395822474770b2a7f2d3f6ad96eef70ca498fb14
7
- data.tar.gz: 8df0d98d2b44d2ed10a7b626b7946dd05254c49e69b5459e4c6dcc83da4bd8896ae3c92b28be46dcee128dd6b6593d556b1509646d5944e3060bb8dcd01a643b
6
+ metadata.gz: 7aa94440e9614e45bf317092481309c70751bcbc35e73ffa5eb2b75717ed77792186520c61f5cb6bc78bd42906ef297e034ae12e4dfc29d05c08adb6fc4f8d67
7
+ data.tar.gz: 562391c9009fe1fdfc82cd6319b3a081202824bf6cd66363f1136548f880c5f652a18e090ceb3d49b9e0d1f92cee0b4fded2e6352fdca29d8012360832eb4571
data/README.md CHANGED
@@ -19,51 +19,40 @@ client = Verica.wrap_openai(OpenAI::Client.new)
19
19
  # use `client` exactly like the original; chat completions are traced.
20
20
  ```
21
21
 
22
- ## Use (community `ruby-openai` gem, alexrudall)
22
+ ## Use (`ruby-openai` gem: OpenAI, Gemini, Anthropic)
23
23
 
24
- The community [`ruby-openai`](https://github.com/alexrudall/ruby-openai) gem has
25
- a different API than the official gem: `client.chat(parameters: { ... })`
26
- returning a plain Hash. It gets its own wrapper.
24
+ The community [`ruby-openai`](https://github.com/alexrudall/ruby-openai) gem uses
25
+ `client.chat(parameters: { ... })` and returns a plain Hash. Wrap it with
26
+ `wrap_openai_compatible`: the provider is inferred from the model (`gpt-*` →
27
+ openai, `gemini-*` → google, `claude-*` → anthropic), so one wrapper traces
28
+ OpenAI plus Gemini and Anthropic via their OpenAI-compatible endpoints.
27
29
 
28
30
  ```ruby
29
31
  require 'verica'
30
-
31
32
  Verica.init(token: ENV['VERICA_TOKEN'])
32
- client = Verica.wrap_ruby_openai(OpenAI::Client.new)
33
-
34
- client.chat(parameters: {
35
- model: 'gpt-4o-mini',
36
- messages: [{ role: 'user', content: 'Hello!' }]
37
- })
38
- ```
39
-
40
- Streaming calls (a `stream:` proc in `parameters`) pass through untouched and
41
- are traced with request-side attributes only (the streamed response is not a
42
- stable Hash to read the model or usage from).
43
33
 
44
- Use `wrap_openai` for the official `openai` gem and `wrap_ruby_openai` for
45
- `ruby-openai`. The two gems' APIs are not interchangeable, so neither are the
46
- wrappers.
34
+ # OpenAI
35
+ openai = Verica.wrap_openai_compatible(OpenAI::Client.new(access_token: ENV['OPENAI_API_KEY']))
36
+ openai.chat(parameters: { model: 'gpt-4o-mini', messages: [{ role: 'user', content: 'Hello!' }] })
47
37
 
48
- ## Use Gemini or Anthropic (OpenAI-compatible endpoints)
49
-
50
- Both providers expose OpenAI-compatible endpoints, so the same wrapper traces
51
- them too. Use `wrap_openai_compatible` (the `ruby-openai` shape) and point the
52
- client at the provider's endpoint; the provider label is inferred from the model
53
- name (`gemini-*` → google, `claude-*` → anthropic).
54
-
55
- ```ruby
56
- # Gemini
57
- gemini = OpenAI::Client.new(
38
+ # Gemini (OpenAI-compatible endpoint)
39
+ gemini = Verica.wrap_openai_compatible(OpenAI::Client.new(
58
40
  access_token: ENV['GEMINI_API_KEY'],
59
41
  uri_base: 'https://generativelanguage.googleapis.com/v1beta/openai/'
60
- )
61
- client = Verica.wrap_openai_compatible(gemini)
62
- client.chat(parameters: { model: 'gemini-2.5-flash', messages: [...] })
42
+ ))
43
+ gemini.chat(parameters: { model: 'gemini-2.5-flash', messages: [...] })
44
+
45
+ # Anthropic (OpenAI-compatible endpoint)
46
+ anthropic = Verica.wrap_openai_compatible(OpenAI::Client.new(
47
+ access_token: ENV['ANTHROPIC_API_KEY'],
48
+ uri_base: 'https://api.anthropic.com/v1/'
49
+ ))
50
+ anthropic.chat(parameters: { model: 'claude-sonnet-4', messages: [...] })
63
51
  ```
64
52
 
65
- `wrap_ruby_openai` is a back-compat alias of `wrap_openai_compatible`; both
66
- behave identically.
53
+ `wrap_ruby_openai` is a back-compat alias of `wrap_openai_compatible`. Streaming
54
+ calls (a `stream:` proc) pass through with request-side attributes only. Ruby has
55
+ no native Gemini/Anthropic gem support; use the OpenAI-compatible endpoints above.
67
56
 
68
57
  ## Use (RubyLLM)
69
58
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Verica
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: verica-observability
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Verica