runtype 0.3.0 → 0.5.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.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +152 -0
  3. data/README.md +88 -10
  4. data/generated/lib/runtype/agent_aliases/client.rb +153 -0
  5. data/generated/lib/runtype/agent_aliases/types/delete_v1agents_id_aliases_alias_bindings_request.rb +17 -0
  6. data/generated/lib/runtype/agent_aliases/types/delete_v1agents_id_aliases_alias_bindings_response.rb +19 -0
  7. data/generated/lib/runtype/agent_aliases/types/get_v1agents_id_aliases_alias_bindings_request.rb +13 -0
  8. data/generated/lib/runtype/agent_aliases/types/get_v1agents_id_aliases_alias_bindings_response.rb +19 -0
  9. data/generated/lib/runtype/agent_aliases/types/get_v1agents_id_aliases_alias_response.rb +2 -0
  10. data/generated/lib/runtype/agent_aliases/types/get_v1agents_id_aliases_response_data_item.rb +2 -0
  11. data/generated/lib/runtype/agent_aliases/types/get_v1agents_id_deployments_response_data_item.rb +2 -0
  12. data/generated/lib/runtype/agent_aliases/types/post_v1agents_id_aliases_alias_rollback_response.rb +2 -0
  13. data/generated/lib/runtype/agent_aliases/types/put_v1agents_id_aliases_alias_bindings_request.rb +21 -0
  14. data/generated/lib/runtype/agent_aliases/types/put_v1agents_id_aliases_alias_bindings_response.rb +19 -0
  15. data/generated/lib/runtype/agent_aliases/types/put_v1agents_id_aliases_alias_response.rb +2 -0
  16. data/generated/lib/runtype/agent_versions/client.rb +13 -1
  17. data/generated/lib/runtype/agent_versions/types/post_v1agent_versions_agent_id_publish_request.rb +6 -0
  18. data/generated/lib/runtype/agent_versions/types/post_v1agent_versions_agent_id_publish_request_deployment.rb +11 -0
  19. data/generated/lib/runtype/agent_versions/types/post_v1agent_versions_agent_id_publish_request_deployment_action.rb +14 -0
  20. data/generated/lib/runtype/agent_versions/types/post_v1agent_versions_agent_id_publish_response.rb +1 -1
  21. data/generated/lib/runtype/conversations/client.rb +28 -10
  22. data/generated/lib/runtype/conversations/types/get_v1conversations_id_response.rb +3 -1
  23. data/generated/lib/runtype/conversations/types/post_v1conversations_request.rb +6 -0
  24. data/generated/lib/runtype/conversations/types/post_v1conversations_response.rb +3 -1
  25. data/generated/lib/runtype/conversations/types/put_v1conversations_id_request.rb +7 -1
  26. data/generated/lib/runtype/conversations/types/{put_v1conversations_id_request_messages_item_content_one_item_asset_ref_ref_kind.rb → put_v1conversations_id_request_messages_mode.rb} +3 -3
  27. data/generated/lib/runtype/conversations/types/put_v1conversations_id_response.rb +3 -1
  28. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_one.rb +2 -0
  29. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_one_history.rb +14 -0
  30. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_one_messages_item.rb +4 -0
  31. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_one_messages_item_role.rb +1 -0
  32. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_one_messages_item_tool_calls_item.rb +17 -0
  33. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_one_messages_item_tool_results_item.rb +17 -0
  34. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_zero.rb +2 -0
  35. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_zero_history.rb +14 -0
  36. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_zero_messages_item.rb +4 -0
  37. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_zero_messages_item_role.rb +1 -0
  38. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_zero_messages_item_tool_calls_item.rb +17 -0
  39. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_zero_messages_item_tool_results_item.rb +17 -0
  40. data/generated/lib/runtype/model_configs/types/post_v1model_configs_request_settings_custom_model.rb +2 -0
  41. data/generated/lib/runtype/model_configs/types/post_v1model_configs_request_settings_custom_model_mid_conversation_system_messages.rb +14 -0
  42. data/generated/lib/runtype/model_configs/types/put_v1model_configs_id_request_settings_custom_model.rb +2 -0
  43. data/generated/lib/runtype/model_configs/types/put_v1model_configs_id_request_settings_custom_model_mid_conversation_system_messages.rb +14 -0
  44. data/generated/lib/runtype/products/client.rb +45 -0
  45. data/generated/lib/runtype/products/types/get_v1products_id_activity_request.rb +13 -0
  46. data/generated/lib/runtype/products/types/get_v1products_id_activity_response.rb +13 -0
  47. data/generated/lib/runtype/products/types/get_v1products_id_activity_response_data.rb +13 -0
  48. data/generated/lib/runtype/products/types/get_v1products_id_activity_response_data_agents_item.rb +17 -0
  49. data/generated/lib/runtype/products/types/get_v1products_id_activity_response_data_agents_item_data_item.rb +77 -0
  50. data/generated/lib/runtype/products/types/get_v1products_id_activity_response_data_agents_item_data_item_agent_target_resolution.rb +15 -0
  51. data/generated/lib/runtype/products/types/get_v1products_id_activity_response_data_agents_item_data_item_agent_version.rb +17 -0
  52. data/generated/lib/runtype/products/types/get_v1products_id_activity_response_data_agents_item_data_item_execution_mode.rb +14 -0
  53. data/generated/lib/runtype/products/types/get_v1products_id_activity_response_data_agents_item_data_item_notification_mode.rb +15 -0
  54. data/generated/lib/runtype/products/types/get_v1products_id_activity_response_data_agents_item_data_item_pending_approval.rb +27 -0
  55. data/generated/lib/runtype/products/types/get_v1products_id_activity_response_data_agents_item_data_item_status.rb +19 -0
  56. data/generated/lib/runtype/products/types/get_v1products_id_activity_response_data_agents_item_error.rb +11 -0
  57. data/generated/lib/runtype/products/types/get_v1products_id_activity_response_data_surfaces_item.rb +19 -0
  58. data/generated/lib/runtype/products/types/get_v1products_id_activity_response_data_surfaces_item_data_item.rb +15 -0
  59. data/generated/lib/runtype/products/types/get_v1products_id_activity_response_data_surfaces_item_data_item_agent_mode.rb +45 -0
  60. data/generated/lib/runtype/products/types/get_v1products_id_activity_response_data_surfaces_item_data_item_available_fields.rb +39 -0
  61. data/generated/lib/runtype/products/types/get_v1products_id_activity_response_data_surfaces_item_data_item_available_fields_metadata_schema.rb +11 -0
  62. data/generated/lib/runtype/products/types/get_v1products_id_activity_response_data_surfaces_item_error.rb +11 -0
  63. data/generated/lib/runtype/products/types/get_v1products_id_activity_response_data_surfaces_item_source.rb +14 -0
  64. data/generated/lib/runtype/provider_keys/types/post_v1provider_keys_id_sync_models_request_models_item.rb +2 -0
  65. data/generated/lib/runtype/provider_keys/types/post_v1provider_keys_id_sync_models_request_models_item_mid_conversation_system_messages.rb +14 -0
  66. data/generated/lib/runtype/types/agent_ensure_deploy_target.rb +2 -0
  67. data/generated/lib/runtype/types/conflict_error_body_candidate_count.rb +21 -0
  68. data/generated/lib/runtype/types/conflict_error_body_candidate_count_code.rb +11 -0
  69. data/generated/lib/runtype/types/conversation_message_author.rb +16 -0
  70. data/generated/lib/runtype/types/conversation_message_author_type.rb +14 -0
  71. data/generated/lib/runtype/types/conversation_modified_error.rb +13 -0
  72. data/generated/lib/runtype/types/conversation_modified_error_code.rb +11 -0
  73. data/generated/lib/runtype/types/conversation_source.rb +14 -0
  74. data/generated/lib/runtype/types/conversation_transcript_message.rb +23 -0
  75. data/generated/lib/runtype/types/conversation_transcript_message_content.rb +14 -0
  76. data/generated/lib/runtype/types/conversation_transcript_message_content_one_item.rb +21 -0
  77. data/generated/lib/runtype/types/conversation_transcript_message_content_one_item_asset_ref.rb +19 -0
  78. data/generated/lib/runtype/types/conversation_transcript_message_content_one_item_asset_ref_ref_kind.rb +12 -0
  79. data/generated/lib/runtype/types/conversation_transcript_message_content_one_item_file.rb +13 -0
  80. data/generated/lib/runtype/types/conversation_transcript_message_content_one_item_image.rb +11 -0
  81. data/generated/lib/runtype/types/conversation_transcript_message_content_one_item_reasoning.rb +11 -0
  82. data/generated/lib/runtype/types/conversation_transcript_message_content_one_item_text.rb +9 -0
  83. data/generated/lib/runtype/types/conversation_transcript_message_role.rb +14 -0
  84. data/generated/lib/runtype/types/conversation_transcript_message_tool_calls_item.rb +15 -0
  85. data/generated/lib/runtype/types/conversation_transcript_message_tool_results_item.rb +15 -0
  86. data/generated/lib/runtype.rb +59 -12
  87. data/lib/runtype/agent_ensure.rb +35 -3
  88. data/lib/runtype/agent_release_aliases.rb +146 -2
  89. data/lib/runtype/client.rb +21 -1
  90. data/lib/runtype/errors.rb +14 -2
  91. data/lib/runtype/raw_client_timeout.rb +56 -0
  92. data/lib/runtype/sdk_version.rb +2 -1
  93. data/lib/runtype.rb +1 -0
  94. metadata +58 -10
  95. data/generated/lib/runtype/conversations/types/put_v1conversations_id_request_messages_item.rb +0 -17
  96. data/generated/lib/runtype/conversations/types/put_v1conversations_id_request_messages_item_content.rb +0 -15
  97. data/generated/lib/runtype/conversations/types/put_v1conversations_id_request_messages_item_content_one_item.rb +0 -21
  98. data/generated/lib/runtype/conversations/types/put_v1conversations_id_request_messages_item_content_one_item_asset_ref.rb +0 -21
  99. data/generated/lib/runtype/conversations/types/put_v1conversations_id_request_messages_item_content_one_item_file.rb +0 -15
  100. data/generated/lib/runtype/conversations/types/put_v1conversations_id_request_messages_item_content_one_item_image.rb +0 -13
  101. data/generated/lib/runtype/conversations/types/put_v1conversations_id_request_messages_item_content_one_item_text.rb +0 -11
  102. data/generated/lib/runtype/conversations/types/put_v1conversations_id_request_messages_item_role.rb +0 -15
