foobara-open-ai-api 1.0.1 → 1.0.2
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 +4 -0
- data/src/foobara/ai/open_ai_api/base_command.rb +4 -4
- data/src/foobara/ai/open_ai_api/create_chat_completion.rb +5 -1
- data/src/foobara/ai/open_ai_api/list_models.rb +7 -1
- data/src/foobara/ai/open_ai_api/types/chat_completion/message.rb +3 -0
- data/src/foobara/ai/open_ai_api/types/model.rb +1 -0
- metadata +29 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d9ce992ca9831d7c5a53ef2b1f6a493b2186f88c731f659ead14cb4e794b131c
|
|
4
|
+
data.tar.gz: 0cb85c628ceeacf88c3bfb07b2451b0db7fec1aa00acf6ab9820a917dde03094
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d7fe4a147de16a1fd6e3af6177310880ad5708327d1fa1d5a344b430ea9a7022c9fa55beb7d3708d9720b6e9afb5bb4c6a421023624819a37b62ced2e552cd2d
|
|
7
|
+
data.tar.gz: 6ff89ad55ce0a3c93ae3b053cfeee90e644c8e605832339754110f2a13d277d9763a04b9feb9cb7446dd20f630cfebffdb54629c7473cfa08c97a6abf8375dee
|
data/CHANGELOG.md
CHANGED
|
@@ -35,17 +35,17 @@ module Foobara
|
|
|
35
35
|
|
|
36
36
|
case response.code
|
|
37
37
|
when "429"
|
|
38
|
-
# :
|
|
38
|
+
# simplecov:disable
|
|
39
39
|
sleep 2 ** failures
|
|
40
40
|
issue_http_request(failures + 1)
|
|
41
|
-
# :
|
|
41
|
+
# simplecov:enable
|
|
42
42
|
when "529"
|
|
43
43
|
# Do these even happen with openai? or only anthropic?
|
|
44
|
-
# :
|
|
44
|
+
# simplecov:disable
|
|
45
45
|
failures += 1
|
|
46
46
|
sleep failures
|
|
47
47
|
issue_http_request(failures)
|
|
48
|
-
# :
|
|
48
|
+
# simplecov:enable
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
end
|
|
@@ -23,7 +23,11 @@ module Foobara
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def build_result
|
|
26
|
-
Types::ChatCompletion.new(
|
|
26
|
+
Types::ChatCompletion.new(
|
|
27
|
+
response_body,
|
|
28
|
+
# Set to false and run test suite with new cassettes if trying to find new attributes
|
|
29
|
+
ignore_unexpected_attributes: true
|
|
30
|
+
)
|
|
27
31
|
end
|
|
28
32
|
end
|
|
29
33
|
end
|
|
@@ -15,7 +15,13 @@ module Foobara
|
|
|
15
15
|
result [Types::Model]
|
|
16
16
|
|
|
17
17
|
def build_result
|
|
18
|
-
response_body["data"]
|
|
18
|
+
response_body["data"].map do |model_attributes|
|
|
19
|
+
Types::Model.new(
|
|
20
|
+
model_attributes,
|
|
21
|
+
# Set to false and run test suite with new cassettes if trying to find new attributes
|
|
22
|
+
ignore_unexpected_attributes: true
|
|
23
|
+
)
|
|
24
|
+
end
|
|
19
25
|
end
|
|
20
26
|
end
|
|
21
27
|
end
|
|
@@ -8,6 +8,9 @@ module Foobara
|
|
|
8
8
|
role :string, one_of: ["assistant", "user", "system"]
|
|
9
9
|
content :string
|
|
10
10
|
refusal :string, :allow_nil
|
|
11
|
+
# TODO: Figure out what type this really is. Maybe an array of some Annotation model.
|
|
12
|
+
# TODO: also, see if it can be null (probably not)
|
|
13
|
+
annotations :duckture, :allow_nil
|
|
11
14
|
end
|
|
12
15
|
end
|
|
13
16
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foobara-open-ai-api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Miles Georgi
|
|
@@ -10,33 +10,53 @@ cert_chain: []
|
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
|
-
name: foobara
|
|
13
|
+
name: foobara
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version:
|
|
18
|
+
version: 0.6.4
|
|
19
|
+
- - "<"
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: 2.0.0
|
|
19
22
|
type: :runtime
|
|
20
23
|
prerelease: false
|
|
21
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
25
|
requirements:
|
|
23
26
|
- - ">="
|
|
24
27
|
- !ruby/object:Gem::Version
|
|
25
|
-
version:
|
|
28
|
+
version: 0.6.4
|
|
29
|
+
- - "<"
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: 2.0.0
|
|
32
|
+
- !ruby/object:Gem::Dependency
|
|
33
|
+
name: foobara-cached-command
|
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - "<"
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: 2.0.0
|
|
39
|
+
type: :runtime
|
|
40
|
+
prerelease: false
|
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
42
|
+
requirements:
|
|
43
|
+
- - "<"
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: 2.0.0
|
|
26
46
|
- !ruby/object:Gem::Dependency
|
|
27
47
|
name: foobara-http-api-command
|
|
28
48
|
requirement: !ruby/object:Gem::Requirement
|
|
29
49
|
requirements:
|
|
30
|
-
- - "
|
|
50
|
+
- - "<"
|
|
31
51
|
- !ruby/object:Gem::Version
|
|
32
|
-
version:
|
|
52
|
+
version: 2.0.0
|
|
33
53
|
type: :runtime
|
|
34
54
|
prerelease: false
|
|
35
55
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
56
|
requirements:
|
|
37
|
-
- - "
|
|
57
|
+
- - "<"
|
|
38
58
|
- !ruby/object:Gem::Version
|
|
39
|
-
version:
|
|
59
|
+
version: 2.0.0
|
|
40
60
|
email:
|
|
41
61
|
- azimux@gmail.com
|
|
42
62
|
executables: []
|
|
@@ -83,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
83
103
|
- !ruby/object:Gem::Version
|
|
84
104
|
version: '0'
|
|
85
105
|
requirements: []
|
|
86
|
-
rubygems_version:
|
|
106
|
+
rubygems_version: 4.0.20
|
|
87
107
|
specification_version: 4
|
|
88
108
|
summary: Foobara commands and models for OpenAI's API
|
|
89
109
|
test_files: []
|