openai 0.114.0 → 0.115.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 +36 -0
- data/README.md +17 -2
- data/docs/architecture/security-model.md +11 -16
- data/examples/responses/websocket_workflows.rb +78 -3
- data/lib/openai/helpers/chat/tool_runner.rb +1 -1
- data/lib/openai/helpers/live/websocket.rb +31 -0
- data/lib/openai/helpers/realtime/connection.rb +33 -0
- data/lib/openai/helpers/realtime/connection_manager.rb +1 -0
- data/lib/openai/helpers/realtime/conversation_item_variant_resolver.rb +5 -0
- data/lib/openai/helpers/realtime/recovery.rb +5 -1
- data/lib/openai/helpers/realtime/translation.rb +5 -0
- data/lib/openai/helpers/realtime/transports/async_websocket.rb +19 -0
- data/lib/openai/helpers/responses_websocket/connection.rb +53 -15
- data/lib/openai/helpers/responses_websocket/connection_manager.rb +1 -0
- data/lib/openai/helpers/responses_websocket/connection_resources.rb +1 -1
- data/lib/openai/helpers/structured_output/response_parser.rb +1 -0
- data/lib/openai/helpers/structured_output.rb +58 -0
- data/lib/openai/helpers/websocket/connection_manager.rb +11 -0
- data/lib/openai/helpers/websocket/resource.rb +1 -0
- data/lib/openai/helpers/websocket/typed_connection.rb +1 -0
- data/lib/openai/internal/type/array_of.rb +1 -1
- data/lib/openai/internal/type/hash_of.rb +1 -1
- data/lib/openai/internal/type/request_parameters.rb +2 -1
- data/lib/openai/internal/type/union.rb +18 -6
- data/lib/openai/models/admin/organization/external_key.rb +169 -0
- data/lib/openai/models/admin/organization/external_key_create_params.rb +311 -0
- data/lib/openai/models/admin/organization/external_key_delete_params.rb +24 -0
- data/lib/openai/models/admin/organization/external_key_list_params.rb +69 -0
- data/lib/openai/models/admin/organization/external_key_retrieve_params.rb +24 -0
- data/lib/openai/models/admin/organization/external_key_validate_params.rb +24 -0
- data/lib/openai/models/admin/organization/external_key_validate_response.rb +20 -0
- data/lib/openai/models/audio/speech_model.rb +12 -0
- data/lib/openai/models/audio_model.rb +15 -0
- data/lib/openai/models/beta/agent.rb +49 -1
- data/lib/openai/models/beta/agent_create_params.rb +51 -1
- data/lib/openai/models/beta/agent_session.rb +75 -2
- data/lib/openai/models/beta/agent_update_params.rb +62 -1
- data/lib/openai/models/beta/agents/session_create_params.rb +94 -2
- data/lib/openai/models/beta/agents/session_list_params.rb +16 -1
- data/lib/openai/models/beta/agents/session_update_params.rb +50 -5
- data/lib/openai/models/beta/assistant_update_params.rb +18 -0
- data/lib/openai/models/beta/beta_response.rb +224 -1
- data/lib/openai/models/beta/beta_response_configuration_update_item.rb +64 -3
- data/lib/openai/models/beta/beta_response_configuration_update_item_param.rb +64 -4
- data/lib/openai/models/beta/beta_response_input_item.rb +2 -3
- data/lib/openai/models/beta/beta_response_item.rb +2 -2
- data/lib/openai/models/beta/beta_response_tool_search_output_item_param.rb +6 -6
- data/lib/openai/models/beta/beta_responses_client_event.rb +20 -1
- data/lib/openai/models/beta/beta_tool.rb +6 -6
- data/lib/openai/models/beta/response_compact_params.rb +6 -0
- data/lib/openai/models/beta/response_create_params.rb +6 -0
- data/lib/openai/models/chat_model.rb +6 -0
- data/lib/openai/models/conversations/conversation_item.rb +2 -2
- data/lib/openai/models/image_edit_params.rb +46 -25
- data/lib/openai/models/live/fork_server_event.rb +43 -3
- data/lib/openai/models/live/server_event.rb +43 -3
- data/lib/openai/models/live/sideband_client_event.rb +40 -1
- data/lib/openai/models/live/sideband_server_event.rb +43 -3
- data/lib/openai/models/realtime/audio_transcription.rb +15 -0
- data/lib/openai/models/realtime/conversation_item_added.rb +2 -2
- data/lib/openai/models/realtime/conversation_item_create_event.rb +2 -2
- data/lib/openai/models/realtime/conversation_item_created_event.rb +2 -2
- data/lib/openai/models/realtime/conversation_item_done.rb +2 -2
- data/lib/openai/models/realtime/realtime_response.rb +2 -2
- data/lib/openai/models/realtime/realtime_response_create_params.rb +2 -2
- data/lib/openai/models/realtime/realtime_server_event.rb +2 -2
- data/lib/openai/models/realtime/realtime_session.rb +18 -0
- data/lib/openai/models/realtime/realtime_session_create_request.rb +18 -0
- data/lib/openai/models/realtime/realtime_session_create_response.rb +18 -0
- data/lib/openai/models/realtime/response_output_item_added_event.rb +2 -2
- data/lib/openai/models/realtime/response_output_item_done_event.rb +2 -2
- data/lib/openai/models/responses/response.rb +221 -1
- data/lib/openai/models/responses/response_compact_params.rb +6 -0
- data/lib/openai/models/responses/response_configuration_update_item.rb +50 -3
- data/lib/openai/models/responses/response_configuration_update_item_param.rb +50 -4
- data/lib/openai/models/responses/response_input_item.rb +2 -3
- data/lib/openai/models/responses/response_item.rb +2 -2
- data/lib/openai/models/responses/response_tool_search_output_item_param.rb +6 -6
- data/lib/openai/models/responses/responses_client_event.rb +14 -1
- data/lib/openai/models/responses/tool.rb +6 -6
- data/lib/openai/net_http_client.rb +6 -0
- data/lib/openai/providers/vertex.rb +0 -10
- data/lib/openai/resources/admin/organization/external_keys.rb +132 -0
- data/lib/openai/resources/admin/organization.rb +4 -0
- data/lib/openai/resources/audio/speech.rb +8 -0
- data/lib/openai/resources/audio/translations.rb +8 -0
- data/lib/openai/resources/beta/agents/sessions.rb +22 -6
- data/lib/openai/resources/beta/agents.rb +17 -2
- data/lib/openai/resources/images.rb +36 -18
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +8 -0
- data/rbi/openai/helpers/live/websocket.rbi +1 -12
- data/rbi/openai/helpers/realtime/connection.rbi +5 -0
- data/rbi/openai/helpers/realtime/transports/async_websocket.rbi +5 -0
- data/rbi/openai/helpers/responses_websocket/connection.rbi +7 -2
- data/rbi/openai/helpers/structured_output.rbi +10 -0
- data/rbi/openai/internal/type/array_of.rbi +1 -1
- data/rbi/openai/internal/type/hash_of.rbi +1 -1
- data/rbi/openai/internal/type/union.rbi +5 -0
- data/rbi/openai/models/admin/organization/external_key.rbi +301 -0
- data/rbi/openai/models/admin/organization/external_key_create_params.rbi +532 -0
- data/rbi/openai/models/admin/organization/external_key_delete_params.rbi +57 -0
- data/rbi/openai/models/admin/organization/external_key_list_params.rbi +129 -0
- data/rbi/openai/models/admin/organization/external_key_retrieve_params.rbi +57 -0
- data/rbi/openai/models/admin/organization/external_key_validate_params.rbi +57 -0
- data/rbi/openai/models/admin/organization/external_key_validate_response.rbi +50 -0
- data/rbi/openai/models/beta/agent.rbi +103 -1
- data/rbi/openai/models/beta/agent_create_params.rbi +109 -0
- data/rbi/openai/models/beta/agent_session.rbi +136 -3
- data/rbi/openai/models/beta/agent_update_params.rbi +120 -0
- data/rbi/openai/models/beta/agents/session_create_params.rbi +153 -0
- data/rbi/openai/models/beta/agents/session_list_params.rbi +19 -0
- data/rbi/openai/models/beta/agents/session_update_params.rbi +94 -6
- data/rbi/openai/models/beta/beta_response.rbi +394 -0
- data/rbi/openai/models/beta/beta_response_configuration_update_item.rbi +113 -3
- data/rbi/openai/models/beta/beta_response_configuration_update_item_param.rbi +125 -4
- data/rbi/openai/models/beta/beta_response_tool_search_output_item_param.rbi +6 -6
- data/rbi/openai/models/beta/beta_responses_client_event.rbi +17 -0
- data/rbi/openai/models/beta/beta_tool.rbi +6 -6
- data/rbi/openai/models/decision_create_params.rbi +4 -1
- data/rbi/openai/models/image_edit_params.rbi +49 -24
- data/rbi/openai/models/live/fork_server_event.rbi +65 -1
- data/rbi/openai/models/live/server_event.rbi +65 -1
- data/rbi/openai/models/live/sideband_client_event.rbi +60 -0
- data/rbi/openai/models/live/sideband_server_event.rbi +65 -1
- data/rbi/openai/models/realtime/conversation_item_added.rbi +6 -3
- data/rbi/openai/models/realtime/conversation_item_create_event.rbi +6 -3
- data/rbi/openai/models/realtime/conversation_item_created_event.rbi +6 -3
- data/rbi/openai/models/realtime/conversation_item_done.rbi +6 -3
- data/rbi/openai/models/realtime/realtime_response.rbi +8 -4
- data/rbi/openai/models/realtime/realtime_response_create_params.rbi +8 -4
- data/rbi/openai/models/realtime/realtime_server_event.rbi +6 -3
- data/rbi/openai/models/realtime/response_output_item_added_event.rbi +6 -3
- data/rbi/openai/models/realtime/response_output_item_done_event.rbi +6 -3
- data/rbi/openai/models/responses/response.rbi +394 -0
- data/rbi/openai/models/responses/response_configuration_update_item.rbi +76 -3
- data/rbi/openai/models/responses/response_configuration_update_item_param.rbi +74 -4
- data/rbi/openai/models/responses/response_tool_search_output_item_param.rbi +6 -6
- data/rbi/openai/models/responses/responses_client_event.rbi +17 -0
- data/rbi/openai/models/responses/tool.rbi +6 -6
- data/rbi/openai/net_http_client.rbi +5 -0
- data/rbi/openai/resources/admin/organization/external_keys.rbi +86 -0
- data/rbi/openai/resources/admin/organization.rbi +3 -0
- data/rbi/openai/resources/audio/speech.rbi +8 -0
- data/rbi/openai/resources/audio/translations.rbi +6 -0
- data/rbi/openai/resources/beta/agents/sessions.rbi +18 -2
- data/rbi/openai/resources/beta/agents.rbi +15 -0
- data/rbi/openai/resources/images.rbi +34 -16
- data/rbi/openai/resources/responses.rbi +2 -0
- data/realtime.md +6 -0
- data/responses-websocket.md +53 -0
- data/sig/openai/helpers/live/websocket.rbs +1 -9
- data/sig/openai/helpers/realtime/connection.rbs +3 -0
- data/sig/openai/helpers/realtime/transports/async_websocket.rbs +3 -0
- data/sig/openai/helpers/responses_websocket/connection.rbs +7 -1
- data/sig/openai/helpers/structured_output.rbs +9 -0
- data/sig/openai/internal/type/union.rbs +4 -0
- data/sig/openai/models/admin/organization/external_key.rbs +186 -0
- data/sig/openai/models/admin/organization/external_key_create_params.rbs +423 -0
- data/sig/openai/models/admin/organization/external_key_delete_params.rbs +27 -0
- data/sig/openai/models/admin/organization/external_key_list_params.rbs +81 -0
- data/sig/openai/models/admin/organization/external_key_retrieve_params.rbs +27 -0
- data/sig/openai/models/admin/organization/external_key_validate_params.rbs +27 -0
- data/sig/openai/models/admin/organization/external_key_validate_response.rbs +17 -0
- data/sig/openai/models/admin/organization/external_storage_create_params.rbs +72 -2
- data/sig/openai/models/audio/speech_create_params.rbs +15 -2
- data/sig/openai/models/audio/transcription_create_params.rbs +30 -2
- data/sig/openai/models/audio/voice_create_params.rbs +47 -2
- data/sig/openai/models/beta/agent.rbs +54 -2
- data/sig/openai/models/beta/agent_create_params.rbs +54 -0
- data/sig/openai/models/beta/agent_session.rbs +82 -3
- data/sig/openai/models/beta/agent_update_params.rbs +64 -0
- data/sig/openai/models/beta/agents/session_create_params.rbs +91 -0
- data/sig/openai/models/beta/agents/session_list_params.rbs +20 -0
- data/sig/openai/models/beta/agents/session_update_params.rbs +48 -6
- data/sig/openai/models/beta/assistant_create_params.rbs +5 -2
- data/sig/openai/models/beta/beta_response.rbs +223 -0
- data/sig/openai/models/beta/beta_response_configuration_update_item.rbs +58 -2
- data/sig/openai/models/beta/beta_response_configuration_update_item_param.rbs +58 -2
- data/sig/openai/models/beta/beta_response_tool_search_output_item_param.rbs +4 -4
- data/sig/openai/models/beta/beta_responses_client_event.rbs +17 -0
- data/sig/openai/models/beta/beta_tool.rbs +4 -4
- data/sig/openai/models/beta/response_create_params.rbs +5 -2
- data/sig/openai/models/beta/responses/input_token_count_params.rbs +10 -2
- data/sig/openai/models/beta/thread_create_and_run_params.rbs +11 -5
- data/sig/openai/models/beta/thread_create_params.rbs +11 -5
- data/sig/openai/models/beta/threads/message_create_params.rbs +6 -3
- data/sig/openai/models/beta/threads/run_create_params.rbs +6 -3
- data/sig/openai/models/decision_create_params.rbs +27 -2
- data/sig/openai/models/eval_create_params.rbs +25 -4
- data/sig/openai/models/evals/run_create_params.rbs +52 -8
- data/sig/openai/models/image_edit_params.rbs +47 -16
- data/sig/openai/models/live/fork_server_event.rbs +39 -0
- data/sig/openai/models/live/server_event.rbs +39 -0
- data/sig/openai/models/live/session_accept_params.rbs +39 -2
- data/sig/openai/models/live/sideband_client_event.rbs +32 -0
- data/sig/openai/models/live/sideband_server_event.rbs +39 -0
- data/sig/openai/models/realtime/conversation_item.rbs +1 -0
- data/sig/openai/models/responses/input_token_count_params.rbs +10 -2
- data/sig/openai/models/responses/response.rbs +223 -0
- data/sig/openai/models/responses/response_configuration_update_item.rbs +45 -2
- data/sig/openai/models/responses/response_configuration_update_item_param.rbs +45 -2
- data/sig/openai/models/responses/response_create_params.rbs +5 -2
- data/sig/openai/models/responses/response_tool_search_output_item_param.rbs +4 -4
- data/sig/openai/models/responses/responses_client_event.rbs +17 -0
- data/sig/openai/models/responses/tool.rbs +4 -4
- data/sig/openai/models/video_edit_params.rbs +11 -2
- data/sig/openai/models/video_extend_params.rbs +11 -2
- data/sig/openai/net_http_client.rbs +3 -0
- data/sig/openai/resources/admin/organization/external_keys.rbs +70 -0
- data/sig/openai/resources/admin/organization/external_storage.rbs +23 -1
- data/sig/openai/resources/admin/organization.rbs +2 -0
- data/sig/openai/resources/audio/speech.rbs +2 -1
- data/sig/openai/resources/audio/transcriptions.rbs +14 -2
- data/sig/openai/resources/audio/voices.rbs +14 -1
- data/sig/openai/resources/beta/agents/sessions.rbs +4 -0
- data/sig/openai/resources/beta/agents.rbs +4 -0
- data/sig/openai/resources/beta/responses/input_tokens.rbs +2 -1
- data/sig/openai/resources/beta/responses.rbs +4 -2
- data/sig/openai/resources/decisions.rbs +7 -1
- data/sig/openai/resources/images.rbs +2 -0
- data/sig/openai/resources/responses/input_tokens.rbs +2 -1
- data/sig/openai/resources/responses.rbs +5 -2
- data/sig/openai/resources/videos.rbs +2 -2
- metadata +25 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Admin
|
|
7
|
+
|
|
8
|
+
module Organization
|
|
9
|
+
|
|
10
|
+
class ExternalKeyRetrieveParams < OpenAI::Internal::Type::BaseModel
|
|
11
|
+
|
|
12
|
+
extend OpenAI::Internal::Type::RequestParameters::Converter
|
|
13
|
+
include OpenAI::Internal::Type::RequestParameters
|
|
14
|
+
|
|
15
|
+
OrHash = T.type_alias do
|
|
16
|
+
T.any(
|
|
17
|
+
OpenAI::Admin::Organization::ExternalKeyRetrieveParams,
|
|
18
|
+
OpenAI::Internal::AnyHash
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
sig { returns(String) }
|
|
23
|
+
attr_accessor :external_key_id
|
|
24
|
+
|
|
25
|
+
sig do
|
|
26
|
+
params(
|
|
27
|
+
|
|
28
|
+
external_key_id: String,
|
|
29
|
+
|
|
30
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
31
|
+
)
|
|
32
|
+
.returns(T.attached_class)
|
|
33
|
+
end
|
|
34
|
+
def self.new(
|
|
35
|
+
|
|
36
|
+
external_key_id:,
|
|
37
|
+
|
|
38
|
+
request_options: {}
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
sig do
|
|
43
|
+
override.returns(
|
|
44
|
+
{external_key_id: String, request_options: OpenAI::RequestOptions}
|
|
45
|
+
)
|
|
46
|
+
end
|
|
47
|
+
def to_hash
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Admin
|
|
7
|
+
|
|
8
|
+
module Organization
|
|
9
|
+
|
|
10
|
+
class ExternalKeyValidateParams < OpenAI::Internal::Type::BaseModel
|
|
11
|
+
|
|
12
|
+
extend OpenAI::Internal::Type::RequestParameters::Converter
|
|
13
|
+
include OpenAI::Internal::Type::RequestParameters
|
|
14
|
+
|
|
15
|
+
OrHash = T.type_alias do
|
|
16
|
+
T.any(
|
|
17
|
+
OpenAI::Admin::Organization::ExternalKeyValidateParams,
|
|
18
|
+
OpenAI::Internal::AnyHash
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
sig { returns(String) }
|
|
23
|
+
attr_accessor :external_key_id
|
|
24
|
+
|
|
25
|
+
sig do
|
|
26
|
+
params(
|
|
27
|
+
|
|
28
|
+
external_key_id: String,
|
|
29
|
+
|
|
30
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
31
|
+
)
|
|
32
|
+
.returns(T.attached_class)
|
|
33
|
+
end
|
|
34
|
+
def self.new(
|
|
35
|
+
|
|
36
|
+
external_key_id:,
|
|
37
|
+
|
|
38
|
+
request_options: {}
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
sig do
|
|
43
|
+
override.returns(
|
|
44
|
+
{external_key_id: String, request_options: OpenAI::RequestOptions}
|
|
45
|
+
)
|
|
46
|
+
end
|
|
47
|
+
def to_hash
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Admin
|
|
7
|
+
|
|
8
|
+
module Organization
|
|
9
|
+
|
|
10
|
+
class ExternalKeyValidateResponse < OpenAI::Internal::Type::BaseModel
|
|
11
|
+
|
|
12
|
+
OrHash = T.type_alias do
|
|
13
|
+
T.any(
|
|
14
|
+
OpenAI::Models::Admin::Organization::ExternalKeyValidateResponse,
|
|
15
|
+
OpenAI::Internal::AnyHash
|
|
16
|
+
)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :status
|
|
21
|
+
|
|
22
|
+
sig do
|
|
23
|
+
params(
|
|
24
|
+
|
|
25
|
+
status: String
|
|
26
|
+
)
|
|
27
|
+
.returns(T.attached_class)
|
|
28
|
+
end
|
|
29
|
+
def self.new(
|
|
30
|
+
|
|
31
|
+
status:
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
sig do
|
|
36
|
+
override.returns(
|
|
37
|
+
{status: String}
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
def to_hash
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -76,6 +76,20 @@ module OpenAI
|
|
|
76
76
|
sig { returns(Integer) }
|
|
77
77
|
attr_accessor :updated_at
|
|
78
78
|
|
|
79
|
+
# The effective context compaction settings.
|
|
80
|
+
sig { returns(T.nilable(OpenAI::Beta::Agent::Compaction)) }
|
|
81
|
+
attr_reader :compaction
|
|
82
|
+
|
|
83
|
+
sig { params(compaction: OpenAI::Beta::Agent::Compaction::OrHash).void }
|
|
84
|
+
attr_writer :compaction
|
|
85
|
+
|
|
86
|
+
# The effective experimental settings for the agent.
|
|
87
|
+
sig { returns(T.nilable(OpenAI::Beta::Agent::Experimental)) }
|
|
88
|
+
attr_reader :experimental
|
|
89
|
+
|
|
90
|
+
sig { params(experimental: OpenAI::Beta::Agent::Experimental::OrHash).void }
|
|
91
|
+
attr_writer :experimental
|
|
92
|
+
|
|
79
93
|
# A reusable agent scoped to the caller's project.
|
|
80
94
|
sig do
|
|
81
95
|
params(
|
|
@@ -114,6 +128,10 @@ module OpenAI
|
|
|
114
128
|
|
|
115
129
|
updated_at: Integer,
|
|
116
130
|
|
|
131
|
+
compaction: OpenAI::Beta::Agent::Compaction::OrHash,
|
|
132
|
+
|
|
133
|
+
experimental: OpenAI::Beta::Agent::Experimental::OrHash,
|
|
134
|
+
|
|
117
135
|
object: Symbol
|
|
118
136
|
)
|
|
119
137
|
.returns(T.attached_class)
|
|
@@ -157,6 +175,12 @@ module OpenAI
|
|
|
157
175
|
# The Unix timestamp, in seconds, when the agent was last updated.
|
|
158
176
|
updated_at:,
|
|
159
177
|
|
|
178
|
+
# The effective context compaction settings.
|
|
179
|
+
compaction: nil,
|
|
180
|
+
|
|
181
|
+
# The effective experimental settings for the agent.
|
|
182
|
+
experimental: nil,
|
|
183
|
+
|
|
160
184
|
# The object type. Always `agent`.
|
|
161
185
|
|
|
162
186
|
object: :agent
|
|
@@ -178,7 +202,9 @@ module OpenAI
|
|
|
178
202
|
service_tier: OpenAI::Beta::Agent::ServiceTier::TaggedSymbol,
|
|
179
203
|
text: OpenAI::Beta::AgentText,
|
|
180
204
|
tools: T::Array[OpenAI::Beta::PersistedAgentTool::Variants],
|
|
181
|
-
updated_at: Integer
|
|
205
|
+
updated_at: Integer,
|
|
206
|
+
compaction: OpenAI::Beta::Agent::Compaction,
|
|
207
|
+
experimental: OpenAI::Beta::Agent::Experimental
|
|
182
208
|
}
|
|
183
209
|
)
|
|
184
210
|
end
|
|
@@ -204,6 +230,82 @@ module OpenAI
|
|
|
204
230
|
end
|
|
205
231
|
end
|
|
206
232
|
|
|
233
|
+
class Compaction < OpenAI::Internal::Type::BaseModel
|
|
234
|
+
OrHash = T.type_alias do
|
|
235
|
+
T.any(
|
|
236
|
+
OpenAI::Beta::Agent::Compaction,
|
|
237
|
+
OpenAI::Internal::AnyHash
|
|
238
|
+
)
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Whether context is compacted in the background. Defaults to true.
|
|
242
|
+
sig { returns(T::Boolean) }
|
|
243
|
+
attr_accessor :async
|
|
244
|
+
|
|
245
|
+
# The effective context compaction settings.
|
|
246
|
+
sig do
|
|
247
|
+
params(
|
|
248
|
+
|
|
249
|
+
async: T::Boolean
|
|
250
|
+
)
|
|
251
|
+
.returns(T.attached_class)
|
|
252
|
+
end
|
|
253
|
+
def self.new(
|
|
254
|
+
|
|
255
|
+
# Whether context is compacted in the background. Defaults to true.
|
|
256
|
+
|
|
257
|
+
async:
|
|
258
|
+
)
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
sig do
|
|
262
|
+
override.returns(
|
|
263
|
+
{async: T::Boolean}
|
|
264
|
+
)
|
|
265
|
+
end
|
|
266
|
+
def to_hash
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
class Experimental < OpenAI::Internal::Type::BaseModel
|
|
272
|
+
OrHash = T.type_alias do
|
|
273
|
+
T.any(
|
|
274
|
+
OpenAI::Beta::Agent::Experimental,
|
|
275
|
+
OpenAI::Internal::AnyHash
|
|
276
|
+
)
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# Whether the model receives periodic current-time reminders.
|
|
280
|
+
sig { returns(T::Boolean) }
|
|
281
|
+
attr_accessor :time_awareness
|
|
282
|
+
|
|
283
|
+
# The effective experimental settings for the agent.
|
|
284
|
+
sig do
|
|
285
|
+
params(
|
|
286
|
+
|
|
287
|
+
time_awareness: T::Boolean
|
|
288
|
+
)
|
|
289
|
+
.returns(T.attached_class)
|
|
290
|
+
end
|
|
291
|
+
def self.new(
|
|
292
|
+
|
|
293
|
+
# Whether the model receives periodic current-time reminders.
|
|
294
|
+
|
|
295
|
+
time_awareness:
|
|
296
|
+
)
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
sig do
|
|
300
|
+
override.returns(
|
|
301
|
+
{time_awareness: T::Boolean}
|
|
302
|
+
)
|
|
303
|
+
end
|
|
304
|
+
def to_hash
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
end
|
|
308
|
+
|
|
207
309
|
end
|
|
208
310
|
|
|
209
311
|
end
|
|
@@ -21,6 +21,20 @@ module OpenAI
|
|
|
21
21
|
sig { returns(String) }
|
|
22
22
|
attr_accessor :model
|
|
23
23
|
|
|
24
|
+
# Context compaction settings. Omission or null enables background compaction.
|
|
25
|
+
sig { returns(T.nilable(OpenAI::Beta::AgentCreateParams::Compaction)) }
|
|
26
|
+
attr_reader :compaction
|
|
27
|
+
|
|
28
|
+
sig { params(compaction: T.nilable(OpenAI::Beta::AgentCreateParams::Compaction::OrHash)).void }
|
|
29
|
+
attr_writer :compaction
|
|
30
|
+
|
|
31
|
+
# Experimental agent settings. All experimental features default to disabled.
|
|
32
|
+
sig { returns(T.nilable(OpenAI::Beta::AgentCreateParams::Experimental)) }
|
|
33
|
+
attr_reader :experimental
|
|
34
|
+
|
|
35
|
+
sig { params(experimental: OpenAI::Beta::AgentCreateParams::Experimental::OrHash).void }
|
|
36
|
+
attr_writer :experimental
|
|
37
|
+
|
|
24
38
|
# Additional instructions appended to the agent's default base instructions. Omit
|
|
25
39
|
# or set to null to add no custom instructions.
|
|
26
40
|
sig { returns(T.nilable(String)) }
|
|
@@ -88,6 +102,10 @@ module OpenAI
|
|
|
88
102
|
|
|
89
103
|
model: String,
|
|
90
104
|
|
|
105
|
+
compaction: T.nilable(OpenAI::Beta::AgentCreateParams::Compaction::OrHash),
|
|
106
|
+
|
|
107
|
+
experimental: OpenAI::Beta::AgentCreateParams::Experimental::OrHash,
|
|
108
|
+
|
|
91
109
|
instructions: T.nilable(String),
|
|
92
110
|
|
|
93
111
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
@@ -125,6 +143,12 @@ module OpenAI
|
|
|
125
143
|
# The model to use for the agent. The requested model name is preserved.
|
|
126
144
|
model:,
|
|
127
145
|
|
|
146
|
+
# Context compaction settings. Omission or null enables background compaction.
|
|
147
|
+
compaction: nil,
|
|
148
|
+
|
|
149
|
+
# Experimental agent settings. All experimental features default to disabled.
|
|
150
|
+
experimental: nil,
|
|
151
|
+
|
|
128
152
|
# Additional instructions appended to the agent's default base instructions. Omit
|
|
129
153
|
# or set to null to add no custom instructions.
|
|
130
154
|
instructions: nil,
|
|
@@ -162,6 +186,8 @@ module OpenAI
|
|
|
162
186
|
override.returns(
|
|
163
187
|
{
|
|
164
188
|
model: String,
|
|
189
|
+
compaction: T.nilable(OpenAI::Beta::AgentCreateParams::Compaction),
|
|
190
|
+
experimental: OpenAI::Beta::AgentCreateParams::Experimental,
|
|
165
191
|
instructions: T.nilable(String),
|
|
166
192
|
metadata: T.nilable(T::Hash[Symbol, String]),
|
|
167
193
|
multi_agent: T.nilable(OpenAI::Beta::MultiAgentConfigParam),
|
|
@@ -189,6 +215,89 @@ module OpenAI
|
|
|
189
215
|
def to_hash
|
|
190
216
|
end
|
|
191
217
|
|
|
218
|
+
class Compaction < OpenAI::Internal::Type::BaseModel
|
|
219
|
+
OrHash = T.type_alias do
|
|
220
|
+
T.any(
|
|
221
|
+
OpenAI::Beta::AgentCreateParams::Compaction,
|
|
222
|
+
OpenAI::Internal::AnyHash
|
|
223
|
+
)
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Whether to compact context in the background. Omission or null defaults to true.
|
|
227
|
+
# Set to false to use blocking compaction. Background compaction may increase
|
|
228
|
+
# token usage.
|
|
229
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
230
|
+
attr_accessor :async
|
|
231
|
+
|
|
232
|
+
# Context compaction settings. Omission or null enables background compaction.
|
|
233
|
+
sig do
|
|
234
|
+
params(
|
|
235
|
+
|
|
236
|
+
async: T.nilable(T::Boolean)
|
|
237
|
+
)
|
|
238
|
+
.returns(T.attached_class)
|
|
239
|
+
end
|
|
240
|
+
def self.new(
|
|
241
|
+
|
|
242
|
+
# Whether to compact context in the background. Omission or null defaults to true.
|
|
243
|
+
# Set to false to use blocking compaction. Background compaction may increase
|
|
244
|
+
# token usage.
|
|
245
|
+
|
|
246
|
+
async: nil
|
|
247
|
+
)
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
sig do
|
|
251
|
+
override.returns(
|
|
252
|
+
{async: T.nilable(T::Boolean)}
|
|
253
|
+
)
|
|
254
|
+
end
|
|
255
|
+
def to_hash
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
class Experimental < OpenAI::Internal::Type::BaseModel
|
|
261
|
+
OrHash = T.type_alias do
|
|
262
|
+
T.any(
|
|
263
|
+
OpenAI::Beta::AgentCreateParams::Experimental,
|
|
264
|
+
OpenAI::Internal::AnyHash
|
|
265
|
+
)
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Whether to give the model periodic current-time reminders. Defaults to false.
|
|
269
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
270
|
+
attr_reader :time_awareness
|
|
271
|
+
|
|
272
|
+
sig { params(time_awareness: T::Boolean).void }
|
|
273
|
+
attr_writer :time_awareness
|
|
274
|
+
|
|
275
|
+
# Experimental agent settings. All experimental features default to disabled.
|
|
276
|
+
sig do
|
|
277
|
+
params(
|
|
278
|
+
|
|
279
|
+
time_awareness: T::Boolean
|
|
280
|
+
)
|
|
281
|
+
.returns(T.attached_class)
|
|
282
|
+
end
|
|
283
|
+
def self.new(
|
|
284
|
+
|
|
285
|
+
# Whether to give the model periodic current-time reminders. Defaults to false.
|
|
286
|
+
|
|
287
|
+
time_awareness: nil
|
|
288
|
+
)
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
sig do
|
|
292
|
+
override.returns(
|
|
293
|
+
{time_awareness: T::Boolean}
|
|
294
|
+
)
|
|
295
|
+
end
|
|
296
|
+
def to_hash
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
end
|
|
300
|
+
|
|
192
301
|
# The service tier used for model requests. Defaults to `auto`.
|
|
193
302
|
module ServiceTier
|
|
194
303
|
extend OpenAI::Internal::Type::Enum
|
|
@@ -69,6 +69,14 @@ module OpenAI
|
|
|
69
69
|
sig { returns(T::Array[String]) }
|
|
70
70
|
attr_accessor :vault_ids
|
|
71
71
|
|
|
72
|
+
# Review applied to eligible actions in this session. Omitted when review is none
|
|
73
|
+
# and automatic review is not enabled. Omission means none.
|
|
74
|
+
sig { returns(T.nilable(OpenAI::Beta::AgentSession::Review::TaggedSymbol)) }
|
|
75
|
+
attr_reader :review
|
|
76
|
+
|
|
77
|
+
sig { params(review: OpenAI::Beta::AgentSession::Review::OrSymbol).void }
|
|
78
|
+
attr_writer :review
|
|
79
|
+
|
|
72
80
|
# Configured spending limit and best-effort consumption, in USD cents. Unlimited
|
|
73
81
|
# sessions omit this object.
|
|
74
82
|
sig { returns(T.nilable(OpenAI::Beta::AgentSession::SpendControl)) }
|
|
@@ -113,6 +121,8 @@ module OpenAI
|
|
|
113
121
|
|
|
114
122
|
vault_ids: T::Array[String],
|
|
115
123
|
|
|
124
|
+
review: OpenAI::Beta::AgentSession::Review::OrSymbol,
|
|
125
|
+
|
|
116
126
|
spend_control: OpenAI::Beta::AgentSession::SpendControl::OrHash,
|
|
117
127
|
|
|
118
128
|
object: Symbol
|
|
@@ -155,6 +165,10 @@ module OpenAI
|
|
|
155
165
|
# The IDs of vaults made available to the session.
|
|
156
166
|
vault_ids:,
|
|
157
167
|
|
|
168
|
+
# Review applied to eligible actions in this session. Omitted when review is none
|
|
169
|
+
# and automatic review is not enabled. Omission means none.
|
|
170
|
+
review: nil,
|
|
171
|
+
|
|
158
172
|
# Configured spending limit and best-effort consumption, in USD cents. Unlimited
|
|
159
173
|
# sessions omit this object.
|
|
160
174
|
spend_control: nil,
|
|
@@ -180,6 +194,7 @@ module OpenAI
|
|
|
180
194
|
status: OpenAI::Beta::AgentSession::Status::TaggedSymbol,
|
|
181
195
|
usage: T.nilable(OpenAI::Beta::TokenUsage),
|
|
182
196
|
vault_ids: T::Array[String],
|
|
197
|
+
review: OpenAI::Beta::AgentSession::Review::TaggedSymbol,
|
|
183
198
|
spend_control: OpenAI::Beta::AgentSession::SpendControl
|
|
184
199
|
}
|
|
185
200
|
)
|
|
@@ -241,6 +256,20 @@ module OpenAI
|
|
|
241
256
|
sig { returns(T::Array[OpenAI::Beta::AgentTool::Variants]) }
|
|
242
257
|
attr_accessor :tools
|
|
243
258
|
|
|
259
|
+
# The effective context compaction settings.
|
|
260
|
+
sig { returns(T.nilable(OpenAI::Beta::AgentSession::Agent::Compaction)) }
|
|
261
|
+
attr_reader :compaction
|
|
262
|
+
|
|
263
|
+
sig { params(compaction: OpenAI::Beta::AgentSession::Agent::Compaction::OrHash).void }
|
|
264
|
+
attr_writer :compaction
|
|
265
|
+
|
|
266
|
+
# The effective experimental settings for the agent.
|
|
267
|
+
sig { returns(T.nilable(OpenAI::Beta::AgentSession::Agent::Experimental)) }
|
|
268
|
+
attr_reader :experimental
|
|
269
|
+
|
|
270
|
+
sig { params(experimental: OpenAI::Beta::AgentSession::Agent::Experimental::OrHash).void }
|
|
271
|
+
attr_writer :experimental
|
|
272
|
+
|
|
244
273
|
# The agent running in the session.
|
|
245
274
|
sig do
|
|
246
275
|
params(
|
|
@@ -270,7 +299,11 @@ module OpenAI
|
|
|
270
299
|
OpenAI::Beta::AgentTool::ComputerUse::OrHash,
|
|
271
300
|
OpenAI::Beta::AgentTool::Automations::OrHash
|
|
272
301
|
)
|
|
273
|
-
]
|
|
302
|
+
],
|
|
303
|
+
|
|
304
|
+
compaction: OpenAI::Beta::AgentSession::Agent::Compaction::OrHash,
|
|
305
|
+
|
|
306
|
+
experimental: OpenAI::Beta::AgentSession::Agent::Experimental::OrHash
|
|
274
307
|
)
|
|
275
308
|
.returns(T.attached_class)
|
|
276
309
|
end
|
|
@@ -302,8 +335,14 @@ module OpenAI
|
|
|
302
335
|
text:,
|
|
303
336
|
|
|
304
337
|
# Tools available to the agent.
|
|
338
|
+
tools:,
|
|
305
339
|
|
|
306
|
-
|
|
340
|
+
# The effective context compaction settings.
|
|
341
|
+
compaction: nil,
|
|
342
|
+
|
|
343
|
+
# The effective experimental settings for the agent.
|
|
344
|
+
|
|
345
|
+
experimental: nil
|
|
307
346
|
)
|
|
308
347
|
end
|
|
309
348
|
|
|
@@ -318,7 +357,9 @@ module OpenAI
|
|
|
318
357
|
reasoning: OpenAI::Beta::AgentReasoning,
|
|
319
358
|
service_tier: OpenAI::Beta::AgentSession::Agent::ServiceTier::TaggedSymbol,
|
|
320
359
|
text: OpenAI::Beta::AgentText,
|
|
321
|
-
tools: T::Array[OpenAI::Beta::AgentTool::Variants]
|
|
360
|
+
tools: T::Array[OpenAI::Beta::AgentTool::Variants],
|
|
361
|
+
compaction: OpenAI::Beta::AgentSession::Agent::Compaction,
|
|
362
|
+
experimental: OpenAI::Beta::AgentSession::Agent::Experimental
|
|
322
363
|
}
|
|
323
364
|
)
|
|
324
365
|
end
|
|
@@ -343,6 +384,82 @@ module OpenAI
|
|
|
343
384
|
def self.values
|
|
344
385
|
end
|
|
345
386
|
end
|
|
387
|
+
|
|
388
|
+
class Compaction < OpenAI::Internal::Type::BaseModel
|
|
389
|
+
OrHash = T.type_alias do
|
|
390
|
+
T.any(
|
|
391
|
+
OpenAI::Beta::AgentSession::Agent::Compaction,
|
|
392
|
+
OpenAI::Internal::AnyHash
|
|
393
|
+
)
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
# Whether context is compacted in the background. Defaults to true.
|
|
397
|
+
sig { returns(T::Boolean) }
|
|
398
|
+
attr_accessor :async
|
|
399
|
+
|
|
400
|
+
# The effective context compaction settings.
|
|
401
|
+
sig do
|
|
402
|
+
params(
|
|
403
|
+
|
|
404
|
+
async: T::Boolean
|
|
405
|
+
)
|
|
406
|
+
.returns(T.attached_class)
|
|
407
|
+
end
|
|
408
|
+
def self.new(
|
|
409
|
+
|
|
410
|
+
# Whether context is compacted in the background. Defaults to true.
|
|
411
|
+
|
|
412
|
+
async:
|
|
413
|
+
)
|
|
414
|
+
end
|
|
415
|
+
|
|
416
|
+
sig do
|
|
417
|
+
override.returns(
|
|
418
|
+
{async: T::Boolean}
|
|
419
|
+
)
|
|
420
|
+
end
|
|
421
|
+
def to_hash
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
end
|
|
425
|
+
|
|
426
|
+
class Experimental < OpenAI::Internal::Type::BaseModel
|
|
427
|
+
OrHash = T.type_alias do
|
|
428
|
+
T.any(
|
|
429
|
+
OpenAI::Beta::AgentSession::Agent::Experimental,
|
|
430
|
+
OpenAI::Internal::AnyHash
|
|
431
|
+
)
|
|
432
|
+
end
|
|
433
|
+
|
|
434
|
+
# Whether the model receives periodic current-time reminders.
|
|
435
|
+
sig { returns(T::Boolean) }
|
|
436
|
+
attr_accessor :time_awareness
|
|
437
|
+
|
|
438
|
+
# The effective experimental settings for the agent.
|
|
439
|
+
sig do
|
|
440
|
+
params(
|
|
441
|
+
|
|
442
|
+
time_awareness: T::Boolean
|
|
443
|
+
)
|
|
444
|
+
.returns(T.attached_class)
|
|
445
|
+
end
|
|
446
|
+
def self.new(
|
|
447
|
+
|
|
448
|
+
# Whether the model receives periodic current-time reminders.
|
|
449
|
+
|
|
450
|
+
time_awareness:
|
|
451
|
+
)
|
|
452
|
+
end
|
|
453
|
+
|
|
454
|
+
sig do
|
|
455
|
+
override.returns(
|
|
456
|
+
{time_awareness: T::Boolean}
|
|
457
|
+
)
|
|
458
|
+
end
|
|
459
|
+
def to_hash
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
end
|
|
346
463
|
end
|
|
347
464
|
|
|
348
465
|
# An action that must be completed before a session can continue.
|
|
@@ -877,6 +994,22 @@ module OpenAI
|
|
|
877
994
|
end
|
|
878
995
|
end
|
|
879
996
|
|
|
997
|
+
# Review applied to eligible actions in this session. Omitted when review is none
|
|
998
|
+
# and automatic review is not enabled. Omission means none.
|
|
999
|
+
module Review
|
|
1000
|
+
extend OpenAI::Internal::Type::Enum
|
|
1001
|
+
|
|
1002
|
+
TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Beta::AgentSession::Review) }
|
|
1003
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1004
|
+
|
|
1005
|
+
NONE = T.let(:none, OpenAI::Beta::AgentSession::Review::TaggedSymbol)
|
|
1006
|
+
AUTO_REVIEW = T.let(:auto_review, OpenAI::Beta::AgentSession::Review::TaggedSymbol)
|
|
1007
|
+
|
|
1008
|
+
sig { override.returns(T::Array[OpenAI::Beta::AgentSession::Review::TaggedSymbol]) }
|
|
1009
|
+
def self.values
|
|
1010
|
+
end
|
|
1011
|
+
end
|
|
1012
|
+
|
|
880
1013
|
class SpendControl < OpenAI::Internal::Type::BaseModel
|
|
881
1014
|
OrHash = T.type_alias do
|
|
882
1015
|
T.any(
|