@@ -50,6 +50,11 @@ module Runtype
50
50
  end
51
51
  end
52
52
 
53
+ # Apply an immutable version to the live agent row and move the `live` release alias, in one transaction. Until
54
+ # the omitted-selector cutover this is the writer that changes what actually executes, so it is the verb a live
55
+ # deployment uses; the alias activate route owns preview pointers. Supplying `If-Match` opts this call into the
56
+ # same protected-live compare-and-swap the alias routes enforce.
57
+ #
53
58
  # @param request_options [Hash]
54
59
  # @param params [Runtype::AgentVersions::Types::PostV1AgentVersionsAgentIDPublishRequest]
55
60
  # @option request_options [String] :base_url
@@ -58,6 +63,8 @@ module Runtype
58
63
  # @option request_options [Hash{String => Object}] :additional_body_parameters
59
64
  # @option request_options [Integer] :timeout_in_seconds
60
65
  # @option params [String] :agent_id
66
+ # @option params [String, nil] :if_match
67
+ # @option params [String, nil] :idempotency_key
61
68
  #
62
69
  # @example
63
70
  # client.agent_versions.publish_a_specific_agent_version(
@@ -69,13 +76,18 @@ module Runtype
69
76
  def publish_a_specific_agent_version(request_options: {}, **params)
