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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac4ed9093113e0eba0188cabba2c4ba6bc349ea0a3d03ada3ed2c091634eeed9
|
4
|
+
data.tar.gz: e20b7e18c4ddcfdefcb9dffc209a975d73e85f1203d0feac5f9cf120efa7dc09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4caaa4c1f5a0ce634d6161f42867592da4df7a1d011ac79133304ba3f18f6fae564744f89062bf062c4167c0e22bedadf9b9f05f9416d9921311f0019f2cf9e
|
7
|
+
data.tar.gz: 3ab46d651e729aa986a3befb934300fcd05badc4a44cc0a61bcd08041d9d1e166f2820d9854f133fce94b77ff8d7158cf88982571ccaaa683adcc8f9a541b1b6
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,55 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.19.0 (2025-08-21)
|
4
|
+
|
5
|
+
Full Changelog: [v0.18.1...v0.19.0](https://github.com/openai/openai-ruby/compare/v0.18.1...v0.19.0)
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
* **api:** Add connectors support for MCP tool ([469dbe2](https://github.com/openai/openai-ruby/commit/469dbe2f5fab91bac9f4a656250567c9f6bc9867))
|
10
|
+
* **api:** adding support for /v1/conversations to the API ([54d4fe7](https://github.com/openai/openai-ruby/commit/54d4fe72f8157c44d3bca692e232be2e7ef7bbeb))
|
11
|
+
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* bump sorbet version and fix new type errors from the breaking change ([147f0a4](https://github.com/openai/openai-ruby/commit/147f0a48e2c10ede5d8a30c58ae8f5601d3c4a26))
|
16
|
+
* do note check stainless api key during release creation ([#813](https://github.com/openai/openai-ruby/issues/813)) ([afab147](https://github.com/openai/openai-ruby/commit/afab1477b36c90edd5a163f42d8b7f8f82001622))
|
17
|
+
|
18
|
+
|
19
|
+
### Chores
|
20
|
+
|
21
|
+
* **internal/ci:** setup breaking change detection ([f6a214c](https://github.com/openai/openai-ruby/commit/f6a214cd9373afdde57bee358b4e008f256b2a1e))
|
22
|
+
|
23
|
+
## 0.18.1 (2025-08-19)
|
24
|
+
|
25
|
+
Full Changelog: [v0.18.0...v0.18.1](https://github.com/openai/openai-ruby/compare/v0.18.0...v0.18.1)
|
26
|
+
|
27
|
+
### Chores
|
28
|
+
|
29
|
+
* **api:** accurately represent shape for verbosity on Chat Completions ([a19cd00](https://github.com/openai/openai-ruby/commit/a19cd00e6df3cc3f47239a25fe15f33c2cb77962))
|
30
|
+
|
31
|
+
## 0.18.0 (2025-08-15)
|
32
|
+
|
33
|
+
Full Changelog: [v0.17.1...v0.18.0](https://github.com/openai/openai-ruby/compare/v0.17.1...v0.18.0)
|
34
|
+
|
35
|
+
### ⚠ BREAKING CHANGES
|
36
|
+
|
37
|
+
* structured output desc should go on array items not array itself ([#799](https://github.com/openai/openai-ruby/issues/799))
|
38
|
+
|
39
|
+
### Features
|
40
|
+
|
41
|
+
* **api:** add new text parameters, expiration options ([f318432](https://github.com/openai/openai-ruby/commit/f318432b19800ab42d5b0c5f179f0cdd02dbf596))
|
42
|
+
|
43
|
+
|
44
|
+
### Bug Fixes
|
45
|
+
|
46
|
+
* structured output desc should go on array items not array itself ([#799](https://github.com/openai/openai-ruby/issues/799)) ([ff507d0](https://github.com/openai/openai-ruby/commit/ff507d095ff703ba3b44ab82b06eb4314688d4eb))
|
47
|
+
|
48
|
+
|
49
|
+
### Chores
|
50
|
+
|
51
|
+
* **internal:** update test skipping reason ([c815703](https://github.com/openai/openai-ruby/commit/c815703062ce79d2cb14f252ee5d23cf4ebf15ca))
|
52
|
+
|
3
53
|
## 0.17.1 (2025-08-09)
|
4
54
|
|
5
55
|
Full Changelog: [v0.17.0...v0.17.1](https://github.com/openai/openai-ruby/compare/v0.17.0...v0.17.1)
|
data/README.md
CHANGED
data/lib/openai/client.rb
CHANGED
@@ -75,6 +75,9 @@ module OpenAI
|
|
75
75
|
# @return [OpenAI::Resources::Responses]
|
76
76
|
attr_reader :responses
|
77
77
|
|
78
|
+
# @return [OpenAI::Resources::Conversations]
|
79
|
+
attr_reader :conversations
|
80
|
+
|
78
81
|
# @return [OpenAI::Resources::Evals]
|
79
82
|
attr_reader :evals
|
80
83
|
|
@@ -160,6 +163,7 @@ module OpenAI
|
|
160
163
|
@batches = OpenAI::Resources::Batches.new(client: self)
|
161
164
|
@uploads = OpenAI::Resources::Uploads.new(client: self)
|
162
165
|
@responses = OpenAI::Resources::Responses.new(client: self)
|
166
|
+
@conversations = OpenAI::Resources::Conversations.new(client: self)
|
163
167
|
@evals = OpenAI::Resources::Evals.new(client: self)
|
164
168
|
@containers = OpenAI::Resources::Containers.new(client: self)
|
165
169
|
end
|
@@ -30,19 +30,11 @@ module OpenAI
|
|
30
30
|
state: state
|
31
31
|
)
|
32
32
|
items = OpenAI::Helpers::StructuredOutput::JsonSchemaConverter.to_nilable(items) if nilable?
|
33
|
+
OpenAI::Helpers::StructuredOutput::JsonSchemaConverter.assoc_meta!(items, meta: @meta)
|
33
34
|
|
34
|
-
|
35
|
-
description.nil? ? schema : schema.update(description: description)
|
35
|
+
{type: "array", items: items}
|
36
36
|
end
|
37
37
|
end
|
38
|
-
|
39
|
-
# @return [String, nil]
|
40
|
-
attr_reader :description
|
41
|
-
|
42
|
-
def initialize(type_info, spec = {})
|
43
|
-
super
|
44
|
-
@description = [type_info, spec].grep(Hash).filter_map { _1[:doc] }.first
|
45
|
-
end
|
46
38
|
end
|
47
39
|
end
|
48
40
|
end
|
@@ -28,15 +28,13 @@ module OpenAI
|
|
28
28
|
OpenAI::Helpers::StructuredOutput::JsonSchemaConverter.cache_def!(state, type: self) do
|
29
29
|
path = state.fetch(:path)
|
30
30
|
properties = fields.to_h do |name, field|
|
31
|
-
type, nilable = field.fetch_values(:type, :nilable)
|
31
|
+
type, nilable, meta = field.fetch_values(:type, :nilable, :meta)
|
32
32
|
new_state = {**state, path: [*path, ".#{name}"]}
|
33
33
|
|
34
34
|
schema =
|
35
35
|
case type
|
36
|
-
in {"$ref": String}
|
37
|
-
type
|
38
36
|
in OpenAI::Helpers::StructuredOutput::JsonSchemaConverter
|
39
|
-
type.to_json_schema_inner(state: new_state)
|
37
|
+
type.to_json_schema_inner(state: new_state)
|
40
38
|
else
|
41
39
|
OpenAI::Helpers::StructuredOutput::JsonSchemaConverter.to_json_schema_inner(
|
42
40
|
type,
|
@@ -44,6 +42,8 @@ module OpenAI
|
|
44
42
|
)
|
45
43
|
end
|
46
44
|
schema = OpenAI::Helpers::StructuredOutput::JsonSchemaConverter.to_nilable(schema) if nilable
|
45
|
+
OpenAI::Helpers::StructuredOutput::JsonSchemaConverter.assoc_meta!(schema, meta: meta)
|
46
|
+
|
47
47
|
[name, schema]
|
48
48
|
end
|
49
49
|
|
@@ -58,13 +58,6 @@ module OpenAI
|
|
58
58
|
end
|
59
59
|
|
60
60
|
class << self
|
61
|
-
def required(name_sym, type_info, spec = {})
|
62
|
-
super
|
63
|
-
|
64
|
-
doc = [type_info, spec].grep(Hash).filter_map { _1[:doc] }.first
|
65
|
-
known_fields.fetch(name_sym).update(description: doc) unless doc.nil?
|
66
|
-
end
|
67
|
-
|
68
61
|
def optional(...)
|
69
62
|
# rubocop:disable Layout/LineLength
|
70
63
|
message = "`optional` is not supported for structured output APIs, use `#required` with `nil?: true` instead"
|
@@ -8,6 +8,7 @@ module OpenAI
|
|
8
8
|
# Ruby does not have a "boolean" Class, this is something for models to refer to.
|
9
9
|
class Boolean < OpenAI::Internal::Type::Boolean
|
10
10
|
extend OpenAI::Helpers::StructuredOutput::JsonSchemaConverter
|
11
|
+
|
11
12
|
# rubocop:disable Lint/UnusedMethodArgument
|
12
13
|
|
13
14
|
# @api private
|
@@ -46,7 +46,7 @@ module OpenAI
|
|
46
46
|
in {"$ref": String}
|
47
47
|
{
|
48
48
|
anyOf: [
|
49
|
-
schema.
|
49
|
+
schema.merge!(OpenAI::Helpers::StructuredOutput::JsonSchemaConverter::NO_REF => true),
|
50
50
|
{type: null}
|
51
51
|
]
|
52
52
|
}
|
@@ -60,6 +60,17 @@ module OpenAI
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
+
# @api private
|
64
|
+
#
|
65
|
+
# @param schema [Hash{Symbol=>Object}]
|
66
|
+
def assoc_meta!(schema, meta:)
|
67
|
+
xformed = meta.transform_keys(doc: :description)
|
68
|
+
if schema.key?(:$ref) && !xformed.empty?
|
69
|
+
schema.merge!(OpenAI::Helpers::StructuredOutput::JsonSchemaConverter::NO_REF => true)
|
70
|
+
end
|
71
|
+
schema.merge!(xformed)
|
72
|
+
end
|
73
|
+
|
63
74
|
# @api private
|
64
75
|
#
|
65
76
|
# @param state [Hash{Symbol=>Object}]
|
@@ -116,12 +127,17 @@ module OpenAI
|
|
116
127
|
|
117
128
|
case refs
|
118
129
|
in [ref]
|
119
|
-
ref.replace(sch)
|
130
|
+
ref.replace(ref.except(:$ref).merge(sch))
|
120
131
|
in [_, ref, *]
|
121
132
|
reused_defs.store(ref.fetch(:$ref), sch)
|
133
|
+
refs.each do
|
134
|
+
unless (meta = _1.except(:$ref)).empty?
|
135
|
+
_1.replace(allOf: [_1.slice(:$ref), meta])
|
136
|
+
end
|
137
|
+
end
|
122
138
|
else
|
123
139
|
end
|
124
|
-
no_refs.each { _1.replace(sch) }
|
140
|
+
no_refs.each { _1.replace(_1.except(:$ref).merge(sch)) }
|
125
141
|
end
|
126
142
|
|
127
143
|
xformed = reused_defs.transform_keys { _1.delete_prefix("#/$defs/") }
|
@@ -56,16 +56,8 @@ module OpenAI
|
|
56
56
|
|
57
57
|
# @param variants [Array<generic<Member>>]
|
58
58
|
def initialize(*variants)
|
59
|
-
|
60
|
-
|
61
|
-
discriminator(d)
|
62
|
-
vs.each do |k, v|
|
63
|
-
v.is_a?(Proc) ? variant(k, v) : variant(k, -> { v })
|
64
|
-
end
|
65
|
-
else
|
66
|
-
variants.each do |v|
|
67
|
-
v.is_a?(Proc) ? variant(v) : variant(-> { v })
|
68
|
-
end
|
59
|
+
variants.each do |v|
|
60
|
+
v.is_a?(Proc) ? variant(v) : variant(-> { v })
|
69
61
|
end
|
70
62
|
end
|
71
63
|
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OpenAI
|
4
|
+
module Internal
|
5
|
+
# @generic Elem
|
6
|
+
#
|
7
|
+
# @example
|
8
|
+
# if conversation_cursor_page.has_next?
|
9
|
+
# conversation_cursor_page = conversation_cursor_page.next_page
|
10
|
+
# end
|
11
|
+
#
|
12
|
+
# @example
|
13
|
+
# conversation_cursor_page.auto_paging_each do |item|
|
14
|
+
# puts(item)
|
15
|
+
# end
|
16
|
+
class ConversationCursorPage
|
17
|
+
include OpenAI::Internal::Type::BasePage
|
18
|
+
|
19
|
+
# @return [Array<generic<Elem>>, nil]
|
20
|
+
attr_accessor :data
|
21
|
+
|
22
|
+
# @return [Boolean]
|
23
|
+
attr_accessor :has_more
|
24
|
+
|
25
|
+
# @return [String]
|
26
|
+
attr_accessor :last_id
|
27
|
+
|
28
|
+
# @return [Boolean]
|
29
|
+
def next_page?
|
30
|
+
has_more
|
31
|
+
end
|
32
|
+
|
33
|
+
# @raise [OpenAI::HTTP::Error]
|
34
|
+
# @return [self]
|
35
|
+
def next_page
|
36
|
+
unless next_page?
|
37
|
+
message = "No more pages available. Please check #next_page? before calling ##{__method__}"
|
38
|
+
raise RuntimeError.new(message)
|
39
|
+
end
|
40
|
+
|
41
|
+
req = OpenAI::Internal::Util.deep_merge(@req, {query: {after: last_id}})
|
42
|
+
@client.request(req)
|
43
|
+
end
|
44
|
+
|
45
|
+
# @param blk [Proc]
|
46
|
+
#
|
47
|
+
# @yieldparam [generic<Elem>]
|
48
|
+
def auto_paging_each(&blk)
|
49
|
+
unless block_given?
|
50
|
+
raise ArgumentError.new("A block must be given to ##{__method__}")
|
51
|
+
end
|
52
|
+
|
53
|
+
page = self
|
54
|
+
loop do
|
55
|
+
page.data&.each(&blk)
|
56
|
+
|
57
|
+
break unless page.next_page?
|
58
|
+
page = page.next_page
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# @api private
|
63
|
+
#
|
64
|
+
# @param client [OpenAI::Internal::Transport::BaseClient]
|
65
|
+
# @param req [Hash{Symbol=>Object}]
|
66
|
+
# @param headers [Hash{String=>String}, Net::HTTPHeader]
|
67
|
+
# @param page_data [Hash{Symbol=>Object}]
|
68
|
+
def initialize(client:, req:, headers:, page_data:)
|
69
|
+
super
|
70
|
+
|
71
|
+
case page_data
|
72
|
+
in {data: Array => data}
|
73
|
+
@data = data.map { OpenAI::Internal::Type::Converter.coerce(@model, _1) }
|
74
|
+
else
|
75
|
+
end
|
76
|
+
@has_more = page_data[:has_more]
|
77
|
+
@last_id = page_data[:last_id]
|
78
|
+
end
|
79
|
+
|
80
|
+
# @api private
|
81
|
+
#
|
82
|
+
# @return [String]
|
83
|
+
def inspect
|
84
|
+
# rubocop:disable Layout/LineLength
|
85
|
+
model = OpenAI::Internal::Type::Converter.inspect(@model, depth: 1)
|
86
|
+
|
87
|
+
"#<#{self.class}[#{model}]:0x#{object_id.to_s(16)} has_more=#{has_more.inspect} last_id=#{last_id.inspect}>"
|
88
|
+
# rubocop:enable Layout/LineLength
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -539,10 +539,7 @@ module OpenAI
|
|
539
539
|
)
|
540
540
|
),
|
541
541
|
page: T.nilable(T::Class[OpenAI::Internal::Type::BasePage[OpenAI::Internal::Type::BaseModel]]),
|
542
|
-
stream: T.nilable(
|
543
|
-
T::Class[OpenAI::Internal::Type::BaseStream[T.anything,
|
544
|
-
OpenAI::Internal::Type::BaseModel]]
|
545
|
-
),
|
542
|
+
stream: T.nilable(T::Class[OpenAI::Internal::Type::BaseStream[T.anything, OpenAI::Internal::Type::BaseModel]]),
|
546
543
|
model: T.nilable(OpenAI::Internal::Type::Converter::Input),
|
547
544
|
options: T.nilable(OpenAI::RequestOptions::OrHash)
|
548
545
|
}
|
@@ -193,15 +193,7 @@ module OpenAI
|
|
193
193
|
end
|
194
194
|
|
195
195
|
define_sorbet_constant!(:Request) do
|
196
|
-
T.type_alias
|
197
|
-
{
|
198
|
-
method: Symbol,
|
199
|
-
url: URI::Generic,
|
200
|
-
headers: T::Hash[String, String],
|
201
|
-
body: T.anything,
|
202
|
-
deadline: Float
|
203
|
-
}
|
204
|
-
end
|
196
|
+
T.type_alias { {method: Symbol, url: URI::Generic, headers: T::Hash[String, String], body: T.anything, deadline: Float} }
|
205
197
|
end
|
206
198
|
end
|
207
199
|
end
|
data/lib/openai/internal/util.rb
CHANGED
@@ -244,7 +244,7 @@ module OpenAI
|
|
244
244
|
#
|
245
245
|
# @return [String]
|
246
246
|
def uri_origin(uri)
|
247
|
-
"#{uri.scheme}://#{uri.host}#{uri.port
|
247
|
+
"#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
|
248
248
|
end
|
249
249
|
|
250
250
|
# @api private
|
@@ -107,10 +107,7 @@ module OpenAI
|
|
107
107
|
# Details about the input tokens billed for this request.
|
108
108
|
#
|
109
109
|
# @return [OpenAI::Models::Audio::Transcription::Usage::Tokens::InputTokenDetails, nil]
|
110
|
-
optional :input_token_details,
|
111
|
-
-> {
|
112
|
-
OpenAI::Audio::Transcription::Usage::Tokens::InputTokenDetails
|
113
|
-
}
|
110
|
+
optional :input_token_details, -> { OpenAI::Audio::Transcription::Usage::Tokens::InputTokenDetails }
|
114
111
|
|
115
112
|
# @!method initialize(input_tokens:, output_tokens:, total_tokens:, input_token_details: nil, type: :tokens)
|
116
113
|
# Usage statistics for models billed by token usage.
|
@@ -90,9 +90,7 @@ module OpenAI
|
|
90
90
|
#
|
91
91
|
# @return [Array<Symbol, OpenAI::Models::Audio::TranscriptionCreateParams::TimestampGranularity>, nil]
|
92
92
|
optional :timestamp_granularities,
|
93
|
-
-> {
|
94
|
-
OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Audio::TranscriptionCreateParams::TimestampGranularity]
|
95
|
-
}
|
93
|
+
-> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Audio::TranscriptionCreateParams::TimestampGranularity] }
|
96
94
|
|
97
95
|
# @!method initialize(file:, model:, chunking_strategy: nil, include: nil, language: nil, prompt: nil, response_format: nil, temperature: nil, timestamp_granularities: nil, request_options: {})
|
98
96
|
# Some parameter documentations has been truncated, see
|
@@ -150,10 +148,7 @@ module OpenAI
|
|
150
148
|
# Must be set to `server_vad` to enable manual chunking using server side VAD.
|
151
149
|
#
|
152
150
|
# @return [Symbol, OpenAI::Models::Audio::TranscriptionCreateParams::ChunkingStrategy::VadConfig::Type]
|
153
|
-
required :type,
|
154
|
-
enum: -> {
|
155
|
-
OpenAI::Audio::TranscriptionCreateParams::ChunkingStrategy::VadConfig::Type
|
156
|
-
}
|
151
|
+
required :type, enum: -> { OpenAI::Audio::TranscriptionCreateParams::ChunkingStrategy::VadConfig::Type }
|
157
152
|
|
158
153
|
# @!attribute prefix_padding_ms
|
159
154
|
# Amount of audio to include before the VAD detected speech (in milliseconds).
|
@@ -109,10 +109,7 @@ module OpenAI
|
|
109
109
|
# Details about the input tokens billed for this request.
|
110
110
|
#
|
111
111
|
# @return [OpenAI::Models::Audio::TranscriptionTextDoneEvent::Usage::InputTokenDetails, nil]
|
112
|
-
optional :input_token_details,
|
113
|
-
-> {
|
114
|
-
OpenAI::Audio::TranscriptionTextDoneEvent::Usage::InputTokenDetails
|
115
|
-
}
|
112
|
+
optional :input_token_details, -> { OpenAI::Audio::TranscriptionTextDoneEvent::Usage::InputTokenDetails }
|
116
113
|
|
117
114
|
# @!method initialize(input_tokens:, output_tokens:, total_tokens:, input_token_details: nil, type: :tokens)
|
118
115
|
# Usage statistics for models billed by token usage.
|
@@ -48,7 +48,14 @@ module OpenAI
|
|
48
48
|
# @return [Hash{Symbol=>String}, nil]
|
49
49
|
optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true
|
50
50
|
|
51
|
-
# @!
|
51
|
+
# @!attribute output_expires_after
|
52
|
+
# The expiration policy for the output and/or error file that are generated for a
|
53
|
+
# batch.
|
54
|
+
#
|
55
|
+
# @return [OpenAI::Models::BatchCreateParams::OutputExpiresAfter, nil]
|
56
|
+
optional :output_expires_after, -> { OpenAI::BatchCreateParams::OutputExpiresAfter }
|
57
|
+
|
58
|
+
# @!method initialize(completion_window:, endpoint:, input_file_id:, metadata: nil, output_expires_after: nil, request_options: {})
|
52
59
|
# Some parameter documentations has been truncated, see
|
53
60
|
# {OpenAI::Models::BatchCreateParams} for more details.
|
54
61
|
#
|
@@ -60,6 +67,8 @@ module OpenAI
|
|
60
67
|
#
|
61
68
|
# @param metadata [Hash{Symbol=>String}, nil] Set of 16 key-value pairs that can be attached to an object. This can be
|
62
69
|
#
|
70
|
+
# @param output_expires_after [OpenAI::Models::BatchCreateParams::OutputExpiresAfter] The expiration policy for the output and/or error file that are generated for a
|
71
|
+
#
|
63
72
|
# @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
|
64
73
|
|
65
74
|
# The time frame within which the batch should be processed. Currently only `24h`
|
@@ -88,6 +97,34 @@ module OpenAI
|
|
88
97
|
# @!method self.values
|
89
98
|
# @return [Array<Symbol>]
|
90
99
|
end
|
100
|
+
|
101
|
+
class OutputExpiresAfter < OpenAI::Internal::Type::BaseModel
|
102
|
+
# @!attribute anchor
|
103
|
+
# Anchor timestamp after which the expiration policy applies. Supported anchors:
|
104
|
+
# `created_at`. Note that the anchor is the file creation time, not the time the
|
105
|
+
# batch is created.
|
106
|
+
#
|
107
|
+
# @return [Symbol, :created_at]
|
108
|
+
required :anchor, const: :created_at
|
109
|
+
|
110
|
+
# @!attribute seconds
|
111
|
+
# The number of seconds after the anchor time that the file will expire. Must be
|
112
|
+
# between 3600 (1 hour) and 2592000 (30 days).
|
113
|
+
#
|
114
|
+
# @return [Integer]
|
115
|
+
required :seconds, Integer
|
116
|
+
|
117
|
+
# @!method initialize(seconds:, anchor: :created_at)
|
118
|
+
# Some parameter documentations has been truncated, see
|
119
|
+
# {OpenAI::Models::BatchCreateParams::OutputExpiresAfter} for more details.
|
120
|
+
#
|
121
|
+
# The expiration policy for the output and/or error file that are generated for a
|
122
|
+
# batch.
|
123
|
+
#
|
124
|
+
# @param seconds [Integer] The number of seconds after the anchor time that the file will expire. Must be b
|
125
|
+
#
|
126
|
+
# @param anchor [Symbol, :created_at] Anchor timestamp after which the expiration policy applies. Supported anchors: `
|
127
|
+
end
|
91
128
|
end
|
92
129
|
end
|
93
130
|
end
|
@@ -167,10 +167,7 @@ module OpenAI
|
|
167
167
|
# @!attribute code_interpreter
|
168
168
|
#
|
169
169
|
# @return [OpenAI::Models::Beta::AssistantCreateParams::ToolResources::CodeInterpreter, nil]
|
170
|
-
optional :code_interpreter,
|
171
|
-
-> {
|
172
|
-
OpenAI::Beta::AssistantCreateParams::ToolResources::CodeInterpreter
|
173
|
-
}
|
170
|
+
optional :code_interpreter, -> { OpenAI::Beta::AssistantCreateParams::ToolResources::CodeInterpreter }
|
174
171
|
|
175
172
|
# @!attribute file_search
|
176
173
|
#
|
@@ -223,9 +220,7 @@ module OpenAI
|
|
223
220
|
#
|
224
221
|
# @return [Array<OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore>, nil]
|
225
222
|
optional :vector_stores,
|
226
|
-
-> {
|
227
|
-
OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore]
|
228
|
-
}
|
223
|
+
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore] }
|
229
224
|
|
230
225
|
# @!method initialize(vector_store_ids: nil, vector_stores: nil)
|
231
226
|
# Some parameter documentations has been truncated, see
|
@@ -243,9 +238,7 @@ module OpenAI
|
|
243
238
|
#
|
244
239
|
# @return [OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto, OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static, nil]
|
245
240
|
optional :chunking_strategy,
|
246
|
-
union: -> {
|
247
|
-
OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy
|
248
|
-
}
|
241
|
+
union: -> { OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy }
|
249
242
|
|
250
243
|
# @!attribute file_ids
|
251
244
|
# A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
|
@@ -288,14 +281,10 @@ module OpenAI
|
|
288
281
|
|
289
282
|
# The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`.
|
290
283
|
variant :auto,
|
291
|
-
-> {
|
292
|
-
OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto
|
293
|
-
}
|
284
|
+
-> { OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Auto }
|
294
285
|
|
295
286
|
variant :static,
|
296
|
-
-> {
|
297
|
-
OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static
|
298
|
-
}
|
287
|
+
-> { OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static }
|
299
288
|
|
300
289
|
class Auto < OpenAI::Internal::Type::BaseModel
|
301
290
|
# @!attribute type
|
@@ -316,9 +305,7 @@ module OpenAI
|
|
316
305
|
#
|
317
306
|
# @return [OpenAI::Models::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static]
|
318
307
|
required :static,
|
319
|
-
-> {
|
320
|
-
OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static
|
321
|
-
}
|
308
|
+
-> { OpenAI::Beta::AssistantCreateParams::ToolResources::FileSearch::VectorStore::ChunkingStrategy::Static::Static }
|
322
309
|
|
323
310
|
# @!attribute type
|
324
311
|
# Always `static`.
|
@@ -41,10 +41,7 @@ module OpenAI
|
|
41
41
|
variant :"thread.run.in_progress", -> { OpenAI::Beta::AssistantStreamEvent::ThreadRunInProgress }
|
42
42
|
|
43
43
|
# Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to a `requires_action` status.
|
44
|
-
variant :"thread.run.requires_action",
|
45
|
-
-> {
|
46
|
-
OpenAI::Beta::AssistantStreamEvent::ThreadRunRequiresAction
|
47
|
-
}
|
44
|
+
variant :"thread.run.requires_action", -> { OpenAI::Beta::AssistantStreamEvent::ThreadRunRequiresAction }
|
48
45
|
|
49
46
|
# Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) is completed.
|
50
47
|
variant :"thread.run.completed", -> { OpenAI::Beta::AssistantStreamEvent::ThreadRunCompleted }
|
@@ -68,28 +65,19 @@ module OpenAI
|
|
68
65
|
variant :"thread.run.step.created", -> { OpenAI::Beta::AssistantStreamEvent::ThreadRunStepCreated }
|
69
66
|
|
70
67
|
# Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) moves to an `in_progress` state.
|
71
|
-
variant :"thread.run.step.in_progress",
|
72
|
-
-> {
|
73
|
-
OpenAI::Beta::AssistantStreamEvent::ThreadRunStepInProgress
|
74
|
-
}
|
68
|
+
variant :"thread.run.step.in_progress", -> { OpenAI::Beta::AssistantStreamEvent::ThreadRunStepInProgress }
|
75
69
|
|
76
70
|
# Occurs when parts of a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) are being streamed.
|
77
71
|
variant :"thread.run.step.delta", -> { OpenAI::Beta::AssistantStreamEvent::ThreadRunStepDelta }
|
78
72
|
|
79
73
|
# Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is completed.
|
80
|
-
variant :"thread.run.step.completed",
|
81
|
-
-> {
|
82
|
-
OpenAI::Beta::AssistantStreamEvent::ThreadRunStepCompleted
|
83
|
-
}
|
74
|
+
variant :"thread.run.step.completed", -> { OpenAI::Beta::AssistantStreamEvent::ThreadRunStepCompleted }
|
84
75
|
|
85
76
|
# Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) fails.
|
86
77
|
variant :"thread.run.step.failed", -> { OpenAI::Beta::AssistantStreamEvent::ThreadRunStepFailed }
|
87
78
|
|
88
79
|
# Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is cancelled.
|
89
|
-
variant :"thread.run.step.cancelled",
|
90
|
-
-> {
|
91
|
-
OpenAI::Beta::AssistantStreamEvent::ThreadRunStepCancelled
|
92
|
-
}
|
80
|
+
variant :"thread.run.step.cancelled", -> { OpenAI::Beta::AssistantStreamEvent::ThreadRunStepCancelled }
|
93
81
|
|
94
82
|
# Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) expires.
|
95
83
|
variant :"thread.run.step.expired", -> { OpenAI::Beta::AssistantStreamEvent::ThreadRunStepExpired }
|
@@ -98,10 +86,7 @@ module OpenAI
|
|
98
86
|
variant :"thread.message.created", -> { OpenAI::Beta::AssistantStreamEvent::ThreadMessageCreated }
|
99
87
|
|
100
88
|
# Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) moves to an `in_progress` state.
|
101
|
-
variant :"thread.message.in_progress",
|
102
|
-
-> {
|
103
|
-
OpenAI::Beta::AssistantStreamEvent::ThreadMessageInProgress
|
104
|
-
}
|
89
|
+
variant :"thread.message.in_progress", -> { OpenAI::Beta::AssistantStreamEvent::ThreadMessageInProgress }
|
105
90
|
|
106
91
|
# Occurs when parts of a [Message](https://platform.openai.com/docs/api-reference/messages/object) are being streamed.
|
107
92
|
variant :"thread.message.delta", -> { OpenAI::Beta::AssistantStreamEvent::ThreadMessageDelta }
|
@@ -110,10 +95,7 @@ module OpenAI
|
|
110
95
|
variant :"thread.message.completed", -> { OpenAI::Beta::AssistantStreamEvent::ThreadMessageCompleted }
|
111
96
|
|
112
97
|
# Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) ends before it is completed.
|
113
|
-
variant :"thread.message.incomplete",
|
114
|
-
-> {
|
115
|
-
OpenAI::Beta::AssistantStreamEvent::ThreadMessageIncomplete
|
116
|
-
}
|
98
|
+
variant :"thread.message.incomplete", -> { OpenAI::Beta::AssistantStreamEvent::ThreadMessageIncomplete }
|
117
99
|
|
118
100
|
# Occurs when an [error](https://platform.openai.com/docs/guides/error-codes#api-errors) occurs. This can happen due to an internal server error or a timeout.
|
119
101
|
variant :error, -> { OpenAI::Beta::AssistantStreamEvent::ErrorEvent }
|
@@ -299,10 +299,7 @@ module OpenAI
|
|
299
299
|
# @!attribute code_interpreter
|
300
300
|
#
|
301
301
|
# @return [OpenAI::Models::Beta::AssistantUpdateParams::ToolResources::CodeInterpreter, nil]
|
302
|
-
optional :code_interpreter,
|
303
|
-
-> {
|
304
|
-
OpenAI::Beta::AssistantUpdateParams::ToolResources::CodeInterpreter
|
305
|
-
}
|
302
|
+
optional :code_interpreter, -> { OpenAI::Beta::AssistantUpdateParams::ToolResources::CodeInterpreter }
|
306
303
|
|
307
304
|
# @!attribute file_search
|
308
305
|
#
|
@@ -15,10 +15,7 @@ module OpenAI
|
|
15
15
|
variant :"thread.message.created", -> { OpenAI::Beta::MessageStreamEvent::ThreadMessageCreated }
|
16
16
|
|
17
17
|
# Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) moves to an `in_progress` state.
|
18
|
-
variant :"thread.message.in_progress",
|
19
|
-
-> {
|
20
|
-
OpenAI::Beta::MessageStreamEvent::ThreadMessageInProgress
|
21
|
-
}
|
18
|
+
variant :"thread.message.in_progress", -> { OpenAI::Beta::MessageStreamEvent::ThreadMessageInProgress }
|
22
19
|
|
23
20
|
# Occurs when parts of a [Message](https://platform.openai.com/docs/api-reference/messages/object) are being streamed.
|
24
21
|
variant :"thread.message.delta", -> { OpenAI::Beta::MessageStreamEvent::ThreadMessageDelta }
|
@@ -15,10 +15,7 @@ module OpenAI
|
|
15
15
|
variant :"thread.run.step.created", -> { OpenAI::Beta::RunStepStreamEvent::ThreadRunStepCreated }
|
16
16
|
|
17
17
|
# Occurs when a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) moves to an `in_progress` state.
|
18
|
-
variant :"thread.run.step.in_progress",
|
19
|
-
-> {
|
20
|
-
OpenAI::Beta::RunStepStreamEvent::ThreadRunStepInProgress
|
21
|
-
}
|
18
|
+
variant :"thread.run.step.in_progress", -> { OpenAI::Beta::RunStepStreamEvent::ThreadRunStepInProgress }
|
22
19
|
|
23
20
|
# Occurs when parts of a [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) are being streamed.
|
24
21
|
variant :"thread.run.step.delta", -> { OpenAI::Beta::RunStepStreamEvent::ThreadRunStepDelta }
|