File tree Expand file tree Collapse file tree 5 files changed +16
-6
lines changed
src/foobara/ai/answer_bot/domain_mappers/open_ai_api Expand file tree Collapse file tree 5 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 1+ ## [ 0.0.14] - 2025-07-05
2+
3+ - o1 models don't support temperature so force it to 1
4+
15## [ 0.0.13] - 2025-06-27
26
37- Add GenerateChatCompletion command
Original file line number Diff line number Diff line change 11PATH
22 remote: .
33 specs:
4- foobara-ai (0.0.13 )
4+ foobara-ai (0.0.14 )
55
66GEM
77 remote: https://rubygems.org/
5555 foobara-type-generator (~> 0.0.1 )
5656 foobara-typescript-react-command-form-generator (~> 0.0.1 )
5757 foobara-typescript-remote-command-generator (~> 0.0.1 )
58- foobara (0.0.134 )
58+ foobara (0.0.135 )
5959 bigdecimal
6060 foobara-lru-cache (~> 0.0.2 )
6161 foobara-util (>= 1.0.0 )
194194 rb-fsevent (0.11.2 )
195195 rb-inotify (0.11.1 )
196196 ffi (~> 1.0 )
197- rdoc (6.14.1 )
197+ rdoc (6.14.2 )
198198 erb
199199 psych (>= 4.0.0 )
200200 regexp_parser (2.10.0 )
Original file line number Diff line number Diff line change 5050 context "when using anthropic" do
5151 let ( :model ) { "claude-3-5-sonnet-20241022" }
5252
53- it "is successful" , vcr : { record : :once } do
53+ it "is successful" , vcr : { record : :none } do
5454 expect ( outcome ) . to be_success
5555 expect ( result . content ) . to match ( /vinegar/i )
5656 end
Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ def map
2121 }
2222
2323 if temperature
24- inputs [ :temperature ] = temperature
24+ # NOTE: some models don't support temperature, like o1. Instead of possibly receiving an error
25+ # we will set the temperature to 1 which prevents a 400. Maybe print a warning instead?
26+ inputs [ :temperature ] = model_supports_temperature? ? temperature : 1
2527 end
2628
2729 if model
@@ -42,6 +44,10 @@ def temperature
4244 def model
4345 from [ :model ]
4446 end
47+
48+ def model_supports_temperature?
49+ model && model . to_s !~ /\A o1(-|$)/
50+ end
4551 end
4652 end
4753 end
Original file line number Diff line number Diff line change 11module Foobara
22 module Ai
3- VERSION = "0.0.13 " . freeze
3+ VERSION = "0.0.14 " . freeze
44 MINIMUM_RUBY_VERSION = ">= 3.4.0" . freeze
55 end
66end
You can’t perform that action at this time.
0 commit comments