70
77
  params = Runtype::Internal::Types::Utils.normalize_keys(params)
71
78
  request_data = Runtype::AgentVersions::Types::PostV1AgentVersionsAgentIDPublishRequest.new(params).to_h
72
- non_body_param_names = %w[agentId]
79
+ non_body_param_names = %w[agentId if-match idempotency-key]
73
80
  body = request_data.except(*non_body_param_names)
74
81
 
82
+ headers = {}
83
+ headers["if-match"] = params[:if_match] if params[:if_match]
84
+ headers["idempotency-key"] = params[:idempotency_key] if params[:idempotency_key]
85
+
75
86
  request = Runtype::Internal::JSON::Request.new(
76
87
  base_url: request_options[:base_url],
77
88
  method: "POST",
78
89
  path: "v1/agent-versions/#{URI.encode_uri_component(params[:agent_id].to_s)}/publish",
90
+ headers: headers,
79
91
  body: body,
80
92
  request_options: request_options
81
93
  )
@@ -6,6 +6,12 @@ module Runtype
6
6
  class PostV1AgentVersionsAgentIDPublishRequest < Internal::Types::Model
7
7
  field :agent_id, -> { String }, optional: false, nullable: false, api_name: "agentId"
8
8
 
9
+ field :if_match, -> { String }, optional: true, nullable: false, api_name: "if-match"
10
+
11
+ field :idempotency_key, -> { String }, optional: true, nullable: false, api_name: "idempotency-key"
12
+
13
+ field :deployment, -> { Runtype::AgentVersions::Types::PostV1AgentVersionsAgentIDPublishRequestDeployment }, optional: true, nullable: false
14
+
9
15
  field :on_conflict, -> { Runtype::AgentVersions::Types::PostV1AgentVersionsAgentIDPublishRequestOnConflict }, optional: true, nullable: false, api_name: "onConflict"
