ai-chat 0.7.0 → 0.8.0

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 (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -7
  3. data/ai-chat.gemspec +1 -1
  4. data/lib/ai/chat.rb +5 -5
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc2941185cac34d62d83233dd4e680fe84e5260cd4444ab168207c1b14064d9b
4
- data.tar.gz: 7aa8e27049a66787cd49319d45421b8a82bb5a44fe622a1878c0e045ff341373
3
+ metadata.gz: 177299f56fc875c484f3b0552e93858c3f8da072ded5b81a67d891d9b7f7df3e
4
+ data.tar.gz: c31a180346f098d9c70fc135bdd6556ae12d23f4a85a5618a1907a8f660c0996
5
5
  SHA512:
6
- metadata.gz: 5fa4dc0c4a18a484e676c7b14f1de69fd6d4c814f6bc4be5f1c91fcb56294b90f324a890e8c2f954bf2fe4528f75328c5a0c4b5e8dec8fb8ed94a5f20446a276
7
- data.tar.gz: ade82f46956897d29530401ddc604977bab731e6c0714e4904d1cae4d7e853b6ad23a0a5eef4dbeca2b2ea4fd3e690aacb1bde0812e27a67cfb08504dc3f5000
6
+ metadata.gz: a4adf79c5e126ee642511bd8a8d2fdbab92fef5d9a596cae6a416bed82861764c61ed80f17f5762e879dae4e8c604475e9c7f5bf82c70224b9bdc60552b936ad
7
+ data.tar.gz: ca02e9d88b13569899ce3787159862b8f55d2c822e54d41851f43b7a94d22a35bf25794e6dbff25e71d04dc6cdf0d4da6b74c53b9b40476d68d42d8645a97268
data/README.md CHANGED
@@ -56,7 +56,7 @@ ap response
56
56
  # => {
57
57
  # :role => "assistant",
58
58
  # :content => "Matz is nice and so we are nice.",
59
- # :response => { id: "resp_abc...", model: "gpt-5.6-terra", ... }
59
+ # :response => { id: "resp_abc...", model: "gpt-6-luna", ... }
60
60
  # }
61
61
 
62
62
  ap chat.messages
@@ -68,7 +68,7 @@ ap chat.messages
68
68
  # {
69
69
  # :role => "assistant",
70
70
  # :content => "Matz is nice and so we are nice.",
71
- # :response => { id: "resp_abc...", model: "gpt-5.6-terra", ... }
71
+ # :response => { id: "resp_abc...", model: "gpt-6-luna", ... }
72
72
  # }
73
73
  # ]
74
74
  ```
@@ -131,11 +131,11 @@ chat.add("Here's what I think...", role: "assistant")
131
131
 
132
132
  ### Model
133
133
 
134
- The gem defaults to `gpt-5.6-terra`. You can change it:
134
+ The gem defaults to `gpt-6-luna`. You can change it:
135
135
 
136
136
  ```ruby
137
137
  chat = AI::Chat.new
138
- chat.model = "gpt-5.6-luna"
138
+ chat.model = "gpt-6.1-sol"
139
139
  ```
140
140
 
141
141
  ### API Key
@@ -409,9 +409,9 @@ chat.user("Explain the tradeoffs between microservices and monoliths.")
409
409
  chat.generate!
410
410
  ```
411
411
 
412
- By default, `reasoning_effort` is `"none"`, so the model answers directly without spending reasoning tokens. This matters because GPT-5.5 and newer models (including the default `gpt-5.6-terra`) fall back to `"medium"` reasoning when the parameter is omitted, which is slower and more expensive.
412
+ By default, `reasoning_effort` is `"low"`, so the model does a little reasoning before it answers. `"low"` is accepted by all of OpenAI's current flagship models (`gpt-6-luna`, `gpt-6.1-sol`, and `gpt-6-astra`), while some of them reject `"none"`, so you can switch models without also changing the effort. The gem always sends an effort because GPT-5.5 and newer models fall back to `"medium"` when the parameter is omitted, which is slower and more expensive.
413
413
 
414
- Set `reasoning_effort = nil` to omit the reasoning parameter entirely — you will need this if you switch to a model that does not support reasoning (e.g., `gpt-4o`) or one that predates the `"none"` option.
414
+ Set `reasoning_effort = "none"` for the fastest replies on models that support it (such as `gpt-6-luna`). Set `reasoning_effort = nil` to omit the reasoning parameter entirely — you will need this if you switch to a model that does not support reasoning (e.g., `gpt-4o`).
415
415
 
416
416
  ### Verbosity
417
417
 
@@ -476,7 +476,7 @@ chat.generate!
476
476
 
477
477
  response = chat.last[:response]
478
478
  response[:id] # => "resp_abc123..."
479
- response[:model] # => "gpt-5.6-terra"
479
+ response[:model] # => "gpt-6-luna"
480
480
  response[:usage] # => { input_tokens: 5, output_tokens: 7, total_tokens: 12 }
481
481
  ```
482
482
 
data/ai-chat.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "ai-chat"
5
- spec.version = "0.7.0"
5
+ spec.version = "0.8.0"
6
6
  spec.authors = ["Raghu Betina", "Jelani Woods"]
7
7
  spec.email = ["raghu@firstdraft.com", "jelani@firstdraft.com"]
8
8
  spec.homepage = "https://github.com/firstdraft/ai-chat"
data/lib/ai/chat.rb CHANGED
@@ -32,8 +32,8 @@ module AI
32
32
  @proxy = proxy.nil? ? ENV[PROXY_ENV]&.downcase == "true" : !!proxy
33
33
  @api_key = resolve_api_key
34
34
  @messages = []
35
- @reasoning_effort = "none"
36
- @model = "gpt-5.6-terra"
35
+ @reasoning_effort = "low"
36
+ @model = "gpt-6-luna"
37
37
  client_options = {api_key: @api_key}
38
38
  client_options[:base_url] = BASE_PROXY_URL if @proxy
39
39
  @client = OpenAI::Client.new(**client_options)
@@ -46,7 +46,7 @@ module AI
46
46
 
47
47
  def self.generate_schema!(description, location: "schema.json", api_key: nil, api_key_env_var: nil, proxy: nil)
48
48
  proxy = proxy.nil? ? ENV[PROXY_ENV]&.downcase == "true" : !!proxy
49
- api_key = api_key || ENV.fetch(api_key_env_var || (proxy ? PROXY_KEY_ENV : OPENAI_KEY_ENV))
49
+ api_key ||= ENV.fetch(api_key_env_var || (proxy ? PROXY_KEY_ENV : OPENAI_KEY_ENV))
50
50
  prompt_path = File.expand_path("../prompts/schema_generator.md", __dir__)
51
51
  system_prompt = File.read(prompt_path)
52
52
 
@@ -57,7 +57,7 @@ module AI
57
57
 
58
58
  client = OpenAI::Client.new(**options)
59
59
  response = client.responses.create(
60
- model: "gpt-5.6-terra",
60
+ model: "gpt-6-luna",
61
61
  input: [
62
62
  {role: :system, content: system_prompt},
63
63
  {role: :user, content: description}
@@ -175,7 +175,7 @@ module AI
175
175
  @api_key = new_key
176
176
  @api_key_validated = false
177
177
  @client = new_client
178
- rescue => error
178
+ rescue
179
179
  @proxy = previous_proxy
180
180
  raise
181
181
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ai-chat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raghu Betina
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  - !ruby/object:Gem::Version
157
157
  version: '0'
158
158
  requirements: []
159
- rubygems_version: 3.6.9
159
+ rubygems_version: 4.0.3
160
160
  specification_version: 4
161
161
  summary: A beginner-friendly Ruby interface for OpenAI's API
162
162
  test_files: []