fetch_hive 0.2.2 → 0.2.3

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: cb9c7b6224f335829b0c44df8fcbf9eb51a116d1adc8349662d5f19299fe0561
4
- data.tar.gz: 00c639eeb3ae5857ba4044d481ece8f4e61d443522eec500e52ce05f1aa35406
3
+ metadata.gz: 6f27931a3ac0003f9116aa9e5d0fc8a872ace63a0514f5c700cd18df613c56d4
4
+ data.tar.gz: 0ebadee4a39f04f58af432fee05f8f3398397bf806c520506f9e808e00a4edfc
5
5
  SHA512:
6
- metadata.gz: e202d13a1a682b2ceaa470e07153b42c2959398d6dfea6c15a4661c298fcbace443f557110b2783186eaac2186cc0ee50913a4948f68328f9981f029af5ca696
7
- data.tar.gz: 911804e51870a54f5be80bd57fcb56088adf098fd9fbec00f518505eff89e68afb7ef28df44b9b80fcac2db2621bba4a2997ead022096e9ce792460aede7d663
6
+ metadata.gz: 4c3c0e5dc156a36db4bf8fe934f8cd8d65dc4b85e56c03deddb77f10fe7e7118bbf70946ee972fe666cefd40aab9d63e5fc1c6cfb0220876939473e53fa95e45
7
+ data.tar.gz: e2a222c32d2857f10030aaa90e1aefd1bae8a0cab2e9f3c1a3b0a97e526c3ffbd2473c124e81a4098b54755e0a895f3674eb1d06cd71eb2fa7185bee1a5e9e7e
data/README.md CHANGED
@@ -1,15 +1,15 @@
1
- # Fetch Hive Ruby SDK
1
+ # fetch_hive
2
2
 
3
- Official Ruby SDK for the [Fetch Hive](https://fetchhive.com) API — invoke prompts, workflows, and agents with a clean, idiomatic interface.
3
+ Official Ruby SDK for [Fetch Hive](https://fetchhive.com) — invoke AI prompts, workflows, and agents from your application.
4
4
 
5
- **Version:** 0.2.2
5
+ [![Gem Version](https://badge.fury.io/rb/fetch_hive.svg)](https://rubygems.org/gems/fetch_hive)
6
6
 
7
7
  ## Installation
8
8
 
9
9
  Add to your `Gemfile`:
10
10
 
11
11
  ```ruby
12
- gem "fetch_hive", "~> 0.2.2"
12
+ gem "fetch_hive", "~> 0.2.3"
13
13
  ```
14
14
 
15
15
  Then run:
@@ -30,25 +30,98 @@ gem install fetch_hive
30
30
  require "fetch_hive"
31
31
 
32
32
  client = FetchHive::Client.new(api_key: ENV["FETCH_HIVE_API_KEY"])
33
+ ```
34
+
35
+ Get your API key from the [Fetch Hive dashboard](https://app.fetchhive.com).
36
+
37
+ ## Invoke a prompt
33
38
 
34
- # Invoke a prompt
35
- result = client.invoke_prompt(deployment: "my-prompt", inputs: { name: "Alice" })
39
+ ```ruby
40
+ result = client.invoke_prompt(
41
+ deployment: "my-prompt",
42
+ inputs: { name: "Alice", topic: "machine learning" }
43
+ )
36
44
  puts result["response"]
45
+ ```
46
+
47
+ ## Invoke a prompt (streaming)
48
+
49
+ ```ruby
50
+ client.invoke_prompt_stream(deployment: "my-prompt", inputs: { name: "Alice" }) do |chunk|
51
+ print chunk["content"] if chunk["type"] == "delta"
52
+ end
53
+ ```
37
54
 
38
- # Invoke a workflow
39
- run = client.invoke_workflow(deployment: "my-workflow", inputs: { topic: "AI" })
40
- puts run["output"]
55
+ ## Invoke a workflow
41
56
 
42
- # Send a message to an agent (non-streaming)
43
- reply = client.invoke_agent(agent: "my-agent", message: "Hello!")
57
+ ```ruby
58
+ run = client.invoke_workflow(
59
+ deployment: "my-workflow",
60
+ inputs: { customer_id: "42" }
61
+ )
62
+ puts run["status"], run["output"]
63
+ ```
64
+
65
+ ## Invoke a workflow (async)
66
+
67
+ ```ruby
68
+ run = client.invoke_workflow(
69
+ deployment: "my-workflow",
70
+ inputs: { customer_id: "42" },
71
+ async_mode: true,
72
+ callback_url: "https://example.com/webhook"
73
+ )
74
+ puts "Queued: #{run['run_id']}"
75
+ ```
76
+
77
+ ## Invoke an agent
78
+
79
+ ```ruby
80
+ reply = client.invoke_agent(
81
+ agent: "my-agent",
82
+ message: "What is the weather in London?"
83
+ )
44
84
  puts reply["response"]
85
+ ```
45
86
 
46
- # Stream an agent response
47
- client.invoke_agent_stream(agent: "my-agent", message: "Tell me a story") do |chunk|
48
- print chunk["content"] if chunk["type"] == "delta"
87
+ ## Invoke an agent (streaming)
88
+
89
+ ```ruby
90
+ client.invoke_agent_stream(
91
+ agent: "my-agent",
92
+ message: "What is the weather in London?",
93
+ thread_id: "session-abc123" # optional — persist conversation history
94
+ ) do |chunk|
95
+ case chunk["type"]
96
+ when "delta" then print chunk["content"]
97
+ when "tool_start" then puts "\nCalling tool: #{chunk['tool_name']}"
98
+ end
49
99
  end
50
100
  ```
51
101
 
102
+ ## Multimodal (image) inputs
103
+
104
+ ```ruby
105
+ result = client.invoke_agent(
106
+ agent: "vision-agent",
107
+ message: "Describe this image",
108
+ image_urls: ["https://example.com/photo.jpg"]
109
+ )
110
+ puts result["response"]
111
+ ```
112
+
113
+ ## Authentication
114
+
115
+ Pass the API key to the constructor or set the environment variable:
116
+
117
+ ```bash
118
+ export FETCH_HIVE_API_KEY=fhk_...
119
+ ```
120
+
121
+ ```ruby
122
+ client = FetchHive::Client.new # picks up FETCH_HIVE_API_KEY automatically
123
+ ```
124
+
52
125
  ## Configuration
53
126
 
54
127
  | Option | Default | Description |
@@ -62,3 +135,11 @@ end
62
135
  - [Fetch Hive dashboard](https://app.fetchhive.com)
63
136
  - [API documentation](https://docs.fetchhive.com)
64
137
  - [GitHub](https://github.com/Fetch-Hive/ruby-sdk)
138
+
139
+ ## Version
140
+
141
+ 0.2.3
142
+
143
+ ## License
144
+
145
+ MIT — see [LICENSE](LICENSE).
@@ -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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
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.2
6
+ The version of the OpenAPI document: 0.2.3
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fetch_hive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fetch Hive