10
16
 
11
17
  field :version_id, -> { String }, optional: false, nullable: false, api_name: "versionId"
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module AgentVersions
5
+ module Types
6
+ class PostV1AgentVersionsAgentIDPublishRequestDeployment < Internal::Types::Model
7
+ field :action, -> { Runtype::AgentVersions::Types::PostV1AgentVersionsAgentIDPublishRequestDeploymentAction }, optional: true, nullable: false
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module AgentVersions
5
+ module Types
6
+ module PostV1AgentVersionsAgentIDPublishRequestDeploymentAction
7
+ extend Runtype::Internal::Types::Enum
8
+
9
+ ACTIVATE = "activate"
10
+ ROLLBACK = "rollback"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -6,7 +6,7 @@ module Runtype
6
6
  class PostV1AgentVersionsAgentIDPublishResponse < Internal::Types::Model
7
7
  field :agent_id, -> { String }, optional: false, nullable: false, api_name: "agentId"
8
8
 
9
- field :applied, -> { Internal::Types::Hash[String, Internal::Types::Boolean] }, optional: false, nullable: false
9
+ field :applied, -> { Internal::Types::Hash[String, Internal::Types::Boolean] }, optional: true, nullable: false
10
10
 
11
11
  field :last_modified_source, -> { Runtype::AgentVersions::Types::PostV1AgentVersionsAgentIDPublishResponseLastModifiedSource }, optional: false, nullable: false, api_name: "lastModifiedSource"
12
12
 
@@ -148,21 +148,39 @@ module Runtype
148
148
  # @example
149
149
  # client.conversations.update_a_conversation(
150
150
  # id: "id",
151
+ # agent_id: "agent_01j9r4x0h7f9k4b2n8t6q3m5cd",
151
152
  # messages: [{
152
- # content: "Help me write a function",
153
- # id: "msg_1",
153
+ # content: "Book me a table for two at 7pm.",
154
154
  # role: "user"
155
155
  # }, {
156
- # content: "Sure! What kind of function would you like?",
157
- # id: "msg_2",
156
+ # content: "",
157
+ # role: "assistant",
158
+ # tool_calls: [{
159
+ # args: {
160
+ # partySize: 2,
161
+ # time: "19:00"
162
+ # },
163
+ # tool_call_id: "call_9",
164
+ # tool_name: "create_reservation"
165
+ # }]
166
+ # }, {
167
+ # content: "",
168
+ # role: "tool",
169
+ # tool_results: [{
170
+ # result: {
171
+ # confirmed: true,
172
+ # reservationId: "res_44"
173
+ # },
174
+ # tool_call_id: "call_9",
175
+ # tool_name: "create_reservation"
176
+ # }]
177
+ # }, {
178
+ # content: "Booked. Your table for two is confirmed for 7pm.",
158
179
  # role: "assistant"
159
180
  # }],
160
- # metadata: {
161
- # topic: "programming"
162
- # },
163
- # model_id: "claude-sonnet-4-5",
164
- # system_prompt: "You are a coding assistant.",
165
- # title: "Updated Chat Title"
181
+ # source: {
182
+ # system: "custom"
183
+ # }
166
184
  # )
