fetch_hive 0.3.0 → 0.4.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/README.md +2 -2
- data/lib/fetch_hive/generated/api/agent_chat_messages_api.rb +2 -2
- data/lib/fetch_hive/generated/api/agent_chats_api.rb +2 -2
- data/lib/fetch_hive/generated/api/agents_api.rb +3 -3
- data/lib/fetch_hive/generated/api/assets_api.rb +2 -2
- data/lib/fetch_hive/generated/api/hive_agents_api.rb +2 -2
- data/lib/fetch_hive/generated/api/knowledge_base_items_api.rb +2 -2
- data/lib/fetch_hive/generated/api/knowledge_bases_api.rb +2 -2
- data/lib/fetch_hive/generated/api/models_api.rb +2 -2
- data/lib/fetch_hive/generated/api/prompts_api.rb +2 -2
- data/lib/fetch_hive/generated/api/requests_api.rb +2 -2
- data/lib/fetch_hive/generated/api/search_services_api.rb +2 -2
- data/lib/fetch_hive/generated/api/tool_action_approvals_api.rb +244 -0
- data/lib/fetch_hive/generated/api/workflows_api.rb +2 -2
- data/lib/fetch_hive/generated/api_client.rb +2 -2
- data/lib/fetch_hive/generated/api_error.rb +2 -2
- data/lib/fetch_hive/generated/api_model_base.rb +2 -2
- data/lib/fetch_hive/generated/configuration.rb +2 -2
- data/lib/fetch_hive/generated/models/agent_attachment.rb +2 -2
- data/lib/fetch_hive/generated/models/agent_attachment_one_of.rb +2 -2
- data/lib/fetch_hive/generated/models/agent_delegation.rb +2 -2
- data/lib/fetch_hive/generated/models/agent_invoke_async_config.rb +2 -2
- data/lib/fetch_hive/generated/models/agent_message.rb +2 -2
- data/lib/fetch_hive/generated/models/asset_object.rb +2 -2
- data/lib/fetch_hive/generated/models/asset_object_transcription.rb +2 -2
- data/lib/fetch_hive/generated/models/async_config.rb +2 -2
- data/lib/fetch_hive/generated/models/delete_public_workspaces_agents200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/delete_public_workspaces_agents_chats200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/delete_public_workspaces_agents_chats404_response.rb +2 -2
- data/lib/fetch_hive/generated/models/delete_public_workspaces_knowledge_bases200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/delete_public_workspaces_knowledge_bases_items200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/denied_tool_call.rb +223 -0
- data/lib/fetch_hive/generated/models/error_response.rb +2 -2
- data/lib/fetch_hive/generated/models/generated_artifact.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_models200_response_inner.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_requests200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_requests404_response.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_search_services_countries200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_search_services_countries200_response_services_inner.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_search_services_countries200_response_services_inner_countries_inner.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_search_services_countries2404_response.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_workspaces_agents200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_workspaces_agents2200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_workspaces_agents_chats200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_workspaces_agents_chats_messages200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_workspaces_agents_chats_messages200_response_messages_inner.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_workspaces_agents_chats_messages422_response.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_workspaces_assets200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases2200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases2422_response.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases_items200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases_items200_response_knowledge_base_items_inner.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases_items2200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_workspaces_knowledge_bases_items2422_response.rb +2 -2
- data/lib/fetch_hive/generated/models/get_public_workspaces_tool_action_approvals200_response.rb +149 -0
- data/lib/fetch_hive/generated/models/get_public_workspaces_tool_action_approvals2200_response.rb +147 -0
- data/lib/fetch_hive/generated/models/hive_agent_async_config.rb +2 -2
- data/lib/fetch_hive/generated/models/hive_agent_sources.rb +2 -2
- data/lib/fetch_hive/generated/models/invoke_agent_request.rb +62 -6
- data/lib/fetch_hive/generated/models/invoke_agent_request_decided_tool_approvals_inner.rb +164 -0
- data/lib/fetch_hive/generated/models/invoke_agent_response.rb +116 -4
- data/lib/fetch_hive/generated/models/invoke_agent_response_auto_approved_tool_calls_inner.rb +190 -0
- data/lib/fetch_hive/generated/models/invoke_hive_agent_request.rb +2 -2
- data/lib/fetch_hive/generated/models/invoke_hive_agent_response.rb +2 -2
- data/lib/fetch_hive/generated/models/invoke_prompt_request.rb +2 -2
- data/lib/fetch_hive/generated/models/invoke_prompt_response.rb +2 -2
- data/lib/fetch_hive/generated/models/invoke_workflow_async_response.rb +2 -2
- data/lib/fetch_hive/generated/models/invoke_workflow_request.rb +50 -6
- data/lib/fetch_hive/generated/models/invoke_workflow_response.rb +2 -2
- data/lib/fetch_hive/generated/models/knowledge_base_object.rb +2 -2
- data/lib/fetch_hive/generated/models/list_thread_agent_delegations200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/metadata_value.rb +2 -2
- data/lib/fetch_hive/generated/models/patch_public_workspaces_agents200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/patch_public_workspaces_agents422_response.rb +173 -0
- data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_chats200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_chats_clear_messages200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_chats_request.rb +2 -2
- data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_chats_request_chat.rb +2 -2
- data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_request.rb +2 -2
- data/lib/fetch_hive/generated/models/patch_public_workspaces_agents_request_agent.rb +28 -6
- data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases_items200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases_items_request.rb +2 -2
- data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases_items_request_knowledge_base_item.rb +2 -2
- data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases_request.rb +2 -2
- data/lib/fetch_hive/generated/models/patch_public_workspaces_knowledge_bases_request_knowledge_base.rb +2 -2
- data/lib/fetch_hive/generated/models/pending_delegation.rb +2 -2
- data/lib/fetch_hive/generated/models/pending_tool_approval.rb +247 -0
- data/lib/fetch_hive/generated/models/post_public_workspaces_agents200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_agents422_response.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_agents_chats200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_agents_chats200_response_chat.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_agents_chats422_response.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_agents_chats_request.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_agents_chats_request_chat.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_agents_request.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_agents_request_agent.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_assets200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_assets422_response.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_items200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_items422_response.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_items_regenerate200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_items_request.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_items_request_knowledge_base_item.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_request.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_request_knowledge_base.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_search200_response.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_search422_response.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_knowledge_bases_search_request.rb +2 -2
- data/lib/fetch_hive/generated/models/post_public_workspaces_tool_action_approvals_decide_request.rb +188 -0
- data/lib/fetch_hive/generated/models/sse_chunk.rb +126 -4
- data/lib/fetch_hive/generated/models/sse_chunk_auto_approved_tool_calls_inner.rb +156 -0
- data/lib/fetch_hive/generated/models/token_usage.rb +2 -2
- data/lib/fetch_hive/generated/models/tool_action_approval_object.rb +701 -0
- data/lib/fetch_hive/generated/models/tool_action_approval_object_approval_votes_inner.rb +156 -0
- data/lib/fetch_hive/generated/models/tool_action_approval_object_arguments_edited_by.rb +158 -0
- data/lib/fetch_hive/generated/models/tool_action_approval_object_batch_items_inner.rb +190 -0
- data/lib/fetch_hive/generated/models/tool_action_approval_object_capabilities.rb +157 -0
- data/lib/fetch_hive/generated/models/tool_action_approval_object_decided_by_user.rb +188 -0
- data/lib/fetch_hive/generated/models/tool_action_approval_object_requested_by.rb +179 -0
- data/lib/fetch_hive/generated/models/tool_invocation.rb +2 -2
- data/lib/fetch_hive/generated/version.rb +2 -2
- metadata +19 -2
data/lib/fetch_hive/generated/models/post_public_workspaces_tool_action_approvals_decide_request.rb
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Fetch Hive Public API
|
|
3
|
+
|
|
4
|
+
#The Fetch Hive public API lets you invoke prompts, workflows, agents, and Hive Agents programmatically using an API token. ## Authentication All requests require a Bearer token in the `Authorization` header: ``` Authorization: Bearer <your-api-token> ``` ## Breaking Error responses use `error_code`. The previous field name `code` is not returned. ## Streaming Pass `\"streaming\": true` in the request body to receive a `text/event-stream` response. Each event is a JSON object sent as `data: <json>\\n\\n`. The stream ends with `data: [DONE]\\n\\n`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.4.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module FetchHive::Generated
|
|
17
|
+
class PostPublicWorkspacesToolActionApprovalsDecideRequest < ApiModelBase
|
|
18
|
+
attr_accessor :decision
|
|
19
|
+
|
|
20
|
+
class EnumAttributeValidator
|
|
21
|
+
attr_reader :datatype
|
|
22
|
+
attr_reader :allowable_values
|
|
23
|
+
|
|
24
|
+
def initialize(datatype, allowable_values)
|
|
25
|
+
@allowable_values = allowable_values.map do |value|
|
|
26
|
+
case datatype.to_s
|
|
27
|
+
when /Integer/i
|
|
28
|
+
value.to_i
|
|
29
|
+
when /Float/i
|
|
30
|
+
value.to_f
|
|
31
|
+
else
|
|
32
|
+
value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def valid?(value)
|
|
38
|
+
!value || allowable_values.include?(value)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
43
|
+
def self.attribute_map
|
|
44
|
+
{
|
|
45
|
+
:'decision' => :'decision'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Returns attribute mapping this model knows about
|
|
50
|
+
def self.acceptable_attribute_map
|
|
51
|
+
attribute_map
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Returns all the JSON keys this model knows about
|
|
55
|
+
def self.acceptable_attributes
|
|
56
|
+
acceptable_attribute_map.values
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Attribute type mapping.
|
|
60
|
+
def self.openapi_types
|
|
61
|
+
{
|
|
62
|
+
:'decision' => :'String'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# List of attributes with nullable: true
|
|
67
|
+
def self.openapi_nullable
|
|
68
|
+
Set.new([
|
|
69
|
+
])
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Initializes the object
|
|
73
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
74
|
+
def initialize(attributes = {})
|
|
75
|
+
if (!attributes.is_a?(Hash))
|
|
76
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FetchHive::Generated::PostPublicWorkspacesToolActionApprovalsDecideRequest` initialize method"
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
80
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
81
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
82
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FetchHive::Generated::PostPublicWorkspacesToolActionApprovalsDecideRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
84
|
+
end
|
|
85
|
+
h[k.to_sym] = v
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'decision')
|
|
89
|
+
self.decision = attributes[:'decision']
|
|
90
|
+
else
|
|
91
|
+
self.decision = nil
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
96
|
+
# @return Array for valid properties with the reasons
|
|
97
|
+
def list_invalid_properties
|
|
98
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
99
|
+
invalid_properties = Array.new
|
|
100
|
+
if @decision.nil?
|
|
101
|
+
invalid_properties.push('invalid value for "decision", decision cannot be nil.')
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
invalid_properties
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Check to see if the all the properties in the model are valid
|
|
108
|
+
# @return true if the model is valid
|
|
109
|
+
def valid?
|
|
110
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
111
|
+
return false if @decision.nil?
|
|
112
|
+
decision_validator = EnumAttributeValidator.new('String', ["allow_once", "deny"])
|
|
113
|
+
return false unless decision_validator.valid?(@decision)
|
|
114
|
+
true
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
118
|
+
# @param [Object] decision Object to be assigned
|
|
119
|
+
def decision=(decision)
|
|
120
|
+
validator = EnumAttributeValidator.new('String', ["allow_once", "deny"])
|
|
121
|
+
unless validator.valid?(decision)
|
|
122
|
+
fail ArgumentError, "invalid value for \"decision\", must be one of #{validator.allowable_values}."
|
|
123
|
+
end
|
|
124
|
+
@decision = decision
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Checks equality by comparing each attribute.
|
|
128
|
+
# @param [Object] Object to be compared
|
|
129
|
+
def ==(o)
|
|
130
|
+
return true if self.equal?(o)
|
|
131
|
+
self.class == o.class &&
|
|
132
|
+
decision == o.decision
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# @see the `==` method
|
|
136
|
+
# @param [Object] Object to be compared
|
|
137
|
+
def eql?(o)
|
|
138
|
+
self == o
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Calculates hash code according to all attributes.
|
|
142
|
+
# @return [Integer] Hash code
|
|
143
|
+
def hash
|
|
144
|
+
[decision].hash
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# Builds the object from hash
|
|
148
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
149
|
+
# @return [Object] Returns the model itself
|
|
150
|
+
def self.build_from_hash(attributes)
|
|
151
|
+
return nil unless attributes.is_a?(Hash)
|
|
152
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
153
|
+
transformed_hash = {}
|
|
154
|
+
openapi_types.each_pair do |key, type|
|
|
155
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
156
|
+
transformed_hash["#{key}"] = nil
|
|
157
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
158
|
+
# check to ensure the input is an array given that the attribute
|
|
159
|
+
# is documented as an array but the input is not
|
|
160
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
161
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
162
|
+
end
|
|
163
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
164
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
new(transformed_hash)
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Returns the object in the form of hash
|
|
171
|
+
# @return [Hash] Returns the object in the form of hash
|
|
172
|
+
def to_hash
|
|
173
|
+
hash = {}
|
|
174
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
175
|
+
value = self.send(attr)
|
|
176
|
+
if value.nil?
|
|
177
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
178
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
hash[param] = _to_hash(value)
|
|
182
|
+
end
|
|
183
|
+
hash
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
end
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Fetch Hive Public API
|
|
3
3
|
|
|
4
|
-
#The Fetch Hive public API lets you invoke prompts, workflows, agents, and Hive Agents programmatically using an API token. ## Authentication All requests require a Bearer token in the `Authorization` header: ``` Authorization: Bearer <your-api-token> ``` ## Streaming Pass `\"streaming\": true` in the request body to receive a `text/event-stream` response. Each event is a JSON object sent as `data: <json>\\n\\n`. The stream ends with `data: [DONE]\\n\\n`.
|
|
4
|
+
#The Fetch Hive public API lets you invoke prompts, workflows, agents, and Hive Agents programmatically using an API token. ## Authentication All requests require a Bearer token in the `Authorization` header: ``` Authorization: Bearer <your-api-token> ``` ## Breaking Error responses use `error_code`. The previous field name `code` is not returned. ## Streaming Pass `\"streaming\": true` in the request body to receive a `text/event-stream` response. Each event is a JSON object sent as `data: <json>\\n\\n`. The stream ends with `data: [DONE]\\n\\n`.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 0.
|
|
6
|
+
The version of the OpenAPI document: 0.4.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.22.0
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module FetchHive::Generated
|
|
17
|
-
# A single event in a Server-Sent Events stream. The `type` field is a runtime discriminator. Known values: - `reasoning` — a reasoning / thinking chunk (prompt and agent streams) - `response` — a text chunk (prompt and agent streams) - `tool` — a tool invocation result (agent stream only) - `artifact` — a generated document or image descriptor (agent stream only) - `usage` — final token usage event; signals end of meaningful stream content - `summary` — auto-summarization event emitted before reasoning when a thread history was compressed (agent stream only) - `error` — server-side error during streaming The stream is terminated by `data: [DONE]`, which is handled by the SSE parser and never surfaced as a chunk.
|
|
17
|
+
# A single event in a Server-Sent Events stream. The `type` field is a runtime discriminator. Known values: - `reasoning` — a reasoning / thinking chunk (prompt and agent streams) - `response` — a text chunk (prompt and agent streams) - `tool` — a tool invocation result (agent stream only) - `artifact` — a generated document or image descriptor (agent stream only) - `usage` — final token usage event; signals end of meaningful stream content - `tool_approval` — a paused tool call waiting for a decision (agent stream only) - `summary` — auto-summarization event emitted before reasoning when a thread history was compressed (agent stream only) - `error` — server-side error during streaming The stream is terminated by `data: [DONE]`, which is handled by the SSE parser and never surfaced as a chunk.
|
|
18
18
|
class SseChunk < ApiModelBase
|
|
19
19
|
# Event type discriminator.
|
|
20
20
|
attr_accessor :type
|
|
@@ -51,6 +51,30 @@ module FetchHive::Generated
|
|
|
51
51
|
# Reason the stream ended. Present on `usage` events (e.g. \"completed\").
|
|
52
52
|
attr_accessor :stop_reason
|
|
53
53
|
|
|
54
|
+
# Effective tool-approval mode. Present on the final `usage` event. On a `tool_approval` event this field is absent; the payload is `approval`.
|
|
55
|
+
attr_accessor :tool_approval
|
|
56
|
+
|
|
57
|
+
# Present on `tool_approval` events. The paused call.
|
|
58
|
+
attr_accessor :approval
|
|
59
|
+
|
|
60
|
+
# Present on the final `usage` event. `completed` or `awaiting_approval`.
|
|
61
|
+
attr_accessor :status
|
|
62
|
+
|
|
63
|
+
# Present on the final `usage` event. Public id for this run.
|
|
64
|
+
attr_accessor :run_id
|
|
65
|
+
|
|
66
|
+
# Present on the final `usage` event. The caller thread id, or null. (value may be null)
|
|
67
|
+
attr_accessor :thread_id
|
|
68
|
+
|
|
69
|
+
# Present on the final `usage` event when `status` is `awaiting_approval`.
|
|
70
|
+
attr_accessor :pending_tool_approvals
|
|
71
|
+
|
|
72
|
+
# Present on the final `usage` event when this turn denied one or more tools.
|
|
73
|
+
attr_accessor :denied_tool_calls
|
|
74
|
+
|
|
75
|
+
# Present on the final `usage` event when an override let one or more actions run. Each item has `summary` and `tool_name`.
|
|
76
|
+
attr_accessor :auto_approved_tool_calls
|
|
77
|
+
|
|
54
78
|
# Compressed summary of the prior conversation. Present for `summary` events.
|
|
55
79
|
attr_accessor :summary_text
|
|
56
80
|
|
|
@@ -68,6 +92,28 @@ module FetchHive::Generated
|
|
|
68
92
|
|
|
69
93
|
attr_accessor :usage
|
|
70
94
|
|
|
95
|
+
class EnumAttributeValidator
|
|
96
|
+
attr_reader :datatype
|
|
97
|
+
attr_reader :allowable_values
|
|
98
|
+
|
|
99
|
+
def initialize(datatype, allowable_values)
|
|
100
|
+
@allowable_values = allowable_values.map do |value|
|
|
101
|
+
case datatype.to_s
|
|
102
|
+
when /Integer/i
|
|
103
|
+
value.to_i
|
|
104
|
+
when /Float/i
|
|
105
|
+
value.to_f
|
|
106
|
+
else
|
|
107
|
+
value
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
def valid?(value)
|
|
113
|
+
!value || allowable_values.include?(value)
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
71
117
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
72
118
|
def self.attribute_map
|
|
73
119
|
{
|
|
@@ -83,6 +129,14 @@ module FetchHive::Generated
|
|
|
83
129
|
:'observation' => :'observation',
|
|
84
130
|
:'artifact' => :'artifact',
|
|
85
131
|
:'stop_reason' => :'stop_reason',
|
|
132
|
+
:'tool_approval' => :'tool_approval',
|
|
133
|
+
:'approval' => :'approval',
|
|
134
|
+
:'status' => :'status',
|
|
135
|
+
:'run_id' => :'run_id',
|
|
136
|
+
:'thread_id' => :'thread_id',
|
|
137
|
+
:'pending_tool_approvals' => :'pending_tool_approvals',
|
|
138
|
+
:'denied_tool_calls' => :'denied_tool_calls',
|
|
139
|
+
:'auto_approved_tool_calls' => :'auto_approved_tool_calls',
|
|
86
140
|
:'summary_text' => :'summary_text',
|
|
87
141
|
:'original_token_count' => :'original_token_count',
|
|
88
142
|
:'context_limit' => :'context_limit',
|
|
@@ -117,6 +171,14 @@ module FetchHive::Generated
|
|
|
117
171
|
:'observation' => :'String',
|
|
118
172
|
:'artifact' => :'GeneratedArtifact',
|
|
119
173
|
:'stop_reason' => :'String',
|
|
174
|
+
:'tool_approval' => :'String',
|
|
175
|
+
:'approval' => :'Hash<String, Object>',
|
|
176
|
+
:'status' => :'String',
|
|
177
|
+
:'run_id' => :'String',
|
|
178
|
+
:'thread_id' => :'String',
|
|
179
|
+
:'pending_tool_approvals' => :'Array<PendingToolApproval>',
|
|
180
|
+
:'denied_tool_calls' => :'Array<DeniedToolCall>',
|
|
181
|
+
:'auto_approved_tool_calls' => :'Array<SseChunkAutoApprovedToolCallsInner>',
|
|
120
182
|
:'summary_text' => :'String',
|
|
121
183
|
:'original_token_count' => :'Integer',
|
|
122
184
|
:'context_limit' => :'Integer',
|
|
@@ -198,6 +260,46 @@ module FetchHive::Generated
|
|
|
198
260
|
self.stop_reason = attributes[:'stop_reason']
|
|
199
261
|
end
|
|
200
262
|
|
|
263
|
+
if attributes.key?(:'tool_approval')
|
|
264
|
+
self.tool_approval = attributes[:'tool_approval']
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
if attributes.key?(:'approval')
|
|
268
|
+
if (value = attributes[:'approval']).is_a?(Hash)
|
|
269
|
+
self.approval = value
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
if attributes.key?(:'status')
|
|
274
|
+
self.status = attributes[:'status']
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
if attributes.key?(:'run_id')
|
|
278
|
+
self.run_id = attributes[:'run_id']
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
if attributes.key?(:'thread_id')
|
|
282
|
+
self.thread_id = attributes[:'thread_id']
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
if attributes.key?(:'pending_tool_approvals')
|
|
286
|
+
if (value = attributes[:'pending_tool_approvals']).is_a?(Array)
|
|
287
|
+
self.pending_tool_approvals = value
|
|
288
|
+
end
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
if attributes.key?(:'denied_tool_calls')
|
|
292
|
+
if (value = attributes[:'denied_tool_calls']).is_a?(Array)
|
|
293
|
+
self.denied_tool_calls = value
|
|
294
|
+
end
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
if attributes.key?(:'auto_approved_tool_calls')
|
|
298
|
+
if (value = attributes[:'auto_approved_tool_calls']).is_a?(Array)
|
|
299
|
+
self.auto_approved_tool_calls = value
|
|
300
|
+
end
|
|
301
|
+
end
|
|
302
|
+
|
|
201
303
|
if attributes.key?(:'summary_text')
|
|
202
304
|
self.summary_text = attributes[:'summary_text']
|
|
203
305
|
end
|
|
@@ -235,9 +337,21 @@ module FetchHive::Generated
|
|
|
235
337
|
# @return true if the model is valid
|
|
236
338
|
def valid?
|
|
237
339
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
340
|
+
tool_approval_validator = EnumAttributeValidator.new('String', ["policy", "auto_approve"])
|
|
341
|
+
return false unless tool_approval_validator.valid?(@tool_approval)
|
|
238
342
|
true
|
|
239
343
|
end
|
|
240
344
|
|
|
345
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
346
|
+
# @param [Object] tool_approval Object to be assigned
|
|
347
|
+
def tool_approval=(tool_approval)
|
|
348
|
+
validator = EnumAttributeValidator.new('String', ["policy", "auto_approve"])
|
|
349
|
+
unless validator.valid?(tool_approval)
|
|
350
|
+
fail ArgumentError, "invalid value for \"tool_approval\", must be one of #{validator.allowable_values}."
|
|
351
|
+
end
|
|
352
|
+
@tool_approval = tool_approval
|
|
353
|
+
end
|
|
354
|
+
|
|
241
355
|
# Checks equality by comparing each attribute.
|
|
242
356
|
# @param [Object] Object to be compared
|
|
243
357
|
def ==(o)
|
|
@@ -255,6 +369,14 @@ module FetchHive::Generated
|
|
|
255
369
|
observation == o.observation &&
|
|
256
370
|
artifact == o.artifact &&
|
|
257
371
|
stop_reason == o.stop_reason &&
|
|
372
|
+
tool_approval == o.tool_approval &&
|
|
373
|
+
approval == o.approval &&
|
|
374
|
+
status == o.status &&
|
|
375
|
+
run_id == o.run_id &&
|
|
376
|
+
thread_id == o.thread_id &&
|
|
377
|
+
pending_tool_approvals == o.pending_tool_approvals &&
|
|
378
|
+
denied_tool_calls == o.denied_tool_calls &&
|
|
379
|
+
auto_approved_tool_calls == o.auto_approved_tool_calls &&
|
|
258
380
|
summary_text == o.summary_text &&
|
|
259
381
|
original_token_count == o.original_token_count &&
|
|
260
382
|
context_limit == o.context_limit &&
|
|
@@ -272,7 +394,7 @@ module FetchHive::Generated
|
|
|
272
394
|
# Calculates hash code according to all attributes.
|
|
273
395
|
# @return [Integer] Hash code
|
|
274
396
|
def hash
|
|
275
|
-
[type, response, request_id, model, done, tool_id, tool, tool_type, tool_input, observation, artifact, stop_reason, summary_text, original_token_count, context_limit, provider, error, usage].hash
|
|
397
|
+
[type, response, request_id, model, done, tool_id, tool, tool_type, tool_input, observation, artifact, stop_reason, tool_approval, approval, status, run_id, thread_id, pending_tool_approvals, denied_tool_calls, auto_approved_tool_calls, summary_text, original_token_count, context_limit, provider, error, usage].hash
|
|
276
398
|
end
|
|
277
399
|
|
|
278
400
|
# Builds the object from hash
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Fetch Hive Public API
|
|
3
|
+
|
|
4
|
+
#The Fetch Hive public API lets you invoke prompts, workflows, agents, and Hive Agents programmatically using an API token. ## Authentication All requests require a Bearer token in the `Authorization` header: ``` Authorization: Bearer <your-api-token> ``` ## Breaking Error responses use `error_code`. The previous field name `code` is not returned. ## Streaming Pass `\"streaming\": true` in the request body to receive a `text/event-stream` response. Each event is a JSON object sent as `data: <json>\\n\\n`. The stream ends with `data: [DONE]\\n\\n`.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.4.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module FetchHive::Generated
|
|
17
|
+
class SseChunkAutoApprovedToolCallsInner < ApiModelBase
|
|
18
|
+
attr_accessor :summary
|
|
19
|
+
|
|
20
|
+
attr_accessor :tool_name
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'summary' => :'summary',
|
|
26
|
+
:'tool_name' => :'tool_name'
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Returns attribute mapping this model knows about
|
|
31
|
+
def self.acceptable_attribute_map
|
|
32
|
+
attribute_map
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns all the JSON keys this model knows about
|
|
36
|
+
def self.acceptable_attributes
|
|
37
|
+
acceptable_attribute_map.values
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Attribute type mapping.
|
|
41
|
+
def self.openapi_types
|
|
42
|
+
{
|
|
43
|
+
:'summary' => :'String',
|
|
44
|
+
:'tool_name' => :'String'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List of attributes with nullable: true
|
|
49
|
+
def self.openapi_nullable
|
|
50
|
+
Set.new([
|
|
51
|
+
])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Initializes the object
|
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
|
+
def initialize(attributes = {})
|
|
57
|
+
if (!attributes.is_a?(Hash))
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `FetchHive::Generated::SseChunkAutoApprovedToolCallsInner` initialize method"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `FetchHive::Generated::SseChunkAutoApprovedToolCallsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
66
|
+
end
|
|
67
|
+
h[k.to_sym] = v
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'summary')
|
|
71
|
+
self.summary = attributes[:'summary']
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
if attributes.key?(:'tool_name')
|
|
75
|
+
self.tool_name = attributes[:'tool_name']
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
80
|
+
# @return Array for valid properties with the reasons
|
|
81
|
+
def list_invalid_properties
|
|
82
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
83
|
+
invalid_properties = Array.new
|
|
84
|
+
invalid_properties
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Check to see if the all the properties in the model are valid
|
|
88
|
+
# @return true if the model is valid
|
|
89
|
+
def valid?
|
|
90
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
91
|
+
true
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Checks equality by comparing each attribute.
|
|
95
|
+
# @param [Object] Object to be compared
|
|
96
|
+
def ==(o)
|
|
97
|
+
return true if self.equal?(o)
|
|
98
|
+
self.class == o.class &&
|
|
99
|
+
summary == o.summary &&
|
|
100
|
+
tool_name == o.tool_name
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# @see the `==` method
|
|
104
|
+
# @param [Object] Object to be compared
|
|
105
|
+
def eql?(o)
|
|
106
|
+
self == o
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Calculates hash code according to all attributes.
|
|
110
|
+
# @return [Integer] Hash code
|
|
111
|
+
def hash
|
|
112
|
+
[summary, tool_name].hash
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Builds the object from hash
|
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
117
|
+
# @return [Object] Returns the model itself
|
|
118
|
+
def self.build_from_hash(attributes)
|
|
119
|
+
return nil unless attributes.is_a?(Hash)
|
|
120
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
121
|
+
transformed_hash = {}
|
|
122
|
+
openapi_types.each_pair do |key, type|
|
|
123
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
124
|
+
transformed_hash["#{key}"] = nil
|
|
125
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
126
|
+
# check to ensure the input is an array given that the attribute
|
|
127
|
+
# is documented as an array but the input is not
|
|
128
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
129
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
130
|
+
end
|
|
131
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
132
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
new(transformed_hash)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Returns the object in the form of hash
|
|
139
|
+
# @return [Hash] Returns the object in the form of hash
|
|
140
|
+
def to_hash
|
|
141
|
+
hash = {}
|
|
142
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
143
|
+
value = self.send(attr)
|
|
144
|
+
if value.nil?
|
|
145
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
146
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
hash[param] = _to_hash(value)
|
|
150
|
+
end
|
|
151
|
+
hash
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
end
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Fetch Hive Public API
|
|
3
3
|
|
|
4
|
-
#The Fetch Hive public API lets you invoke prompts, workflows, agents, and Hive Agents programmatically using an API token. ## Authentication All requests require a Bearer token in the `Authorization` header: ``` Authorization: Bearer <your-api-token> ``` ## Streaming Pass `\"streaming\": true` in the request body to receive a `text/event-stream` response. Each event is a JSON object sent as `data: <json>\\n\\n`. The stream ends with `data: [DONE]\\n\\n`.
|
|
4
|
+
#The Fetch Hive public API lets you invoke prompts, workflows, agents, and Hive Agents programmatically using an API token. ## Authentication All requests require a Bearer token in the `Authorization` header: ``` Authorization: Bearer <your-api-token> ``` ## Breaking Error responses use `error_code`. The previous field name `code` is not returned. ## Streaming Pass `\"streaming\": true` in the request body to receive a `text/event-stream` response. Each event is a JSON object sent as `data: <json>\\n\\n`. The stream ends with `data: [DONE]\\n\\n`.
|
|
5
5
|
|
|
6
|
-
The version of the OpenAPI document: 0.
|
|
6
|
+
The version of the OpenAPI document: 0.4.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.22.0
|