foobara-open-ai-api 0.0.9 → 0.0.10

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: 5e6cb9bdbfee03bc629c3c4b2641363f846dec53e14317860cda02c7be0faa22
4
- data.tar.gz: 60f99581e848a20defcbfbc5f9ba5b01fa4b30a61a49bb8399c557eb8cfd2921
3
+ metadata.gz: c561a0e79f029a99ffad41fe5c090ddfab2c7e008c7fd0f16b6d21e4d7901085
4
+ data.tar.gz: 284fdd95baef9a2bdbd33fd89aeed1dc1644017a93d36e5045ce17cb58c471f6
5
5
  SHA512:
6
- metadata.gz: f79050ea578166386b43af65ed4efe7249e92aba4d3c87eced62d5e8859a65634c2e852fd18a304fccfd8d904a4a7a40d7c4a092ab030b89fe9c7cd0c684cb2f
7
- data.tar.gz: 3ae087e54109610caa2ce6d065d8658587b751612bf7ddc26e0a7b00b4f69a4ce5db72b1a85073979ca2f47d9ae951d6ce57e4e4c4a453e5eccb207961fb8d91
6
+ metadata.gz: 1e7bd6525404df690f81f902e01bc7e611e23ff5ba71b5d61df07a3743239effb8ae7a96438a52463ef89bee7e3afa6c1941846d66574342b039e996c2e5ea78
7
+ data.tar.gz: 4a13093a70ab33d82a6e2854c622fc2ebae81e447f17c0532251ef84ad5dcfda1ef1e6997e3e5ebd21d14a940749fcbc0b3365b4eb19d74d9145530b64e013ca
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.0.9] - 2025-02-18
2
+
3
+ - Add a ModelEnum
4
+
1
5
  ## [0.0.8] - 2025-02-17
2
6
 
3
7
  - Add support for some newly added fields
@@ -1,4 +1,5 @@
1
- # TODO: consider moving this to src/ and deleting lib/
2
1
  require "foobara/all"
3
2
 
3
+ require_relative "../../src/foobara/ai/open_ai_api"
4
+
4
5
  Foobara::Util.require_directory "#{__dir__}/../../src"
@@ -8,7 +8,7 @@ module Foobara
8
8
  http_method :post
9
9
 
10
10
  add_inputs do
11
- model :string, default: "gpt-3.5-turbo", one_of: %w[gpt-3.5-turbo gpt-4]
11
+ model :model, default: Types::ModelEnum::GPT_3_5_TURBO
12
12
  messages :array do
13
13
  role :string, one_of: %w[system user assistant]
14
14
  content :string
@@ -0,0 +1,73 @@
1
+ module Foobara
2
+ module Ai
3
+ module OpenAiApi
4
+ module Types
5
+ # Can grab an updated list by running something like:
6
+ #
7
+ # irb(main):001> require "foobara/open_ai_api"
8
+ # irb(main):002> Foobara::Ai::OpenAiApi.api_token = File.read("tokens/open_ai_token.txt") and nil
9
+ # irb(main):003> Foobara::Ai::OpenAiApi::ListModels.run!.map(&:id).sort
10
+ # =>
11
+ # ["babbage-002",
12
+ # "chatgpt-4o-latest",
13
+ # "dall-e-2",
14
+ # "dall-e-3",
15
+ # "davinci-002",
16
+ # "gpt-3.5-turbo",
17
+ # ...
18
+ ModelEnum = Foobara::Enumerated.make_module(
19
+ "babbage-002",
20
+ "chatgpt-4o-latest",
21
+ "dall-e-2",
22
+ "dall-e-3",
23
+ "davinci-002",
24
+ "gpt-3.5-turbo",
25
+ "gpt-3.5-turbo-0125",
26
+ "gpt-3.5-turbo-1106",
27
+ "gpt-3.5-turbo-16k",
28
+ "gpt-3.5-turbo-instruct",
29
+ "gpt-3.5-turbo-instruct-0914",
30
+ "gpt-4",
31
+ "gpt-4-0125-preview",
32
+ "gpt-4-0613",
33
+ "gpt-4-1106-preview",
34
+ "gpt-4-turbo",
35
+ "gpt-4-turbo-2024-04-09",
36
+ "gpt-4-turbo-preview",
37
+ "gpt-4o",
38
+ "gpt-4o-2024-05-13",
39
+ "gpt-4o-2024-08-06",
40
+ "gpt-4o-2024-11-20",
41
+ "gpt-4o-audio-preview",
42
+ "gpt-4o-audio-preview-2024-10-01",
43
+ "gpt-4o-audio-preview-2024-12-17",
44
+ "gpt-4o-mini",
45
+ "gpt-4o-mini-2024-07-18",
46
+ "gpt-4o-mini-audio-preview",
47
+ "gpt-4o-mini-audio-preview-2024-12-17",
48
+ "gpt-4o-mini-realtime-preview",
49
+ "gpt-4o-mini-realtime-preview-2024-12-17",
50
+ "gpt-4o-realtime-preview",
51
+ "gpt-4o-realtime-preview-2024-10-01",
52
+ "gpt-4o-realtime-preview-2024-12-17",
53
+ "o1-mini",
54
+ "o1-mini-2024-09-12",
55
+ "o1-preview",
56
+ "o1-preview-2024-09-12",
57
+ "omni-moderation-2024-09-26",
58
+ "omni-moderation-latest",
59
+ "text-embedding-3-large",
60
+ "text-embedding-3-small",
61
+ "text-embedding-ada-002",
62
+ "tts-1",
63
+ "tts-1-1106",
64
+ "tts-1-hd",
65
+ "tts-1-hd-1106",
66
+ "whisper-1"
67
+ )
68
+
69
+ OpenAiApi.foobara_register_type(:model, :string, one_of: ModelEnum)
70
+ end
71
+ end
72
+ end
73
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-open-ai-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-17 00:00:00.000000000 Z
10
+ date: 2025-02-18 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: foobara-http-api-command
@@ -44,6 +44,7 @@ files:
44
44
  - src/foobara/ai/open_ai_api/types/chat_completion/message.rb
45
45
  - src/foobara/ai/open_ai_api/types/chat_completion/usage.rb
46
46
  - src/foobara/ai/open_ai_api/types/model.rb
47
+ - src/foobara/ai/open_ai_api/types/model_enum.rb
47
48
  homepage: https://github.com/foobara/open-ai-api
48
49
  licenses:
49
50
  - Apache-2.0