167
185
  #
168
186
  # @return [Runtype::Conversations::Types::PutV1ConversationsIDResponse]
@@ -8,7 +8,9 @@ module Runtype
8
8
 
9
9
  field :id, -> { String }, optional: false, nullable: false
10
10
 
11
- field :messages, -> { Internal::Types::Array[Internal::Types::Hash[String, Object]] }, optional: false, nullable: false
11
+ field :imported, -> { Internal::Types::Boolean }, optional: true, nullable: false
12
+
13
+ field :messages, -> { Internal::Types::Array[Runtype::Types::ConversationTranscriptMessage] }, optional: false, nullable: false
12
14
 
13
15
  field :metadata, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
14
16
 
@@ -4,12 +4,18 @@ module Runtype
4
4
  module Conversations
5
5
  module Types
6
6
  class PostV1ConversationsRequest < Internal::Types::Model
7
+ field :agent_id, -> { String }, optional: true, nullable: false, api_name: "agentId"
8
+
9
+ field :messages, -> { Internal::Types::Array[Runtype::Types::ConversationTranscriptMessage] }, optional: true, nullable: false
10
+
7
11
  field :metadata, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false
8
12
 
9
13
  field :model_id, -> { String }, optional: true, nullable: false, api_name: "modelId"
10
14
 
11
15
  field :owner_id, -> { String }, optional: true, nullable: false, api_name: "ownerId"
12
16
 
17
+ field :source, -> { Runtype::Types::ConversationSource }, optional: true, nullable: false
18
+
13
19
  field :system_prompt, -> { String }, optional: true, nullable: false, api_name: "systemPrompt"
14
20
 
15
21
  field :title, -> { String }, optional: true, nullable: false
@@ -8,7 +8,9 @@ module Runtype
8
8
 
9
9
  field :id, -> { String }, optional: false, nullable: false
10
10
 
11
- field :messages, -> { Internal::Types::Array[Internal::Types::Hash[String, Object]] }, optional: false, nullable: false
11
+ field :imported, -> { Internal::Types::Boolean }, optional: true, nullable: false
12
+
13
+ field :messages, -> { Internal::Types::Array[Runtype::Types::ConversationTranscriptMessage] }, optional: false, nullable: false
12
14
 
13
15
  field :metadata, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
14
16
 
@@ -6,7 +6,11 @@ module Runtype
6
6
  class PutV1ConversationsIDRequest < Internal::Types::Model
7
7
  field :id, -> { String }, optional: false, nullable: false
8
8
 
9
- field :messages, -> { Internal::Types::Array[Runtype::Conversations::Types::PutV1ConversationsIDRequestMessagesItem] }, optional: true, nullable: false
9
+ field :agent_id, -> { String }, optional: true, nullable: false, api_name: "agentId"
10
+
11
+ field :messages, -> { Internal::Types::Array[Runtype::Types::ConversationTranscriptMessage] }, optional: true, nullable: false
12
+
13
+ field :messages_mode, -> { Runtype::Conversations::Types::PutV1ConversationsIDRequestMessagesMode }, optional: true, nullable: false, api_name: "messagesMode"
10
14
 
11
15
  field :metadata, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false
12
16
 
@@ -14,6 +18,8 @@ module Runtype
14
18
 
15
19
  field :owner_id, -> { String }, optional: true, nullable: false, api_name: "ownerId"
16
20
 
21
+ field :source, -> { Runtype::Types::ConversationSource }, optional: true, nullable: false
22
+
17
23
  field :system_prompt, -> { String }, optional: true, nullable: false, api_name: "systemPrompt"
18
24
 
19
25
  field :title, -> { String }, optional: true, nullable: false
@@ -3,11 +3,11 @@
3
3
  module Runtype
4
4
  module Conversations
5
5
  module Types
6
- module PutV1ConversationsIDRequestMessagesItemContentOneItemAssetRefRefKind
6
+ module PutV1ConversationsIDRequestMessagesMode
7
7
  extend Runtype::Internal::Types::Enum
8
8
 
9
- IMAGE = "image"
10
- FILE = "file"
9
+ REPLACE = "replace"
10
+ APPEND = "append"
11
11
  end
12
12
  end
13
13
  end
