omniai-anthropic 2.6.1 → 2.6.3

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: 6477e1a35487309aea8f5519404b3c57728c0f364540457b4a42ff57177a512c
4
- data.tar.gz: '08c8b7ef247d02bf76a4163263887184780532a2eff4004fa967e239b6423e30'
3
+ metadata.gz: d649f48ca88feb9f8e50084e23056018b8c4686a0d75fd0191acceefc60e32fa
4
+ data.tar.gz: e00ff5518435b57a3a2b77cde19a9632f9a8bd620377a2a37c3ebfe77b036148
5
5
  SHA512:
6
- metadata.gz: 915a999c0920b8ab61343585d38c3f5da0a0fbf600f53be5c480e70910ee9a3c80f5768d9c7acdae8bbaa9d118b90bb0c966c2c3b93a97dfd384986bac65e7c4
7
- data.tar.gz: f1f7923e41f51af5c0ff1e37319a5da2f1c945c33f6c2bb387936a0cc82a449ff49f46c9a5a8b4f23f886ab913b0b5c4dd3c54b96f4f78dc747e5c0dbe18fa27
6
+ metadata.gz: 0e501003829f8f263daf8736feedde7697f21c3eb93b046f61255643e6a77bc96006532b232e2f7707041d962d3e2ac87125fd618680ec3ba6908dc86d521326
7
+ data.tar.gz: 3bfba26cfdf4e8cc90ce1d9446aac5e61f9d9e23b7ede7bd3ea1d47c898ead9772c2f5ade6a9eaf21b469c5ab94f464f37e13b6ddc178281513f8cd29c74ff41
data/README.md CHANGED
@@ -6,7 +6,8 @@
6
6
  [![Yard](https://img.shields.io/badge/docs-site-blue.svg)](https://omniai-anthropic.ksylvest.com)
7
7
  [![CircleCI](https://img.shields.io/circleci/build/github/ksylvest/omniai-anthropic)](https://circleci.com/gh/ksylvest/omniai-anthropic)
8
8
 
9
- An Anthropic implementation of the [OmniAI](https://github.com/ksylvest/omniai) APIs.
9
+ An Anthropic implementation of the [OmniAI](https://github.com/ksylvest/omniai)
10
+ APIs.
10
11
 
11
12
  ## Installation
12
13
 
@@ -42,7 +43,8 @@ end
42
43
 
43
44
  ### Chat
44
45
 
45
- A chat completion is generated by passing in prompts using any a variety of formats:
46
+ A chat completion is generated by passing in prompts using any a variety of
47
+ formats:
46
48
 
47
49
  ```ruby
48
50
  completion = client.chat('Tell me a joke!')
@@ -70,7 +72,8 @@ completion.text # 'def fibonacci(n)...end'
70
72
 
71
73
  #### Temperature
72
74
 
73
- `temperature` takes an optional float between `0.0` and `1.0` (defaults is `0.7`):
75
+ `temperature` takes an optional float between `0.0` and `1.0` (defaults is
76
+ `0.7`):
74
77
 
75
78
  ```ruby
76
79
  completion = client.chat('Pick a number between 1 and 5', temperature: 1.0)
@@ -81,7 +84,8 @@ completion.text # '3'
81
84
 
82
85
  #### Stream
83
86
 
84
- `stream` takes an optional a proc to stream responses in real-time chunks instead of waiting for a complete response:
87
+ `stream` takes an optional a proc to stream responses in real-time chunks
88
+ instead of waiting for a complete response:
85
89
 
86
90
  ```ruby
87
91
  stream = proc do |chunk|
@@ -94,7 +98,8 @@ client.chat('Be poetic.', stream:)
94
98
 
95
99
  #### Format
96
100
 
97
- `format` takes an optional symbol (`:json`) and modifies requests to send additional system text requesting JSON:
101
+ `format` takes an optional symbol (`:json`) and modifies requests to send
102
+ additional system text requesting JSON:
98
103
 
99
104
  ```ruby
100
105
  completion = client.chat(format: :json) do |prompt|
@@ -150,6 +150,7 @@ module OmniAI
150
150
  content = @data["content"][index]
151
151
 
152
152
  return unless content["partial_json"]
153
+ return if content["partial_json"].empty?
153
154
 
154
155
  content["input"] = JSON.parse(content["partial_json"])
155
156
  content.delete("partial_json")
@@ -31,14 +31,19 @@ module OmniAI
31
31
  CLAUDE_3_5_SONNET_LATEST = "claude-3-5-sonnet-latest"
32
32
  CLAUDE_3_7_SONNET_LATEST = "claude-3-7-sonnet-latest"
33
33
 
34
- CLAUDE_SONNET_4_20250514 = "claude-sonnet-4-20250514"
35
34
  CLAUDE_OPUS_4_20250514 = "claude-opus-4-20250514"
35
+ CLAUDE_OPUS_4_1_20250805 = "claude-opus-4-1-20250805"
36
+ CLAUDE_SONNET_4_20250514 = "claude-sonnet-4-20250514"
37
+ CLAUDE_SONNET_4_5_20240620 = "claude-sonnet-4-5-20250929"
38
+
36
39
  CLAUDE_OPUS_4_0 = "claude-opus-4-0"
40
+ CLAUDE_OPUS_4_1 = "claude-opus-4-1"
37
41
  CLAUDE_SONNET_4_0 = "claude-sonnet-4-0"
42
+ CLAUDE_SONNET_4_5 = "claude-sonnet-4-5"
38
43
 
39
44
  CLAUDE_HAIKU = CLAUDE_3_5_HAIKU_LATEST
40
- CLAUDE_OPUS = CLAUDE_OPUS_4_0
41
- CLAUDE_SONNET = CLAUDE_SONNET_4_0
45
+ CLAUDE_OPUS = CLAUDE_OPUS_4_1
46
+ CLAUDE_SONNET = CLAUDE_SONNET_4_5
42
47
  end
43
48
 
44
49
  DEFAULT_MODEL = Model::CLAUDE_SONNET
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAI
4
4
  module Anthropic
5
- VERSION = "2.6.1"
5
+ VERSION = "2.6.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniai-anthropic
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-05-22 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: event_stream_parser
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  - !ruby/object:Gem::Version
100
100
  version: '0'
101
101
  requirements: []
102
- rubygems_version: 3.6.3
102
+ rubygems_version: 3.7.2
103
103
  specification_version: 4
104
104
  summary: A generalized framework for interacting with Anthropic
105
105
  test_files: []