fetch_hive 0.2.4 → 0.2.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37b77a6a159964d561dc379a54c47c8231e235a8f60b2397bed73aaeb79304b3
4
- data.tar.gz: a805ca9d930d1ad821b673a84b95a8bf854611eccb619716895b24d256aa6b1e
3
+ metadata.gz: 42e51d3c63d74fff1f041e1e9f7071ece5a5209825f17a28084ef3d06104552b
4
+ data.tar.gz: a53eba2263d50961c429130a1fd31d02c5c2c996f8c997bb6ba0b169f1263f56
5
5
  SHA512:
6
- metadata.gz: ffa21ea91982cf6cbf080b2db47f41688e2b30465f738c6cb8cc166173dfa4efb7ab367195bcd3cff48e22d18a5c88ea38e22ece304020d5cbfb0e5238421591
7
- data.tar.gz: e4da47bd790f4fa171613251bd89cf5db5dbc1eb7539ed044e1fb9cd7e5bc0005ef0ea91606353211c8f94f3479c74a0bc09bfacc6c803929ea97f972399a6b9
6
+ metadata.gz: bf84fa42a8112466fc9fb1f7a8b4b682ce128f15b4c7377b9d2b1d7c70f690c01aa1321ad71e41905e6ae32a12d5fd917889f34f08e00090b58214eea0adf945
7
+ data.tar.gz: 983b6660e859c97b56c1584d14975a92adfe2d3c4a8e23b6c12b7bf0d7594c515511ccb200974808b2a65e2c998b175f19abdc719f4b8c92f5ab45c4d5dd1038
data/README.md CHANGED
@@ -9,7 +9,7 @@ Official Ruby SDK for [Fetch Hive](https://fetchhive.com) — invoke AI prompts,
9
9
  Add to your `Gemfile`:
10
10
 
11
11
  ```ruby
12
- gem "fetch_hive", "~> 0.2.4"
12
+ gem "fetch_hive", "~> 0.2.5"
13
13
  ```
14
14
 
15
15
  Then run:
@@ -142,7 +142,7 @@ client = FetchHive::Client.new # picks up FETCH_HIVE_API_KEY automatically
142
142
 
143
143
  ## Version
144
144
 
145
- 0.2.4
145
+ 0.2.5
146
146
 
147
147
  ## License
148
148
 
@@ -42,32 +42,35 @@ module FetchHive
42
42
  # ── Prompt ─────────────────────────────────────────────────────────────────
43
43
 
44
44
  # Invoke a prompt deployment and return the full response hash.
45
- def invoke_prompt(deployment:, variant: nil, inputs: nil, user: nil)
45
+ def invoke_prompt(deployment:, variant: nil, inputs: nil, user: nil, metadata: nil)
46
46
  body = { deployment: deployment, streaming: false }
47
47
  body[:variant] = variant if variant
48
48
  body[:inputs] = inputs if inputs
49
49
  body[:user] = user if user
50
+ body[:metadata] = metadata if metadata
50
51
  post("/invoke", body)
51
52
  end
52
53
 
53
54
  # Invoke a prompt deployment and stream SSE events.
54
55
  # Yields each parsed event hash. Returns an Enumerator when no block given.
55
- def invoke_prompt_stream(deployment:, variant: nil, inputs: nil, user: nil, &block)
56
+ def invoke_prompt_stream(deployment:, variant: nil, inputs: nil, user: nil, metadata: nil, &block)
56
57
  body = { deployment: deployment, streaming: true }
57
58
  body[:variant] = variant if variant
58
59
  body[:inputs] = inputs if inputs
59
60
  body[:user] = user if user
61
+ body[:metadata] = metadata if metadata
60
62
  post_stream("/invoke", body, &block)
61
63
  end
62
64
 
63
65
  # ── Workflow ────────────────────────────────────────────────────────────────
64
66
 
65
67
  # Invoke a workflow deployment (sync or async).
66
- def invoke_workflow(deployment:, variant: nil, inputs: nil, async_mode: false, callback_url: nil, user: nil)
68
+ def invoke_workflow(deployment:, variant: nil, inputs: nil, async_mode: false, callback_url: nil, user: nil, metadata: nil)
67
69
  body = { deployment: deployment }
68
70
  body[:variant] = variant if variant
69
71
  body[:inputs] = inputs if inputs
70
72
  body[:user] = user if user
73
+ body[:metadata] = metadata if metadata
71
74
  if async_mode
72
75
  body[:async] = { enabled: true }
73
76
  body[:async][:callback_url] = callback_url if callback_url
@@ -78,10 +81,11 @@ module FetchHive
78
81
  # ── Agent ───────────────────────────────────────────────────────────────────
79
82
 
80
83
  # Send a message to an agent and return the full response hash.
81
- def invoke_agent(agent:, message:, thread_id: nil, user: nil, messages: nil, image_urls: nil)
84
+ def invoke_agent(agent:, message:, thread_id: nil, user: nil, metadata: nil, messages: nil, image_urls: nil)
82
85
  body = { agent: agent, message: message, streaming: false }
83
86
  body[:thread_id] = thread_id if thread_id
84
87
  body[:user] = user if user
88
+ body[:metadata] = metadata if metadata
85
89
  body[:messages] = messages if messages
86
90
  body[:image_urls] = image_urls if image_urls
87
91
  post("/agent/invoke", body)
@@ -89,10 +93,11 @@ module FetchHive
89
93
 
90
94
  # Send a message to an agent and stream SSE events.
91
95
  # Yields each parsed event hash. Returns an Enumerator when no block given.
92
- def invoke_agent_stream(agent:, message:, thread_id: nil, user: nil, messages: nil, image_urls: nil, &block)
96
+ def invoke_agent_stream(agent:, message:, thread_id: nil, user: nil, metadata: nil, messages: nil, image_urls: nil, &block)
93
97
  body = { agent: agent, message: message, streaming: true }
94
98
  body[:thread_id] = thread_id if thread_id
95
99
  body[:user] = user if user
100
+ body[:metadata] = metadata if metadata
96
101
  body[:messages] = messages if messages
97
102
  body[:image_urls] = image_urls if image_urls
98
103
  post_stream("/agent/invoke", body, &block)
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -30,6 +30,9 @@ module FetchHive::Generated
30
30
  # Optional opaque caller identifier for audit logging.
31
31
  attr_accessor :user
32
32
 
33
+ # Flat caller-defined metadata stored separately from internal metadata for log display and filtering. Keys must be non-empty strings; values must be strings, numbers, booleans, or null.
34
+ attr_accessor :metadata
35
+
33
36
  # Ephemeral conversation history supplied by the caller. Not stored in the database. Takes precedence over `thread_id` history when both are provided.
34
37
  attr_accessor :messages
35
38
 
@@ -44,6 +47,7 @@ module FetchHive::Generated
44
47
  :'thread_id' => :'thread_id',
45
48
  :'streaming' => :'streaming',
46
49
  :'user' => :'user',
50
+ :'metadata' => :'metadata',
47
51
  :'messages' => :'messages',
48
52
  :'image_urls' => :'image_urls'
49
53
  }