@@ -8,7 +8,9 @@ module Runtype
8
8
 
9
9
  field :id, -> { String }, optional: false, nullable: false
10
10
 
11
- field :messages, -> { Internal::Types::Array[Internal::Types::Hash[String, Object]] }, optional: false, nullable: false
11
+ field :imported, -> { Internal::Types::Boolean }, optional: true, nullable: false
12
+
13
+ field :messages, -> { Internal::Types::Array[Runtype::Types::ConversationTranscriptMessage] }, optional: false, nullable: false
12
14
 
13
15
  field :metadata, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
14
16
 
@@ -18,6 +18,8 @@ module Runtype
18
18
 
19
19
  field :flow, -> { Runtype::Dispatch::Types::PostV1DispatchRequestOneFlow }, optional: true, nullable: false
20
20
 
21
+ field :history, -> { Runtype::Dispatch::Types::PostV1DispatchRequestOneHistory }, optional: true, nullable: false
22
+
21
23
  field :identity_proof, -> { Runtype::Dispatch::Types::PostV1DispatchRequestOneIdentityProof }, optional: true, nullable: false, api_name: "identityProof"
22
24
 
23
25
  field :inputs, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module Dispatch
5
+ module Types
6
+ module PostV1DispatchRequestOneHistory
7
+ extend Runtype::Internal::Types::Enum
8
+
9
+ INLINE = "inline"
10
+ STORED = "stored"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -7,6 +7,10 @@ module Runtype
7
7
  field :content, -> { Runtype::Dispatch::Types::PostV1DispatchRequestOneMessagesItemContent }, optional: false, nullable: false
8
8
 
9
9
  field :role, -> { Runtype::Dispatch::Types::PostV1DispatchRequestOneMessagesItemRole }, optional: false, nullable: false
10
+
11
+ field :tool_calls, -> { Internal::Types::Array[Runtype::Dispatch::Types::PostV1DispatchRequestOneMessagesItemToolCallsItem] }, optional: true, nullable: false, api_name: "toolCalls"
12
+
13
+ field :tool_results, -> { Internal::Types::Array[Runtype::Dispatch::Types::PostV1DispatchRequestOneMessagesItemToolResultsItem] }, optional: true, nullable: false, api_name: "toolResults"
10
14
  end
11
15
  end
12
16
  end
@@ -9,6 +9,7 @@ module Runtype
9
9
  SYSTEM = "system"
10
10
  USER = "user"
11
11
  ASSISTANT = "assistant"
12
+ TOOL = "tool"
12
13
  end
13
14
  end
14
15
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module Dispatch
5
+ module Types
6
+ class PostV1DispatchRequestOneMessagesItemToolCallsItem < Internal::Types::Model
7
+ field :args, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false
8
+
9
+ field :provider_options, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false, api_name: "providerOptions"
10
+
11
+ field :tool_call_id, -> { String }, optional: false, nullable: false, api_name: "toolCallId"
12
+
13
+ field :tool_name, -> { String }, optional: false, nullable: false, api_name: "toolName"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module Dispatch
5
+ module Types
6
+ class PostV1DispatchRequestOneMessagesItemToolResultsItem < Internal::Types::Model
7
+ field :provider_options, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false, api_name: "providerOptions"
8
+
9
+ field :result, -> { Object }, optional: true, nullable: false
10
+
11
+ field :tool_call_id, -> { String }, optional: false, nullable: false, api_name: "toolCallId"
12
+
13
+ field :tool_name, -> { String }, optional: false, nullable: false, api_name: "toolName"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -18,6 +18,8 @@ module Runtype
18
18
 
19
19
  field :flow, -> { Runtype::Dispatch::Types::PostV1DispatchRequestZeroFlow }, optional: false, nullable: false
20
20
 
21
+ field :history, -> { Runtype::Dispatch::Types::PostV1DispatchRequestZeroHistory }, optional: true, nullable: false
22
+
21
23
  field :identity_proof, -> { Runtype::Dispatch::Types::PostV1DispatchRequestZeroIdentityProof }, optional: true, nullable: false, api_name: "identityProof"
22
24
 
23
25
  field :inputs, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module Dispatch
