Skip to content

Commit beb4d59

Browse files
committed
Add batch file purpose
1 parent f9346ef commit beb4d59

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/openai/files.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
module OpenAI
22
class Files
3-
PURPOSES = %w[fine-tune assistants].freeze
3+
PURPOSES = %w[
4+
assistants
5+
batch
6+
fine-tune
7+
].freeze
48

59
def initialize(client:)
610
@client = client
@@ -51,7 +55,7 @@ def prepare_file_input(file_input:)
5155
def validate(file:, purpose:, file_input:)
5256
raise ArgumentError, "`file` is required" if file.nil?
5357
unless PURPOSES.include?(purpose)
54-
raise ArgumentError, "`purpose` must one of `#{PURPOSES.join(',')}`"
58+
raise ArgumentError, "`purpose` must be one of `#{PURPOSES.join(',')}`"
5559
end
5660

5761
validate_jsonl(file: file) if file_input.is_a?(String) && file_input.end_with?(".jsonl")

0 commit comments

Comments
 (0)