gpt-function 0.7.0 → 0.8.1
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/lib/gpt-function.rb +3 -1
- data/lib/gpt_function/batch.rb +1 -1
- data/lib/gpt_function/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c4411299ea4a2b86fc42ba1d11fb73d803b346a73de2245298e5699024de470
|
4
|
+
data.tar.gz: 9c40d365a494bd517487ef2aab583dc358b6ad466d8924111f8c556ac0cb9bc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 416d168b50e81d1ff088d17512d00a066179a3a1a480144e710e4ce4766c6b6d646d4937ddd916bf679ed1e673ffcb1d5250b2e74bfd24bb3742d78e8705cd6a
|
7
|
+
data.tar.gz: fb618cff5345ce48e0858d0bec571038a1663b714577271a411512141c341126bf357989e29c4c9d1c47f0e58db489992bfbdf8e10c8dea18e2efd998f7401f9
|
data/lib/gpt-function.rb
CHANGED
@@ -53,8 +53,10 @@ class GptFunction
|
|
53
53
|
response = send_request(input)
|
54
54
|
body = response.body.force_encoding("UTF-8")
|
55
55
|
json = JSON.parse(body)
|
56
|
+
|
56
57
|
# 處理可能的錯誤回應
|
57
|
-
|
58
|
+
error_message = json.dig("error", "message")
|
59
|
+
raise StandardError, error_message unless error_message.nil?
|
58
60
|
|
59
61
|
# 處理正常的回應
|
60
62
|
JSON.parse(json.dig("choices", 0, "message", "content"))["output"]
|
data/lib/gpt_function/batch.rb
CHANGED
@@ -296,7 +296,7 @@ class GptFunction
|
|
296
296
|
yield batch
|
297
297
|
|
298
298
|
# 如果 batch 還未處理完成,將批次請求重新加入 Storage
|
299
|
-
if batch.is_processed && auto_delete
|
299
|
+
if batch.is_processed && batch.auto_delete
|
300
300
|
batch&.input_file&.delete rescue nil
|
301
301
|
batch&.output_file&.delete rescue nil
|
302
302
|
batch&.error_file&.delete rescue nil
|
data/lib/gpt_function/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gpt-function
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- etrex kuo
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-10 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: dotenv
|
@@ -54,7 +53,6 @@ licenses:
|
|
54
53
|
metadata:
|
55
54
|
homepage_uri: https://github.com/etrex/gpt-function
|
56
55
|
source_code_uri: https://github.com/etrex/gpt-function
|
57
|
-
post_install_message:
|
58
56
|
rdoc_options: []
|
59
57
|
require_paths:
|
60
58
|
- lib
|
@@ -69,8 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
67
|
- !ruby/object:Gem::Version
|
70
68
|
version: '0'
|
71
69
|
requirements: []
|
72
|
-
rubygems_version: 3.
|
73
|
-
signing_key:
|
70
|
+
rubygems_version: 3.6.2
|
74
71
|
specification_version: 4
|
75
72
|
summary: A Ruby gem for creating simple GPT-based functions.
|
76
73
|
test_files: []
|