5
+ module Types
6
+ module PostV1DispatchRequestZeroHistory
7
+ extend Runtype::Internal::Types::Enum
8
+
9
+ INLINE = "inline"
10
+ STORED = "stored"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -7,6 +7,10 @@ module Runtype
7
7
  field :content, -> { Runtype::Dispatch::Types::PostV1DispatchRequestZeroMessagesItemContent }, optional: false, nullable: false
8
8
 
9
9
  field :role, -> { Runtype::Dispatch::Types::PostV1DispatchRequestZeroMessagesItemRole }, optional: false, nullable: false
10
+
11
+ field :tool_calls, -> { Internal::Types::Array[Runtype::Dispatch::Types::PostV1DispatchRequestZeroMessagesItemToolCallsItem] }, optional: true, nullable: false, api_name: "toolCalls"
12
+
13
+ field :tool_results, -> { Internal::Types::Array[Runtype::Dispatch::Types::PostV1DispatchRequestZeroMessagesItemToolResultsItem] }, optional: true, nullable: false, api_name: "toolResults"
10
14
  end
11
15
  end
12
16
  end
@@ -9,6 +9,7 @@ module Runtype
9
9
  SYSTEM = "system"
10
10
  USER = "user"
11
11
  ASSISTANT = "assistant"
12
+ TOOL = "tool"
12
13
  end
13
14
  end
14
15
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module Dispatch
5
+ module Types
6
+ class PostV1DispatchRequestZeroMessagesItemToolCallsItem < Internal::Types::Model
7
+ field :args, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false
8
+
9
+ field :provider_options, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false, api_name: "providerOptions"
10
+
11
+ field :tool_call_id, -> { String }, optional: false, nullable: false, api_name: "toolCallId"
12
+
13
+ field :tool_name, -> { String }, optional: false, nullable: false, api_name: "toolName"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module Dispatch
5
+ module Types
6
+ class PostV1DispatchRequestZeroMessagesItemToolResultsItem < Internal::Types::Model
7
+ field :provider_options, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false, api_name: "providerOptions"
8
+
9
+ field :result, -> { Object }, optional: true, nullable: false
10
+
11
+ field :tool_call_id, -> { String }, optional: false, nullable: false, api_name: "toolCallId"
12
+
13
+ field :tool_name, -> { String }, optional: false, nullable: false, api_name: "toolName"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -14,6 +14,8 @@ module Runtype
14
14
 
15
15
  field :max_output_tokens, -> { Integer }, optional: true, nullable: false, api_name: "maxOutputTokens"
16
16
 
17
+ field :mid_conversation_system_messages, -> { Runtype::ModelConfigs::Types::PostV1ModelConfigsRequestSettingsCustomModelMidConversationSystemMessages }, optional: true, nullable: false, api_name: "midConversationSystemMessages"
18
+
17
19
  field :output_cost_per1k_tokens, -> { Integer }, optional: false, nullable: false, api_name: "outputCostPer1kTokens"
18
20
 
19
21
  field :reasoning, -> { Runtype::ModelConfigs::Types::PostV1ModelConfigsRequestSettingsCustomModelReasoning }, optional: true, nullable: false
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module ModelConfigs
5
+ module Types
6
+ module PostV1ModelConfigsRequestSettingsCustomModelMidConversationSystemMessages
7
+ extend Runtype::Internal::Types::Enum
8
+
9
+ PRESERVE = "preserve"
10
+ HOIST = "hoist"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -14,6 +14,8 @@ module Runtype
14
14
 
15
15
  field :max_output_tokens, -> { Integer }, optional: true, nullable: false, api_name: "maxOutputTokens"
16
16
 
17
+ field :mid_conversation_system_messages, -> { Runtype::ModelConfigs::Types::PutV1ModelConfigsIDRequestSettingsCustomModelMidConversationSystemMessages }, optional: true, nullable: false, api_name: "midConversationSystemMessages"
18
+
17
19
  field :output_cost_per1k_tokens, -> { Integer }, optional: false, nullable: false, api_name: "outputCostPer1kTokens"
18
20
 
19
21
  field :reasoning, -> { Runtype::ModelConfigs::Types::PutV1ModelConfigsIDRequestSettingsCustomModelReasoning }, optional: true, nullable: false
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module ModelConfigs
5
+ module Types
6
+ module PutV1ModelConfigsIDRequestSettingsCustomModelMidConversationSystemMessages
7
+ extend Runtype::Internal::Types::Enum
8
+
9
+ PRESERVE = "preserve"
10
+ HOIST = "hoist"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -471,6 +471,51 @@ module Runtype
471
471
  end