@@ -67,6 +71,7 @@ module FetchHive::Generated
67
71
  :'thread_id' => :'String',
68
72
  :'streaming' => :'Boolean',
69
73
  :'user' => :'String',
74
+ :'metadata' => :'Hash<String, MetadataValue>',
70
75
  :'messages' => :'Array<AgentMessage>',
71
76
  :'image_urls' => :'Array<String>'
72
77
  }
@@ -122,6 +127,12 @@ module FetchHive::Generated
122
127
  self.user = attributes[:'user']
123
128
  end
124
129
 
130
+ if attributes.key?(:'metadata')
131
+ if (value = attributes[:'metadata']).is_a?(Hash)
132
+ self.metadata = value
133
+ end
134
+ end
135
+
125
136
  if attributes.key?(:'messages')
126
137
  if (value = attributes[:'messages']).is_a?(Array)
127
138
  self.messages = value
@@ -190,6 +201,7 @@ module FetchHive::Generated
190
201
  thread_id == o.thread_id &&
191
202
  streaming == o.streaming &&
192
203
  user == o.user &&
204
+ metadata == o.metadata &&
193
205
  messages == o.messages &&
194
206
  image_urls == o.image_urls
195
207
  end
@@ -203,7 +215,7 @@ module FetchHive::Generated
203
215
  # Calculates hash code according to all attributes.
204
216
  # @return [Integer] Hash code
205
217
  def hash
