ox-ai-workers 0.7.7 → 0.7.8

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: 3e8827f2d82f6cd8b30ffe30ac1a05328a6e538c083b81efe4a89a2577930e61
4
+ data.tar.gz: b467e41770580bd77031e41c8f2ebbe4c30fb775e97e29661121fbcfb7975e18
5
5
  SHA512:
6
- metadata.gz: 246d70800e6acd674c0b589582bde5348365f8cee1cd98829bcf05aec06020921ca944a7650a1c0c0738cf297bda6da55e31907a7af7327dd139a13c5cc13609
7
- data.tar.gz: 65d19033506f0f84e099b8523ca99727db289ae1ffb0de984e1fe1dd099d2c8381121ef9d38f64744c47ba21463d6d1da55d3aa79f30b93f55801d7694b8547e
6
+ metadata.gz: e77f6e306fa76c283a672b2e44dab012c825a97472fa95a08f76ae47969d321c72c0c9399a3993087bb7941b3da84ff78e0926467db3412ef6765f5be1d18295
7
+ data.tar.gz: 4ecad4f807f605dfecb8ef36e6a24437c2046524bbc064bd7479789ddbf47bf95512a4cbfd555c5e9b5d6936aa5baeca931ba086fe9a91c94f9e8795959b0bc5
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- ## [0.7.7] - 2025-03-22
1
+ ## [0.7.8] - 2025-03-22
2
2
 
3
3
  - Added support for alternative model providers
4
4
 
@@ -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.8'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
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.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Smolev