472
472
  end
473
473
 
474
+ # First page of every activity source a product has: one entry per conversational surface (messaging conversations
475
+ # or client-conversation records) and one per distinct agent capability (compact executions). Rows, cursors and
476
+ # `hasMore` are identical to the per-source list endpoints, so a client can continue any source with its own
477
+ # endpoint. A source that fails returns empty rows plus an `error`; the response is still 200.
478
+ #
479
+ # @param request_options [Hash]
480
+ # @param params [Hash]
481
+ # @option request_options [String] :base_url
482
+ # @option request_options [Hash{String => Object}] :additional_headers
483
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
484
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
485
+ # @option request_options [Integer] :timeout_in_seconds
486
+ # @option params [String] :id
487
+ # @option params [String, nil] :limit
488
+ #
489
+ # @example
490
+ # client.products.get_product_activity(id: "id")
491
+ #
492
+ # @return [Runtype::Products::Types::GetV1ProductsIDActivityResponse]
493
+ def get_product_activity(request_options: {}, **params)
494
+ params = Runtype::Internal::Types::Utils.normalize_keys(params)
495
+ query_params = {}
496
+ query_params["limit"] = params[:limit] if params.key?(:limit)
497
+
498
+ request = Runtype::Internal::JSON::Request.new(
499
+ base_url: request_options[:base_url],
500
+ method: "GET",
501
+ path: "v1/products/#{URI.encode_uri_component(params[:id].to_s)}/activity",
502
+ query: query_params,
503
+ request_options: request_options
504
+ )
505
+ begin
506
+ response = @client.send(request)
507
+ rescue Net::HTTPRequestTimeout
508
+ raise Runtype::Errors::TimeoutError
509
+ end
510
+ code = response.code.to_i
511
+ if code.between?(200, 299)
512
+ Runtype::Products::Types::GetV1ProductsIDActivityResponse.load(response.body)
513
+ else
514
+ error_class = Runtype::Errors::ResponseError.subclass_for_code(code)
515
+ raise error_class.new(response.body, code: code)
516
+ end
517
+ end
518
+
474
519
  # Add a capability (flow or agent binding) to a product. Requires either flowId or agentId.
475
520
  #
476
521
  # @param request_options [Hash]
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module Products
5
+ module Types
6
+ class GetV1ProductsIDActivityRequest < Internal::Types::Model
7
+ field :id, -> { String }, optional: false, nullable: false
8
+
9
+ field :limit, -> { String }, optional: true, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module Products
5
+ module Types
6
+ class GetV1ProductsIDActivityResponse < Internal::Types::Model
7
+ field :data, -> { Runtype::Products::Types::GetV1ProductsIDActivityResponseData }, optional: false, nullable: false
8
+
9
+ field :success, -> { Internal::Types::Boolean }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module Products
5
+ module Types
6
+ class GetV1ProductsIDActivityResponseData < Internal::Types::Model
7
+ field :agents, -> { Internal::Types::Array[Runtype::Products::Types::GetV1ProductsIDActivityResponseDataAgentsItem] }, optional: false, nullable: false
8
+
9
+ field :surfaces, -> { Internal::Types::Array[Runtype::Products::Types::GetV1ProductsIDActivityResponseDataSurfacesItem] }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module Products
5
+ module Types
6
+ class GetV1ProductsIDActivityResponseDataAgentsItem < Internal::Types::Model
7
+ field :agent_id, -> { String }, optional: false, nullable: false, api_name: "agentId"
8
+
9
+ field :data, -> { Internal::Types::Array[Runtype::Products::Types::GetV1ProductsIDActivityResponseDataAgentsItemDataItem] }, optional: false, nullable: false
10
+
11
+ field :error, -> { Runtype::Products::Types::GetV1ProductsIDActivityResponseDataAgentsItemError }, optional: true, nullable: false
12
+
13
+ field :pagination, -> { Runtype::Types::Pagination }, optional: false, nullable: false
14
+ end
15
+ end
16
+ end
17
+ end