206
- [message, agent, thread_id, streaming, user, messages, image_urls].hash
218
+ [message, agent, thread_id, streaming, user, metadata, messages, image_urls].hash
207
219
  end
208
220
 
209
221
  # Builds the object from hash
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -30,6 +30,9 @@ module FetchHive::Generated
30
30
  # Optional opaque caller identifier for audit logging.
31
31
  attr_accessor :user
32
32
 
33
+ # Flat caller-defined metadata stored separately from internal metadata for log display and filtering. Keys must be non-empty strings; values must be strings, numbers, booleans, or null.
34
+ attr_accessor :metadata
35
+
33
36
  # Attribute mapping from ruby-style variable name to JSON key.
34
37
  def self.attribute_map
35
38
  {
@@ -37,7 +40,8 @@ module FetchHive::Generated
37
40
  :'variant' => :'variant',
38
41
  :'inputs' => :'inputs',
39
42
  :'streaming' => :'streaming',
40
- :'user' => :'user'
43
+ :'user' => :'user',
44
+ :'metadata' => :'metadata'
41
45
  }
42
46
  end
43
47
 
@@ -58,7 +62,8 @@ module FetchHive::Generated
58
62
  :'variant' => :'String',
59
63
  :'inputs' => :'Hash<String, Object>',
60
64
  :'streaming' => :'Boolean',
61
- :'user' => :'String'
65
+ :'user' => :'String',
66
+ :'metadata' => :'Hash<String, MetadataValue>'
62
67
  }
63
68
  end
64
69
 
@@ -111,6 +116,12 @@ module FetchHive::Generated
111
116
  if attributes.key?(:'user')
112
117
  self.user = attributes[:'user']
113
118
  end
119
+
120
+ if attributes.key?(:'metadata')
121
+ if (value = attributes[:'metadata']).is_a?(Hash)
122
+ self.metadata = value
123
+ end
124
+ end
114
125
  end
115
126
 
116
127
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -152,7 +163,8 @@ module FetchHive::Generated
152
163
  variant == o.variant &&
153
164
  inputs == o.inputs &&
154
165
  streaming == o.streaming &&
155
- user == o.user
166
+ user == o.user &&
167
+ metadata == o.metadata
156
168
  end
157
169
 
158
170
  # @see the `==` method
@@ -164,7 +176,7 @@ module FetchHive::Generated
164
176
  # Calculates hash code according to all attributes.
165
177
  # @return [Integer] Hash code
166
178
  def hash
167
- [deployment, variant, inputs, streaming, user].hash
179
+ [deployment, variant, inputs, streaming, user, metadata].hash
168
180
  end
169
181
 
170
182
  # Builds the object from hash
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -29,6 +29,9 @@ module FetchHive::Generated
29
29
  # Optional opaque caller identifier for audit logging.
30
30
  attr_accessor :user
31
31
 
32
+ # Flat caller-defined metadata stored separately from internal metadata for log display and filtering. Keys must be non-empty strings; values must be strings, numbers, booleans, or null.
33
+ attr_accessor :metadata
34
+
32
35
  # Attribute mapping from ruby-style variable name to JSON key.
33
36
  def self.attribute_map
34
37
  {
@@ -36,7 +39,8 @@ module FetchHive::Generated
36
39
  :'variant' => :'variant',
37
40
  :'inputs' => :'inputs',
38
41
  :'async' => :'async',
39
- :'user' => :'user'
42
+ :'user' => :'user',
43
+ :'metadata' => :'metadata'
40
44
  }
41
45
  end
42
46
 
@@ -57,7 +61,8 @@ module FetchHive::Generated
57
61
  :'variant' => :'String',
58
62
  :'inputs' => :'Hash<String, Object>',
59
63
  :'async' => :'AsyncConfig',
60
- :'user' => :'String'
64
+ :'user' => :'String',
65
+ :'metadata' => :'Hash<String, MetadataValue>'
61
66
  }
62
67
  end
63
68
 
@@ -108,6 +113,12 @@ module FetchHive::Generated
108
113
  if attributes.key?(:'user')
109
114
  self.user = attributes[:'user']
110
115
  end
116
+
117
+ if attributes.key?(:'metadata')
118
+ if (value = attributes[:'metadata']).is_a?(Hash)
119
+ self.metadata = value
120
+ end
121
+ end
111
122
  end
112
123
 
113
124
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -149,7 +160,8 @@ module FetchHive::Generated
149
160
  variant == o.variant &&
