ox-ai-workers 0.7.7 → 0.7.9

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: bdf58d7a27a42a83b6e694d25ea746fd60ae55d998d2efd9d049dd4b29c4bc98
4
- data.tar.gz: a6fef1e9c57d1adc0497b15d913e99bc157aa2af34ab4d147f805f9a6b9aa982
3
+ metadata.gz: 7158485603265249cd23284ad0bf2a34bade8f576809b871f87eb82004f14e03
4
+ data.tar.gz: 808b5910cfcc23ace8d3445af45a63911da8092aedb12af4ac2ff4e1145976b6
5
5
  SHA512:
6
- metadata.gz: 246d70800e6acd674c0b589582bde5348365f8cee1cd98829bcf05aec06020921ca944a7650a1c0c0738cf297bda6da55e31907a7af7327dd139a13c5cc13609
7
- data.tar.gz: 65d19033506f0f84e099b8523ca99727db289ae1ffb0de984e1fe1dd099d2c8381121ef9d38f64744c47ba21463d6d1da55d3aa79f30b93f55801d7694b8547e
6
+ metadata.gz: 1a061cdf90b55bf7fab3af6819d6c1a4cab0454e23436186dcca88c5f4ebc85c0d8bcae59953572bb0ae680281d8583a8ae6ce907d782269040c3be528fbbac8
7
+ data.tar.gz: 7af5980209650840f0e623a60225c00d4c06d0b761469d89606ffde2606406669b1d05204300bd0d48468cd30febfd3dc5ca348f10f661d05f61cd47054861ec
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ## [0.7.7] - 2025-03-22
1
+ ## [0.7.9] - 2025-03-24
2
+
3
+ - Added `uri_base` for configuration
4
+
5
+ ## [0.7.8] - 2025-03-22
2
6
 
3
7
  - Added support for alternative model providers
4
8
 
data/lib/ox-ai-workers.rb CHANGED
@@ -42,7 +42,7 @@ module OxAiWorkers
42
42
  class ConfigurationError < Error; end
43
43
 
44
44
  class Configuration
45
- attr_accessor :model, :max_tokens, :temperature, :access_token, :auto_execute, :wait_for_complete
45
+ attr_accessor :model, :max_tokens, :temperature, :access_token, :auto_execute, :wait_for_complete, :uri_base
46
46
 
47
47
  def initialize
48
48
  @access_token = nil
@@ -51,6 +51,7 @@ module OxAiWorkers
51
51
  @temperature = DEFAULT_TEMPERATURE
52
52
  @auto_execute = true
53
53
  @wait_for_complete = true
54
+ @uri_base = nil
54
55
 
55
56
  [Array, NilClass, String, Symbol, Hash].each do |c|
56
57
  c.send(:include, OxAiWorkers::PresentCompat) unless c.method_defined?(:present?)
@@ -2,8 +2,8 @@
2
2
 
3
3
  module OxAiWorkers
4
4
  class DelayedRequest < OxAiWorkers::StateBatch
5
- def initialize(batch_id: nil, model: nil, max_tokens: nil, temperature: nil)
6
- initialize_requests(model:, max_tokens:, temperature:)
5
+ def initialize(batch_id: nil, model: nil, max_tokens: nil, temperature: nil, uri_base: nil)
6
+ initialize_requests(model:, max_tokens:, temperature:, uri_base:)
7
7
  @custom_id = nil if batch_id.present?
8
8
  @batch_id = batch_id
9
9
  @file_id = nil
@@ -3,13 +3,14 @@
3
3
  module OxAiWorkers
4
4
  class ModuleRequest
5
5
  attr_accessor :result, :client, :messages, :model, :max_tokens, :custom_id, :temperature, :tools, :errors,
6
- :tool_calls_raw, :tool_calls, :is_truncated, :finish_reason
6
+ :tool_calls_raw, :tool_calls, :is_truncated, :finish_reason, :uri_base
7
7
 
8
- def initialize_requests(model: nil, max_tokens: nil, temperature: nil)
8
+ def initialize_requests(model: nil, max_tokens: nil, temperature: nil, uri_base: nil)
9
9
  @max_tokens = max_tokens || OxAiWorkers.configuration.max_tokens
10
10
  @custom_id = SecureRandom.uuid
11
11
  @model = model || OxAiWorkers.configuration.model
12
12
  @temperature = temperature || OxAiWorkers.configuration.temperature
13
+ @uri_base = uri_base
13
14
  @client = nil
14
15
  @is_truncated = false
15
16
  @finish_reason = nil
@@ -26,7 +27,7 @@ module OxAiWorkers
26
27
  def cleanup
27
28
  @client ||= OpenAI::Client.new(
28
29
  access_token: OxAiWorkers.configuration.access_token,
29
- uri_base: OxAiWorkers.configuration.uri_base,
30
+ uri_base: @uri_base || OxAiWorkers.configuration.uri_base,
30
31
  log_errors: true # Highly recommended in development, so you can see what errors OpenAI is returning. Not recommended in production because it could leak private data to your logs.
31
32
  )
32
33
  @result = nil
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OxAiWorkers
4
- VERSION = '0.7.7'
4
+ VERSION = '0.7.9'
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ox-ai-workers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.7
4
+ version: 0.7.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Smolev
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-22 00:00:00.000000000 Z
10
+ date: 2025-03-24 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: colorize