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 +4 -4
- data/CHANGELOG.md +5 -1
- data/lib/ox-ai-workers.rb +2 -1
- data/lib/oxaiworkers/delayed_request.rb +2 -2
- data/lib/oxaiworkers/module_request.rb +4 -3
- data/lib/oxaiworkers/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7158485603265249cd23284ad0bf2a34bade8f576809b871f87eb82004f14e03
|
4
|
+
data.tar.gz: 808b5910cfcc23ace8d3445af45a63911da8092aedb12af4ac2ff4e1145976b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a061cdf90b55bf7fab3af6819d6c1a4cab0454e23436186dcca88c5f4ebc85c0d8bcae59953572bb0ae680281d8583a8ae6ce907d782269040c3be528fbbac8
|
7
|
+
data.tar.gz: 7af5980209650840f0e623a60225c00d4c06d0b761469d89606ffde2606406669b1d05204300bd0d48468cd30febfd3dc5ca348f10f661d05f61cd47054861ec
|
data/CHANGELOG.md
CHANGED
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
|
data/lib/oxaiworkers/version.rb
CHANGED
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.
|
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-
|
10
|
+
date: 2025-03-24 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: colorize
|