openai 0.17.1 → 0.19.0
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 +50 -0
- data/README.md +1 -1
- data/lib/openai/client.rb +4 -0
- data/lib/openai/helpers/structured_output/array_of.rb +2 -10
- data/lib/openai/helpers/structured_output/base_model.rb +4 -11
- data/lib/openai/helpers/structured_output/boolean.rb +1 -0
- data/lib/openai/helpers/structured_output/json_schema_converter.rb +19 -3
- data/lib/openai/helpers/structured_output/union_of.rb +2 -10
- data/lib/openai/internal/conversation_cursor_page.rb +92 -0
- data/lib/openai/internal/transport/base_client.rb +1 -4
- data/lib/openai/internal/transport/pooled_net_requester.rb +1 -9
- data/lib/openai/internal/util.rb +1 -1
- data/lib/openai/models/audio/transcription.rb +1 -4
- data/lib/openai/models/audio/transcription_create_params.rb +2 -7
- data/lib/openai/models/audio/transcription_text_done_event.rb +1 -4
- data/lib/openai/models/batch_create_params.rb +38 -1
- data/lib/openai/models/beta/assistant_create_params.rb +6 -19
- data/lib/openai/models/beta/assistant_stream_event.rb +6 -24
- data/lib/openai/models/beta/assistant_update_params.rb +1 -4
- data/lib/openai/models/beta/message_stream_event.rb +1 -4
- data/lib/openai/models/beta/run_step_stream_event.rb +1 -4
- data/lib/openai/models/beta/thread_create_and_run_params.rb +12 -34
- data/lib/openai/models/beta/thread_create_params.rb +7 -22
- data/lib/openai/models/beta/threads/message.rb +3 -10
- data/lib/openai/models/beta/threads/message_create_params.rb +2 -7
- data/lib/openai/models/beta/threads/run.rb +4 -9
- data/lib/openai/models/beta/threads/run_create_params.rb +5 -12
- data/lib/openai/models/beta/threads/run_submit_tool_outputs_params.rb +1 -3
- data/lib/openai/models/beta/threads/runs/code_interpreter_tool_call.rb +5 -17
- data/lib/openai/models/beta/threads/runs/code_interpreter_tool_call_delta.rb +1 -3
- data/lib/openai/models/beta/threads/runs/file_search_tool_call.rb +4 -12
- data/lib/openai/models/beta/threads/runs/run_step_delta_message_delta.rb +1 -4
- data/lib/openai/models/beta/threads/runs/tool_calls_step_details.rb +1 -4
- data/lib/openai/models/beta/threads/text.rb +1 -4
- data/lib/openai/models/chat/chat_completion.rb +6 -6
- data/lib/openai/models/chat/chat_completion_chunk.rb +7 -9
- data/lib/openai/models/chat/chat_completion_custom_tool.rb +2 -7
- data/lib/openai/models/chat/completion_create_params.rb +7 -7
- data/lib/openai/models/conversations/computer_screenshot_content.rb +38 -0
- data/lib/openai/models/conversations/container_file_citation_body.rb +58 -0
- data/lib/openai/models/conversations/conversation.rb +51 -0
- data/lib/openai/models/conversations/conversation_create_params.rb +39 -0
- data/lib/openai/models/conversations/conversation_delete_params.rb +16 -0
- data/lib/openai/models/conversations/conversation_deleted.rb +29 -0
- data/lib/openai/models/conversations/conversation_deleted_resource.rb +30 -0
- data/lib/openai/models/conversations/conversation_item.rb +568 -0
- data/lib/openai/models/conversations/conversation_item_list.rb +55 -0
- data/lib/openai/models/conversations/conversation_retrieve_params.rb +16 -0
- data/lib/openai/models/conversations/conversation_update_params.rb +31 -0
- data/lib/openai/models/conversations/file_citation_body.rb +42 -0
- data/lib/openai/models/conversations/input_file_content.rb +42 -0
- data/lib/openai/models/conversations/input_image_content.rb +62 -0
- data/lib/openai/models/conversations/input_text_content.rb +26 -0
- data/lib/openai/models/conversations/item_create_params.rb +37 -0
- data/lib/openai/models/conversations/item_delete_params.rb +22 -0
- data/lib/openai/models/conversations/item_list_params.rb +84 -0
- data/lib/openai/models/conversations/item_retrieve_params.rb +36 -0
- data/lib/openai/models/conversations/lob_prob.rb +35 -0
- data/lib/openai/models/conversations/message.rb +115 -0
- data/lib/openai/models/conversations/output_text_content.rb +57 -0
- data/lib/openai/models/conversations/refusal_content.rb +26 -0
- data/lib/openai/models/conversations/summary_text_content.rb +23 -0
- data/lib/openai/models/conversations/text_content.rb +23 -0
- data/lib/openai/models/conversations/top_log_prob.rb +29 -0
- data/lib/openai/models/conversations/url_citation_body.rb +50 -0
- data/lib/openai/models/eval_create_params.rb +6 -20
- data/lib/openai/models/evals/create_eval_completions_run_data_source.rb +29 -53
- data/lib/openai/models/evals/create_eval_jsonl_run_data_source.rb +1 -3
- data/lib/openai/models/evals/run_create_params.rb +18 -54
- data/lib/openai/models/file_create_params.rb +37 -1
- data/lib/openai/models/fine_tuning/reinforcement_hyperparameters.rb +1 -4
- data/lib/openai/models/graders/text_similarity_grader.rb +6 -5
- data/lib/openai/models/moderation.rb +5 -15
- data/lib/openai/models/reasoning.rb +1 -1
- data/lib/openai/models/responses/input_item_list_params.rb +1 -9
- data/lib/openai/models/responses/response.rb +32 -9
- data/lib/openai/models/responses/response_computer_tool_call.rb +2 -6
- data/lib/openai/models/responses/response_computer_tool_call_output_item.rb +1 -3
- data/lib/openai/models/responses/response_conversation_param.rb +20 -0
- data/lib/openai/models/responses/response_create_params.rb +40 -9
- data/lib/openai/models/responses/response_input_item.rb +2 -7
- data/lib/openai/models/responses/response_input_message_item.rb +1 -4
- data/lib/openai/models/responses/response_output_item.rb +1 -3
- data/lib/openai/models/responses/response_output_message.rb +1 -3
- data/lib/openai/models/responses/response_output_text.rb +3 -10
- data/lib/openai/models/responses/response_stream_event.rb +4 -16
- data/lib/openai/models/responses/response_text_delta_event.rb +1 -3
- data/lib/openai/models/responses/response_text_done_event.rb +1 -3
- data/lib/openai/models/responses/tool.rb +145 -34
- data/lib/openai/models/upload_create_params.rb +37 -1
- data/lib/openai/models.rb +2 -0
- data/lib/openai/resources/batches.rb +3 -1
- data/lib/openai/resources/conversations/items.rb +141 -0
- data/lib/openai/resources/conversations.rb +112 -0
- data/lib/openai/resources/files.rb +4 -2
- data/lib/openai/resources/responses/input_items.rb +1 -3
- data/lib/openai/resources/responses.rb +8 -4
- data/lib/openai/resources/uploads.rb +3 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +31 -0
- data/rbi/openai/client.rbi +3 -0
- data/rbi/openai/errors.rbi +5 -5
- data/rbi/openai/helpers/structured_output/array_of.rbi +0 -3
- data/rbi/openai/helpers/structured_output/json_schema_converter.rbi +10 -0
- data/rbi/openai/internal/conversation_cursor_page.rbi +25 -0
- data/rbi/openai/models/batch_create_params.rbi +60 -0
- data/rbi/openai/models/beta/thread_create_and_run_params.rbi +3 -3
- data/rbi/openai/models/beta/threads/run.rbi +3 -3
- data/rbi/openai/models/beta/threads/run_create_params.rbi +3 -3
- data/rbi/openai/models/chat/chat_completion.rbi +6 -9
- data/rbi/openai/models/chat/chat_completion_chunk.rbi +6 -9
- data/rbi/openai/models/chat/completion_create_params.rbi +8 -11
- data/rbi/openai/models/conversations/computer_screenshot_content.rbi +60 -0
- data/rbi/openai/models/conversations/container_file_citation_body.rbi +82 -0
- data/rbi/openai/models/conversations/conversation.rbi +76 -0
- data/rbi/openai/models/conversations/conversation_create_params.rbi +144 -0
- data/rbi/openai/models/conversations/conversation_delete_params.rbi +32 -0
- data/rbi/openai/models/conversations/conversation_deleted.rbi +40 -0
- data/rbi/openai/models/conversations/conversation_deleted_resource.rbi +40 -0
- data/rbi/openai/models/conversations/conversation_item.rbi +835 -0
- data/rbi/openai/models/conversations/conversation_item_list.rbi +101 -0
- data/rbi/openai/models/conversations/conversation_retrieve_params.rbi +32 -0
- data/rbi/openai/models/conversations/conversation_update_params.rbi +56 -0
- data/rbi/openai/models/conversations/file_citation_body.rbi +61 -0
- data/rbi/openai/models/conversations/input_file_content.rbi +72 -0
- data/rbi/openai/models/conversations/input_image_content.rbi +113 -0
- data/rbi/openai/models/conversations/input_text_content.rbi +38 -0
- data/rbi/openai/models/conversations/item_create_params.rbi +150 -0
- data/rbi/openai/models/conversations/item_delete_params.rbi +40 -0
- data/rbi/openai/models/conversations/item_list_params.rbi +174 -0
- data/rbi/openai/models/conversations/item_retrieve_params.rbi +70 -0
- data/rbi/openai/models/conversations/lob_prob.rbi +50 -0
- data/rbi/openai/models/conversations/message.rbi +196 -0
- data/rbi/openai/models/conversations/output_text_content.rbi +110 -0
- data/rbi/openai/models/conversations/refusal_content.rbi +38 -0
- data/rbi/openai/models/conversations/summary_text_content.rbi +31 -0
- data/rbi/openai/models/conversations/text_content.rbi +28 -0
- data/rbi/openai/models/conversations/top_log_prob.rbi +41 -0
- data/rbi/openai/models/conversations/url_citation_body.rbi +74 -0
- data/rbi/openai/models/evals/create_eval_completions_run_data_source.rbi +33 -33
- data/rbi/openai/models/file_create_params.rbi +56 -0
- data/rbi/openai/models/graders/text_similarity_grader.rbi +11 -6
- data/rbi/openai/models/reasoning.rbi +1 -1
- data/rbi/openai/models/responses/input_item_list_params.rbi +0 -11
- data/rbi/openai/models/responses/response.rbi +57 -11
- data/rbi/openai/models/responses/response_conversation_param.rbi +33 -0
- data/rbi/openai/models/responses/response_create_params.rbi +62 -11
- data/rbi/openai/models/responses/tool.rbi +243 -31
- data/rbi/openai/models/upload_create_params.rbi +56 -0
- data/rbi/openai/models.rbi +2 -0
- data/rbi/openai/resources/batches.rbi +5 -0
- data/rbi/openai/resources/beta/threads/runs.rbi +2 -2
- data/rbi/openai/resources/beta/threads.rbi +2 -2
- data/rbi/openai/resources/chat/completions.rbi +6 -8
- data/rbi/openai/resources/conversations/items.rbi +152 -0
- data/rbi/openai/resources/conversations.rbi +110 -0
- data/rbi/openai/resources/files.rbi +5 -1
- data/rbi/openai/resources/responses/input_items.rbi +0 -3
- data/rbi/openai/resources/responses.rbi +32 -8
- data/rbi/openai/resources/uploads.rbi +4 -0
- data/sig/openai/client.rbs +2 -0
- data/sig/openai/internal/conversation_cursor_page.rbs +15 -0
- data/sig/openai/models/batch_create_params.rbs +22 -1
- data/sig/openai/models/conversations/computer_screenshot_content.rbs +28 -0
- data/sig/openai/models/conversations/container_file_citation_body.rbs +47 -0
- data/sig/openai/models/conversations/conversation.rbs +37 -0
- data/sig/openai/models/conversations/conversation_create_params.rbs +33 -0
- data/sig/openai/models/conversations/conversation_delete_params.rbs +17 -0
- data/sig/openai/models/conversations/conversation_deleted.rbs +28 -0
- data/sig/openai/models/conversations/conversation_deleted_resource.rbs +28 -0
- data/sig/openai/models/conversations/conversation_item.rbs +403 -0
- data/sig/openai/models/conversations/conversation_item_list.rbs +44 -0
- data/sig/openai/models/conversations/conversation_retrieve_params.rbs +17 -0
- data/sig/openai/models/conversations/conversation_update_params.rbs +26 -0
- data/sig/openai/models/conversations/file_citation_body.rbs +37 -0
- data/sig/openai/models/conversations/input_file_content.rbs +41 -0
- data/sig/openai/models/conversations/input_image_content.rbs +49 -0
- data/sig/openai/models/conversations/input_text_content.rbs +17 -0
- data/sig/openai/models/conversations/item_create_params.rbs +37 -0
- data/sig/openai/models/conversations/item_delete_params.rbs +25 -0
- data/sig/openai/models/conversations/item_list_params.rbs +66 -0
- data/sig/openai/models/conversations/item_retrieve_params.rbs +37 -0
- data/sig/openai/models/conversations/lob_prob.rbs +37 -0
- data/sig/openai/models/conversations/message.rbs +95 -0
- data/sig/openai/models/conversations/output_text_content.rbs +52 -0
- data/sig/openai/models/conversations/refusal_content.rbs +17 -0
- data/sig/openai/models/conversations/summary_text_content.rbs +17 -0
- data/sig/openai/models/conversations/text_content.rbs +17 -0
- data/sig/openai/models/conversations/top_log_prob.rbs +28 -0
- data/sig/openai/models/conversations/url_citation_body.rbs +42 -0
- data/sig/openai/models/evals/create_eval_completions_run_data_source.rbs +22 -22
- data/sig/openai/models/file_create_params.rbs +22 -1
- data/sig/openai/models/graders/text_similarity_grader.rbs +3 -1
- data/sig/openai/models/responses/input_item_list_params.rbs +0 -7
- data/sig/openai/models/responses/response.rbs +15 -0
- data/sig/openai/models/responses/response_conversation_param.rbs +15 -0
- data/sig/openai/models/responses/response_create_params.rbs +14 -0
- data/sig/openai/models/responses/tool.rbs +83 -18
- data/sig/openai/models/upload_create_params.rbs +22 -1
- data/sig/openai/models.rbs +2 -0
- data/sig/openai/resources/batches.rbs +1 -0
- data/sig/openai/resources/conversations/items.rbs +38 -0
- data/sig/openai/resources/conversations.rbs +31 -0
- data/sig/openai/resources/files.rbs +1 -0
- data/sig/openai/resources/responses/input_items.rbs +0 -1
- data/sig/openai/resources/responses.rbs +2 -0
- data/sig/openai/resources/uploads.rbs +1 -0
- metadata +95 -2
@@ -0,0 +1,41 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Conversations
|
6
|
+
class TopLogProb < OpenAI::Internal::Type::BaseModel
|
7
|
+
OrHash =
|
8
|
+
T.type_alias do
|
9
|
+
T.any(OpenAI::Conversations::TopLogProb, OpenAI::Internal::AnyHash)
|
10
|
+
end
|
11
|
+
|
12
|
+
sig { returns(String) }
|
13
|
+
attr_accessor :token
|
14
|
+
|
15
|
+
sig { returns(T::Array[Integer]) }
|
16
|
+
attr_accessor :bytes
|
17
|
+
|
18
|
+
sig { returns(Float) }
|
19
|
+
attr_accessor :logprob
|
20
|
+
|
21
|
+
sig do
|
22
|
+
params(
|
23
|
+
token: String,
|
24
|
+
bytes: T::Array[Integer],
|
25
|
+
logprob: Float
|
26
|
+
).returns(T.attached_class)
|
27
|
+
end
|
28
|
+
def self.new(token:, bytes:, logprob:)
|
29
|
+
end
|
30
|
+
|
31
|
+
sig do
|
32
|
+
override.returns(
|
33
|
+
{ token: String, bytes: T::Array[Integer], logprob: Float }
|
34
|
+
)
|
35
|
+
end
|
36
|
+
def to_hash
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Models
|
5
|
+
module Conversations
|
6
|
+
class URLCitationBody < OpenAI::Internal::Type::BaseModel
|
7
|
+
OrHash =
|
8
|
+
T.type_alias do
|
9
|
+
T.any(
|
10
|
+
OpenAI::Conversations::URLCitationBody,
|
11
|
+
OpenAI::Internal::AnyHash
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
# The index of the last character of the URL citation in the message.
|
16
|
+
sig { returns(Integer) }
|
17
|
+
attr_accessor :end_index
|
18
|
+
|
19
|
+
# The index of the first character of the URL citation in the message.
|
20
|
+
sig { returns(Integer) }
|
21
|
+
attr_accessor :start_index
|
22
|
+
|
23
|
+
# The title of the web resource.
|
24
|
+
sig { returns(String) }
|
25
|
+
attr_accessor :title
|
26
|
+
|
27
|
+
# The type of the URL citation. Always `url_citation`.
|
28
|
+
sig { returns(Symbol) }
|
29
|
+
attr_accessor :type
|
30
|
+
|
31
|
+
# The URL of the web resource.
|
32
|
+
sig { returns(String) }
|
33
|
+
attr_accessor :url
|
34
|
+
|
35
|
+
sig do
|
36
|
+
params(
|
37
|
+
end_index: Integer,
|
38
|
+
start_index: Integer,
|
39
|
+
title: String,
|
40
|
+
url: String,
|
41
|
+
type: Symbol
|
42
|
+
).returns(T.attached_class)
|
43
|
+
end
|
44
|
+
def self.new(
|
45
|
+
# The index of the last character of the URL citation in the message.
|
46
|
+
end_index:,
|
47
|
+
# The index of the first character of the URL citation in the message.
|
48
|
+
start_index:,
|
49
|
+
# The title of the web resource.
|
50
|
+
title:,
|
51
|
+
# The URL of the web resource.
|
52
|
+
url:,
|
53
|
+
# The type of the URL citation. Always `url_citation`.
|
54
|
+
type: :url_citation
|
55
|
+
)
|
56
|
+
end
|
57
|
+
|
58
|
+
sig do
|
59
|
+
override.returns(
|
60
|
+
{
|
61
|
+
end_index: Integer,
|
62
|
+
start_index: Integer,
|
63
|
+
title: String,
|
64
|
+
type: Symbol,
|
65
|
+
url: String
|
66
|
+
}
|
67
|
+
)
|
68
|
+
end
|
69
|
+
def to_hash
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -441,7 +441,7 @@ module OpenAI
|
|
441
441
|
T::Array[
|
442
442
|
T.any(
|
443
443
|
OpenAI::Responses::EasyInputMessage,
|
444
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
444
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem
|
445
445
|
)
|
446
446
|
]
|
447
447
|
)
|
@@ -458,7 +458,7 @@ module OpenAI
|
|
458
458
|
T::Array[
|
459
459
|
T.any(
|
460
460
|
OpenAI::Responses::EasyInputMessage::OrHash,
|
461
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
461
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::OrHash
|
462
462
|
)
|
463
463
|
],
|
464
464
|
type: Symbol
|
@@ -480,7 +480,7 @@ module OpenAI
|
|
480
480
|
T::Array[
|
481
481
|
T.any(
|
482
482
|
OpenAI::Responses::EasyInputMessage,
|
483
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
483
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem
|
484
484
|
)
|
485
485
|
],
|
486
486
|
type: Symbol
|
@@ -502,15 +502,15 @@ module OpenAI
|
|
502
502
|
T.type_alias do
|
503
503
|
T.any(
|
504
504
|
OpenAI::Responses::EasyInputMessage,
|
505
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
505
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem
|
506
506
|
)
|
507
507
|
end
|
508
508
|
|
509
|
-
class
|
509
|
+
class EvalItem < OpenAI::Internal::Type::BaseModel
|
510
510
|
OrHash =
|
511
511
|
T.type_alias do
|
512
512
|
T.any(
|
513
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
513
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem,
|
514
514
|
OpenAI::Internal::AnyHash
|
515
515
|
)
|
516
516
|
end
|
@@ -521,8 +521,8 @@ module OpenAI
|
|
521
521
|
T.any(
|
522
522
|
String,
|
523
523
|
OpenAI::Responses::ResponseInputText,
|
524
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
525
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
524
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText,
|
525
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::InputImage,
|
526
526
|
T::Array[T.anything]
|
527
527
|
)
|
528
528
|
)
|
@@ -533,7 +533,7 @@ module OpenAI
|
|
533
533
|
# `developer`.
|
534
534
|
sig do
|
535
535
|
returns(
|
536
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
536
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role::OrSymbol
|
537
537
|
)
|
538
538
|
end
|
539
539
|
attr_accessor :role
|
@@ -542,7 +542,7 @@ module OpenAI
|
|
542
542
|
sig do
|
543
543
|
returns(
|
544
544
|
T.nilable(
|
545
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
545
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Type::OrSymbol
|
546
546
|
)
|
547
547
|
)
|
548
548
|
end
|
@@ -551,7 +551,7 @@ module OpenAI
|
|
551
551
|
sig do
|
552
552
|
params(
|
553
553
|
type:
|
554
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
554
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Type::OrSymbol
|
555
555
|
).void
|
556
556
|
end
|
557
557
|
attr_writer :type
|
@@ -567,14 +567,14 @@ module OpenAI
|
|
567
567
|
T.any(
|
568
568
|
String,
|
569
569
|
OpenAI::Responses::ResponseInputText::OrHash,
|
570
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
571
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
570
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText::OrHash,
|
571
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::InputImage::OrHash,
|
572
572
|
T::Array[T.anything]
|
573
573
|
),
|
574
574
|
role:
|
575
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
575
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role::OrSymbol,
|
576
576
|
type:
|
577
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
577
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Type::OrSymbol
|
578
578
|
).returns(T.attached_class)
|
579
579
|
end
|
580
580
|
def self.new(
|
@@ -595,14 +595,14 @@ module OpenAI
|
|
595
595
|
T.any(
|
596
596
|
String,
|
597
597
|
OpenAI::Responses::ResponseInputText,
|
598
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
599
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
598
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText,
|
599
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::InputImage,
|
600
600
|
T::Array[T.anything]
|
601
601
|
),
|
602
602
|
role:
|
603
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
603
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role::OrSymbol,
|
604
604
|
type:
|
605
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
605
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Type::OrSymbol
|
606
606
|
}
|
607
607
|
)
|
608
608
|
end
|
@@ -618,8 +618,8 @@ module OpenAI
|
|
618
618
|
T.any(
|
619
619
|
String,
|
620
620
|
OpenAI::Responses::ResponseInputText,
|
621
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
622
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
621
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText,
|
622
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::InputImage,
|
623
623
|
T::Array[T.anything]
|
624
624
|
)
|
625
625
|
end
|
@@ -628,7 +628,7 @@ module OpenAI
|
|
628
628
|
OrHash =
|
629
629
|
T.type_alias do
|
630
630
|
T.any(
|
631
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
631
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::OutputText,
|
632
632
|
OpenAI::Internal::AnyHash
|
633
633
|
)
|
634
634
|
end
|
@@ -664,7 +664,7 @@ module OpenAI
|
|
664
664
|
OrHash =
|
665
665
|
T.type_alias do
|
666
666
|
T.any(
|
667
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
667
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::InputImage,
|
668
668
|
OpenAI::Internal::AnyHash
|
669
669
|
)
|
670
670
|
end
|
@@ -716,7 +716,7 @@ module OpenAI
|
|
716
716
|
sig do
|
717
717
|
override.returns(
|
718
718
|
T::Array[
|
719
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
719
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Content::Variants
|
720
720
|
]
|
721
721
|
)
|
722
722
|
end
|
@@ -741,7 +741,7 @@ module OpenAI
|
|
741
741
|
T.type_alias do
|
742
742
|
T.all(
|
743
743
|
Symbol,
|
744
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
744
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role
|
745
745
|
)
|
746
746
|
end
|
747
747
|
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
@@ -749,28 +749,28 @@ module OpenAI
|
|
749
749
|
USER =
|
750
750
|
T.let(
|
751
751
|
:user,
|
752
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
752
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol
|
753
753
|
)
|
754
754
|
ASSISTANT =
|
755
755
|
T.let(
|
756
756
|
:assistant,
|
757
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
757
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol
|
758
758
|
)
|
759
759
|
SYSTEM =
|
760
760
|
T.let(
|
761
761
|
:system,
|
762
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
762
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol
|
763
763
|
)
|
764
764
|
DEVELOPER =
|
765
765
|
T.let(
|
766
766
|
:developer,
|
767
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
767
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol
|
768
768
|
)
|
769
769
|
|
770
770
|
sig do
|
771
771
|
override.returns(
|
772
772
|
T::Array[
|
773
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
773
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Role::TaggedSymbol
|
774
774
|
]
|
775
775
|
)
|
776
776
|
end
|
@@ -786,7 +786,7 @@ module OpenAI
|
|
786
786
|
T.type_alias do
|
787
787
|
T.all(
|
788
788
|
Symbol,
|
789
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
789
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Type
|
790
790
|
)
|
791
791
|
end
|
792
792
|
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
@@ -794,13 +794,13 @@ module OpenAI
|
|
794
794
|
MESSAGE =
|
795
795
|
T.let(
|
796
796
|
:message,
|
797
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
797
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol
|
798
798
|
)
|
799
799
|
|
800
800
|
sig do
|
801
801
|
override.returns(
|
802
802
|
T::Array[
|
803
|
-
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::
|
803
|
+
OpenAI::Evals::CreateEvalCompletionsRunDataSource::InputMessages::Template::Template::EvalItem::Type::TaggedSymbol
|
804
804
|
]
|
805
805
|
)
|
806
806
|
end
|
@@ -22,10 +22,23 @@ module OpenAI
|
|
22
22
|
sig { returns(OpenAI::FilePurpose::OrSymbol) }
|
23
23
|
attr_accessor :purpose
|
24
24
|
|
25
|
+
# The expiration policy for a file. By default, files with `purpose=batch` expire
|
26
|
+
# after 30 days and all other files are persisted until they are manually deleted.
|
27
|
+
sig { returns(T.nilable(OpenAI::FileCreateParams::ExpiresAfter)) }
|
28
|
+
attr_reader :expires_after
|
29
|
+
|
30
|
+
sig do
|
31
|
+
params(
|
32
|
+
expires_after: OpenAI::FileCreateParams::ExpiresAfter::OrHash
|
33
|
+
).void
|
34
|
+
end
|
35
|
+
attr_writer :expires_after
|
36
|
+
|
25
37
|
sig do
|
26
38
|
params(
|
27
39
|
file: OpenAI::Internal::FileInput,
|
28
40
|
purpose: OpenAI::FilePurpose::OrSymbol,
|
41
|
+
expires_after: OpenAI::FileCreateParams::ExpiresAfter::OrHash,
|
29
42
|
request_options: OpenAI::RequestOptions::OrHash
|
30
43
|
).returns(T.attached_class)
|
31
44
|
end
|
@@ -37,6 +50,9 @@ module OpenAI
|
|
37
50
|
# fine-tuning - `vision`: Images used for vision fine-tuning - `user_data`:
|
38
51
|
# Flexible file type for any purpose - `evals`: Used for eval data sets
|
39
52
|
purpose:,
|
53
|
+
# The expiration policy for a file. By default, files with `purpose=batch` expire
|
54
|
+
# after 30 days and all other files are persisted until they are manually deleted.
|
55
|
+
expires_after: nil,
|
40
56
|
request_options: {}
|
41
57
|
)
|
42
58
|
end
|
@@ -46,12 +62,52 @@ module OpenAI
|
|
46
62
|
{
|
47
63
|
file: OpenAI::Internal::FileInput,
|
48
64
|
purpose: OpenAI::FilePurpose::OrSymbol,
|
65
|
+
expires_after: OpenAI::FileCreateParams::ExpiresAfter,
|
49
66
|
request_options: OpenAI::RequestOptions
|
50
67
|
}
|
51
68
|
)
|
52
69
|
end
|
53
70
|
def to_hash
|
54
71
|
end
|
72
|
+
|
73
|
+
class ExpiresAfter < OpenAI::Internal::Type::BaseModel
|
74
|
+
OrHash =
|
75
|
+
T.type_alias do
|
76
|
+
T.any(
|
77
|
+
OpenAI::FileCreateParams::ExpiresAfter,
|
78
|
+
OpenAI::Internal::AnyHash
|
79
|
+
)
|
80
|
+
end
|
81
|
+
|
82
|
+
# Anchor timestamp after which the expiration policy applies. Supported anchors:
|
83
|
+
# `created_at`.
|
84
|
+
sig { returns(Symbol) }
|
85
|
+
attr_accessor :anchor
|
86
|
+
|
87
|
+
# The number of seconds after the anchor time that the file will expire. Must be
|
88
|
+
# between 3600 (1 hour) and 2592000 (30 days).
|
89
|
+
sig { returns(Integer) }
|
90
|
+
attr_accessor :seconds
|
91
|
+
|
92
|
+
# The expiration policy for a file. By default, files with `purpose=batch` expire
|
93
|
+
# after 30 days and all other files are persisted until they are manually deleted.
|
94
|
+
sig do
|
95
|
+
params(seconds: Integer, anchor: Symbol).returns(T.attached_class)
|
96
|
+
end
|
97
|
+
def self.new(
|
98
|
+
# The number of seconds after the anchor time that the file will expire. Must be
|
99
|
+
# between 3600 (1 hour) and 2592000 (30 days).
|
100
|
+
seconds:,
|
101
|
+
# Anchor timestamp after which the expiration policy applies. Supported anchors:
|
102
|
+
# `created_at`.
|
103
|
+
anchor: :created_at
|
104
|
+
)
|
105
|
+
end
|
106
|
+
|
107
|
+
sig { override.returns({ anchor: Symbol, seconds: Integer }) }
|
108
|
+
def to_hash
|
109
|
+
end
|
110
|
+
end
|
55
111
|
end
|
56
112
|
end
|
57
113
|
end
|
@@ -14,8 +14,8 @@ module OpenAI
|
|
14
14
|
)
|
15
15
|
end
|
16
16
|
|
17
|
-
# The evaluation metric to use. One of `fuzzy_match`, `bleu`, `gleu`,
|
18
|
-
# `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`.
|
17
|
+
# The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`, `gleu`,
|
18
|
+
# `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`.
|
19
19
|
sig do
|
20
20
|
returns(
|
21
21
|
OpenAI::Graders::TextSimilarityGrader::EvaluationMetric::OrSymbol
|
@@ -51,8 +51,8 @@ module OpenAI
|
|
51
51
|
).returns(T.attached_class)
|
52
52
|
end
|
53
53
|
def self.new(
|
54
|
-
# The evaluation metric to use. One of `fuzzy_match`, `bleu`, `gleu`,
|
55
|
-
# `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`.
|
54
|
+
# The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`, `gleu`,
|
55
|
+
# `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`.
|
56
56
|
evaluation_metric:,
|
57
57
|
# The text being graded.
|
58
58
|
input:,
|
@@ -80,8 +80,8 @@ module OpenAI
|
|
80
80
|
def to_hash
|
81
81
|
end
|
82
82
|
|
83
|
-
# The evaluation metric to use. One of `fuzzy_match`, `bleu`, `gleu`,
|
84
|
-
# `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`.
|
83
|
+
# The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`, `gleu`,
|
84
|
+
# `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, or `rouge_l`.
|
85
85
|
module EvaluationMetric
|
86
86
|
extend OpenAI::Internal::Type::Enum
|
87
87
|
|
@@ -94,6 +94,11 @@ module OpenAI
|
|
94
94
|
end
|
95
95
|
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
96
96
|
|
97
|
+
COSINE =
|
98
|
+
T.let(
|
99
|
+
:cosine,
|
100
|
+
OpenAI::Graders::TextSimilarityGrader::EvaluationMetric::TaggedSymbol
|
101
|
+
)
|
97
102
|
FUZZY_MATCH =
|
98
103
|
T.let(
|
99
104
|
:fuzzy_match,
|
@@ -28,7 +28,7 @@ module OpenAI
|
|
28
28
|
sig { returns(T.nilable(OpenAI::Reasoning::Summary::OrSymbol)) }
|
29
29
|
attr_accessor :summary
|
30
30
|
|
31
|
-
# **o-series models only**
|
31
|
+
# **gpt-5 and o-series models only**
|
32
32
|
#
|
33
33
|
# Configuration options for
|
34
34
|
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
@@ -22,13 +22,6 @@ module OpenAI
|
|
22
22
|
sig { params(after: String).void }
|
23
23
|
attr_writer :after
|
24
24
|
|
25
|
-
# An item ID to list items before, used in pagination.
|
26
|
-
sig { returns(T.nilable(String)) }
|
27
|
-
attr_reader :before
|
28
|
-
|
29
|
-
sig { params(before: String).void }
|
30
|
-
attr_writer :before
|
31
|
-
|
32
25
|
# Additional fields to include in the response. See the `include` parameter for
|
33
26
|
# Response creation above for more information.
|
34
27
|
sig do
|
@@ -74,7 +67,6 @@ module OpenAI
|
|
74
67
|
sig do
|
75
68
|
params(
|
76
69
|
after: String,
|
77
|
-
before: String,
|
78
70
|
include: T::Array[OpenAI::Responses::ResponseIncludable::OrSymbol],
|
79
71
|
limit: Integer,
|
80
72
|
order: OpenAI::Responses::InputItemListParams::Order::OrSymbol,
|
@@ -84,8 +76,6 @@ module OpenAI
|
|
84
76
|
def self.new(
|
85
77
|
# An item ID to list items after, used in pagination.
|
86
78
|
after: nil,
|
87
|
-
# An item ID to list items before, used in pagination.
|
88
|
-
before: nil,
|
89
79
|
# Additional fields to include in the response. See the `include` parameter for
|
90
80
|
# Response creation above for more information.
|
91
81
|
include: nil,
|
@@ -105,7 +95,6 @@ module OpenAI
|
|
105
95
|
override.returns(
|
106
96
|
{
|
107
97
|
after: String,
|
108
|
-
before: String,
|
109
98
|
include:
|
110
99
|
T::Array[OpenAI::Responses::ResponseIncludable::OrSymbol],
|
111
100
|
limit: Integer,
|
@@ -136,6 +136,19 @@ module OpenAI
|
|
136
136
|
sig { returns(T.nilable(T::Boolean)) }
|
137
137
|
attr_accessor :background
|
138
138
|
|
139
|
+
# The conversation that this response belongs to. Input items and output items
|
140
|
+
# from this response are automatically added to this conversation.
|
141
|
+
sig { returns(T.nilable(OpenAI::Responses::Response::Conversation)) }
|
142
|
+
attr_reader :conversation
|
143
|
+
|
144
|
+
sig do
|
145
|
+
params(
|
146
|
+
conversation:
|
147
|
+
T.nilable(OpenAI::Responses::Response::Conversation::OrHash)
|
148
|
+
).void
|
149
|
+
end
|
150
|
+
attr_writer :conversation
|
151
|
+
|
139
152
|
# An upper bound for the number of tokens that can be generated for a response,
|
140
153
|
# including visible output tokens and
|
141
154
|
# [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
|
@@ -152,6 +165,7 @@ module OpenAI
|
|
152
165
|
# The unique ID of the previous response to the model. Use this to create
|
153
166
|
# multi-turn conversations. Learn more about
|
154
167
|
# [conversation state](https://platform.openai.com/docs/guides/conversation-state).
|
168
|
+
# Cannot be used in conjunction with `conversation`.
|
155
169
|
sig { returns(T.nilable(String)) }
|
156
170
|
attr_accessor :previous_response_id
|
157
171
|
|
@@ -176,7 +190,7 @@ module OpenAI
|
|
176
190
|
sig { params(prompt_cache_key: String).void }
|
177
191
|
attr_writer :prompt_cache_key
|
178
192
|
|
179
|
-
# **o-series models only**
|
193
|
+
# **gpt-5 and o-series models only**
|
180
194
|
#
|
181
195
|
# Configuration options for
|
182
196
|
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
@@ -205,9 +219,8 @@ module OpenAI
|
|
205
219
|
# - If set to 'default', then the request will be processed with the standard
|
206
220
|
# pricing and performance for the selected model.
|
207
221
|
# - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
|
208
|
-
# 'priority', then the request
|
209
|
-
#
|
210
|
-
# Priority processing.
|
222
|
+
# '[priority](https://openai.com/api-priority-processing/)', then the request
|
223
|
+
# will be processed with the corresponding service tier.
|
211
224
|
# - When not set, the default behavior is 'auto'.
|
212
225
|
#
|
213
226
|
# When the `service_tier` parameter is set, the response body will include the
|
@@ -341,6 +354,8 @@ module OpenAI
|
|
341
354
|
],
|
342
355
|
top_p: T.nilable(Float),
|
343
356
|
background: T.nilable(T::Boolean),
|
357
|
+
conversation:
|
358
|
+
T.nilable(OpenAI::Responses::Response::Conversation::OrHash),
|
344
359
|
max_output_tokens: T.nilable(Integer),
|
345
360
|
max_tool_calls: T.nilable(Integer),
|
346
361
|
previous_response_id: T.nilable(String),
|
@@ -433,6 +448,9 @@ module OpenAI
|
|
433
448
|
# Whether to run the model response in the background.
|
434
449
|
# [Learn more](https://platform.openai.com/docs/guides/background).
|
435
450
|
background: nil,
|
451
|
+
# The conversation that this response belongs to. Input items and output items
|
452
|
+
# from this response are automatically added to this conversation.
|
453
|
+
conversation: nil,
|
436
454
|
# An upper bound for the number of tokens that can be generated for a response,
|
437
455
|
# including visible output tokens and
|
438
456
|
# [reasoning tokens](https://platform.openai.com/docs/guides/reasoning).
|
@@ -445,6 +463,7 @@ module OpenAI
|
|
445
463
|
# The unique ID of the previous response to the model. Use this to create
|
446
464
|
# multi-turn conversations. Learn more about
|
447
465
|
# [conversation state](https://platform.openai.com/docs/guides/conversation-state).
|
466
|
+
# Cannot be used in conjunction with `conversation`.
|
448
467
|
previous_response_id: nil,
|
449
468
|
# Reference to a prompt template and its variables.
|
450
469
|
# [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts).
|
@@ -453,7 +472,7 @@ module OpenAI
|
|
453
472
|
# hit rates. Replaces the `user` field.
|
454
473
|
# [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
|
455
474
|
prompt_cache_key: nil,
|
456
|
-
# **o-series models only**
|
475
|
+
# **gpt-5 and o-series models only**
|
457
476
|
#
|
458
477
|
# Configuration options for
|
459
478
|
# [reasoning models](https://platform.openai.com/docs/guides/reasoning).
|
@@ -472,9 +491,8 @@ module OpenAI
|
|
472
491
|
# - If set to 'default', then the request will be processed with the standard
|
473
492
|
# pricing and performance for the selected model.
|
474
493
|
# - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
|
475
|
-
# 'priority', then the request
|
476
|
-
#
|
477
|
-
# Priority processing.
|
494
|
+
# '[priority](https://openai.com/api-priority-processing/)', then the request
|
495
|
+
# will be processed with the corresponding service tier.
|
478
496
|
# - When not set, the default behavior is 'auto'.
|
479
497
|
#
|
480
498
|
# When the `service_tier` parameter is set, the response body will include the
|
@@ -536,6 +554,8 @@ module OpenAI
|
|
536
554
|
tools: T::Array[OpenAI::Responses::Tool::Variants],
|
537
555
|
top_p: T.nilable(Float),
|
538
556
|
background: T.nilable(T::Boolean),
|
557
|
+
conversation:
|
558
|
+
T.nilable(OpenAI::Responses::Response::Conversation),
|
539
559
|
max_output_tokens: T.nilable(Integer),
|
540
560
|
max_tool_calls: T.nilable(Integer),
|
541
561
|
previous_response_id: T.nilable(String),
|
@@ -709,6 +729,33 @@ module OpenAI
|
|
709
729
|
end
|
710
730
|
end
|
711
731
|
|
732
|
+
class Conversation < OpenAI::Internal::Type::BaseModel
|
733
|
+
OrHash =
|
734
|
+
T.type_alias do
|
735
|
+
T.any(
|
736
|
+
OpenAI::Responses::Response::Conversation,
|
737
|
+
OpenAI::Internal::AnyHash
|
738
|
+
)
|
739
|
+
end
|
740
|
+
|
741
|
+
# The unique ID of the conversation.
|
742
|
+
sig { returns(String) }
|
743
|
+
attr_accessor :id
|
744
|
+
|
745
|
+
# The conversation that this response belongs to. Input items and output items
|
746
|
+
# from this response are automatically added to this conversation.
|
747
|
+
sig { params(id: String).returns(T.attached_class) }
|
748
|
+
def self.new(
|
749
|
+
# The unique ID of the conversation.
|
750
|
+
id:
|
751
|
+
)
|
752
|
+
end
|
753
|
+
|
754
|
+
sig { override.returns({ id: String }) }
|
755
|
+
def to_hash
|
756
|
+
end
|
757
|
+
end
|
758
|
+
|
712
759
|
# Specifies the processing type used for serving the request.
|
713
760
|
#
|
714
761
|
# - If set to 'auto', then the request will be processed with the service tier
|
@@ -717,9 +764,8 @@ module OpenAI
|
|
717
764
|
# - If set to 'default', then the request will be processed with the standard
|
718
765
|
# pricing and performance for the selected model.
|
719
766
|
# - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
|
720
|
-
# 'priority', then the request
|
721
|
-
#
|
722
|
-
# Priority processing.
|
767
|
+
# '[priority](https://openai.com/api-priority-processing/)', then the request
|
768
|
+
# will be processed with the corresponding service tier.
|
723
769
|
# - When not set, the default behavior is 'auto'.
|
724
770
|
#
|
725
771
|
# When the `service_tier` parameter is set, the response body will include the
|