150
161
  inputs == o.inputs &&
151
162
  async == o.async &&
152
- user == o.user
163
+ user == o.user &&
164
+ metadata == o.metadata
153
165
  end
154
166
 
155
167
  # @see the `==` method
@@ -161,7 +173,7 @@ module FetchHive::Generated
161
173
  # Calculates hash code according to all attributes.
162
174
  # @return [Integer] Hash code
163
175
  def hash
164
- [deployment, variant, inputs, async, user].hash
176
+ [deployment, variant, inputs, async, user, metadata].hash
165
177
  end
166
178
 
167
179
  # Builds the object from hash
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -0,0 +1,105 @@
1
+ =begin
2
+ #Fetch Hive Public API
3
+
4
+ #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
+
6
+ The version of the OpenAPI document: 0.2.5
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
+ module MetadataValue
18
+ class << self
19
+ # List of class defined in oneOf (OpenAPI v3)
20
+ def openapi_one_of
21
+ [
22
+ :'Boolean',
23
+ :'Float',
24
+ :'String'
25
+ ]
26
+ end
27
+
28
+ # Builds the object
29
+ # @param [Mixed] Data to be matched against the list of oneOf items
30
+ # @return [Object] Returns the model or the data itself
31
+ def build(data)
32
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
33
+ # Note:
34
+ # - We do not attempt to check whether exactly one item matches.
35
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
36
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
37
+ # - TODO: scalar values are de facto behaving as if they were nullable.
38
+ # - TODO: logging when debugging is set.
39
+ openapi_one_of.each do |klass|
40
+ begin
41
+ next if klass == :AnyType # "nullable: true"
42
+ return find_and_cast_into_type(klass, data)
43
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
44
+ end
45
+ end
46
+
47
+ openapi_one_of.include?(:AnyType) ? data : nil
48
+ end
49
+
50
+ private
51
+
52
+ SchemaMismatchError = Class.new(StandardError)
53
+
54
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
55
+ def find_and_cast_into_type(klass, data)
56
+ return if data.nil?
57
+
58
+ case klass.to_s
59
+ when 'Boolean'
60
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
61
+ when 'Float'
62
+ return data if data.instance_of?(Float)
63
+ when 'Integer'
64
+ return data if data.instance_of?(Integer)
65
+ when 'Time'
66
+ return Time.parse(data)
67
+ when 'Date'
68
+ return Date.iso8601(data)
69
+ when 'String'
70
+ return data if data.instance_of?(String)
71
+ when 'Object' # "type: object"
72
+ return data if data.instance_of?(Hash)
73
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
74
+ if data.instance_of?(Array)
75
+ sub_type = Regexp.last_match[:sub_type]
76
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
77
+ end
78
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
79
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
80
+ sub_type = Regexp.last_match[:sub_type]
81
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
82
+ end
83
+ else # model
84
+ const = FetchHive::Generated.const_get(klass)
85
+ if const
86
+ if const.respond_to?(:openapi_one_of) # nested oneOf model
87
+ model = const.build(data)
88
+ return model if model
89
+ else
90
+ # raise if data contains keys that are not known to the model
91
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
92
+ model = const.build_from_hash(data)
93
+ return model if model
94
+ end
95
+ end
96
+ end
97
+
98
+ raise # if no match by now, raise
99
+ rescue
100
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
101
+ end
102
+ end
103
+ end
104
+
105
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The Fetch Hive public API lets you invoke prompts, workflows, and 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`.
5
5
 
6
- The version of the OpenAPI document: 0.2.4
6
+ The version of the OpenAPI document: 0.2.5
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fetch_hive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fetch Hive
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-17 00:00:00.000000000 Z
11
+ date: 2026-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -66,6 +66,7 @@ files:
66
66
  - lib/fetch_hive/generated/models/invoke_workflow_async_response.rb
67
67
  - lib/fetch_hive/generated/models/invoke_workflow_request.rb
68
68
  - lib/fetch_hive/generated/models/invoke_workflow_response.rb
69
+ - lib/fetch_hive/generated/models/metadata_value.rb
69
70
  - lib/fetch_hive/generated/models/sse_chunk.rb
70
71
  - lib/fetch_hive/generated/models/token_usage.rb
71
72
  - lib/fetch_hive/generated/models/tool_invocation.rb