handinger 0.0.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -0
- data/README.md +18 -18
- data/lib/handinger/client.rb +21 -1
- data/lib/handinger/internal/transport/base_client.rb +1 -3
- data/lib/handinger/internal/type/base_model.rb +3 -3
- data/lib/handinger/models/create_task.rb +28 -0
- data/lib/handinger/models/create_worker.rb +59 -19
- data/lib/handinger/models/task.rb +119 -0
- data/lib/handinger/models/task_create_params.rb +14 -0
- data/lib/handinger/models/{worker_continue_params.rb → task_retrieve_params.rb} +6 -6
- data/lib/handinger/models/task_with_turns.rb +113 -0
- data/lib/handinger/models/worker.rb +15 -84
- data/lib/handinger/models/worker_create_response.rb +84 -0
- data/lib/handinger/models/worker_retrieve_email_response.rb +10 -1
- data/lib/handinger/models/worker_retrieve_params.rb +22 -4
- data/lib/handinger/models.rb +10 -6
- data/lib/handinger/resources/tasks.rb +76 -0
- data/lib/handinger/resources/workers.rb +31 -92
- data/lib/handinger/version.rb +1 -1
- data/lib/handinger.rb +7 -6
- data/rbi/handinger/client.rbi +5 -0
- data/rbi/handinger/internal/transport/base_client.rbi +2 -18
- data/rbi/handinger/models/create_task.rbi +40 -0
- data/rbi/handinger/models/create_worker.rbi +84 -26
- data/rbi/handinger/models/task.rbi +160 -0
- data/rbi/handinger/models/task_create_params.rbi +27 -0
- data/rbi/handinger/models/{worker_continue_params.rbi → task_retrieve_params.rbi} +6 -6
- data/rbi/handinger/models/task_with_turns.rbi +149 -0
- data/rbi/handinger/models/worker.rbi +16 -117
- data/rbi/handinger/models/worker_create_response.rbi +129 -0
- data/rbi/handinger/models/worker_retrieve_email_response.rbi +20 -1
- data/rbi/handinger/models/worker_retrieve_params.rbi +40 -6
- data/rbi/handinger/models.rbi +10 -6
- data/rbi/handinger/resources/tasks.rbi +70 -0
- data/rbi/handinger/resources/workers.rbi +37 -62
- data/sig/handinger/client.rbs +2 -0
- data/sig/handinger/models/create_task.rbs +19 -0
- data/sig/handinger/models/create_worker.rbs +44 -23
- data/sig/handinger/models/task.rbs +114 -0
- data/sig/handinger/models/task_create_params.rbs +15 -0
- data/sig/handinger/models/{worker_stream_updates_params.rbs → task_retrieve_params.rbs} +6 -6
- data/sig/handinger/models/task_with_turns.rbs +104 -0
- data/sig/handinger/models/worker.rbs +11 -86
- data/sig/handinger/models/worker_create_response.rbs +76 -0
- data/sig/handinger/models/worker_retrieve_email_response.rbs +9 -1
- data/sig/handinger/models/worker_retrieve_params.rbs +21 -5
- data/sig/handinger/models.rbs +10 -6
- data/sig/handinger/resources/tasks.rbs +24 -0
- data/sig/handinger/resources/workers.rbs +9 -25
- metadata +23 -20
- data/lib/handinger/internal/stream.rb +0 -29
- data/lib/handinger/internal/type/base_stream.rb +0 -83
- data/lib/handinger/models/worker_retrieve_file_params.rb +0 -26
- data/lib/handinger/models/worker_stream_updates_params.rb +0 -20
- data/lib/handinger/models/worker_stream_updates_response.rb +0 -7
- data/rbi/handinger/internal/stream.rbi +0 -20
- data/rbi/handinger/internal/type/base_stream.rbi +0 -75
- data/rbi/handinger/models/worker_retrieve_file_params.rbi +0 -46
- data/rbi/handinger/models/worker_stream_updates_params.rbi +0 -38
- data/rbi/handinger/models/worker_stream_updates_response.rbi +0 -7
- data/sig/handinger/internal/stream.rbs +0 -9
- data/sig/handinger/internal/type/base_stream.rbs +0 -38
- data/sig/handinger/models/worker_continue_params.rbs +0 -25
- data/sig/handinger/models/worker_retrieve_file_params.rbs +0 -28
- data/sig/handinger/models/worker_stream_updates_response.rbs +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1ae7f9037381d42cd6aa3a76e17a2d9fabd3d181ec11de76508cfab052ec59f8
|
|
4
|
+
data.tar.gz: 860f3d892ca6812067ec4c75813980af4a78465eb9082777b78f12023c78bf65
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4b7755b6f5b51e59b2f5f909b938ac4afa885e000db0b042b3a5fc433a59ff7f8b037ee2b462ca813290940db0c2de4ba11a5311fb18a38a893bf6448c265b37
|
|
7
|
+
data.tar.gz: '09e651e70da0ca7df7fe4f72e11518e77e3a3cc0305ec5e0eb18f21af8cb81f90b67a304ef8fd88437ec6e4ed0eff52157c0937e88bf557636bee80e7afab7a3'
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0 (2026-05-09)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0...v0.2.0](https://github.com/Ramensoft/handinger-ruby/compare/v0.1.0...v0.2.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* Add JSON Schema output validation and structured display ([d2d009f](https://github.com/Ramensoft/handinger-ruby/commit/d2d009fef801e296238abb13f66980523f6fe635))
|
|
10
|
+
* Add worker avatars and summaries with edit UI ([9363cd1](https://github.com/Ramensoft/handinger-ruby/commit/9363cd185a2973a889324097215bff9c3f4fe59d))
|
|
11
|
+
* **api:** api update ([24ba9a1](https://github.com/Ramensoft/handinger-ruby/commit/24ba9a1bacb86f4f72dc6599223678c34fb40eb8))
|
|
12
|
+
* **api:** api update ([05d22fc](https://github.com/Ramensoft/handinger-ruby/commit/05d22fc5b3de4a8c4115ef234b362f667fc08eb7))
|
|
13
|
+
* **api:** api update ([edee7a7](https://github.com/Ramensoft/handinger-ruby/commit/edee7a788bda863304a5b3216abdf6d9273dc95e))
|
|
14
|
+
* **api:** api update ([a335064](https://github.com/Ramensoft/handinger-ruby/commit/a335064d021768f799f38c2a5d8766d42b36816c))
|
|
15
|
+
* File uploads ([d7fd499](https://github.com/Ramensoft/handinger-ruby/commit/d7fd499cfc7a9d0d15875b3f4e0ebc0571177f15))
|
|
16
|
+
* Le big refactor ([9631a55](https://github.com/Ramensoft/handinger-ruby/commit/9631a55979db401c85faf3d90ac827aea41dd19d))
|
|
17
|
+
* Overhaul email/permissions and ids ([e686bb8](https://github.com/Ramensoft/handinger-ruby/commit/e686bb8e9de4e492083c7ca3bf47d89662bb141b))
|
|
18
|
+
* support setting headers via env ([cf53d6e](https://github.com/Ramensoft/handinger-ruby/commit/cf53d6ed1323a7253e9c5ffc03047ac2b9f1aeb7))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* avoid gzip buffering during streaming ([7d1e1bc](https://github.com/Ramensoft/handinger-ruby/commit/7d1e1bcd465f422cc6e1b5fce68c308f25030cd5))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Chores
|
|
27
|
+
|
|
28
|
+
* **internal:** more robust bootstrap script ([61ba919](https://github.com/Ramensoft/handinger-ruby/commit/61ba919436fe1ccdf663b8822904623421ee773c))
|
|
29
|
+
|
|
30
|
+
## 0.1.0 (2026-04-23)
|
|
31
|
+
|
|
32
|
+
Full Changelog: [v0.0.2...v0.1.0](https://github.com/Ramensoft/handinger-ruby/compare/v0.0.2...v0.1.0)
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* **api:** api update ([5c0591e](https://github.com/Ramensoft/handinger-ruby/commit/5c0591e29115cea09ef85378a030154bef123afb))
|
|
37
|
+
|
|
3
38
|
## 0.0.2 (2026-04-23)
|
|
4
39
|
|
|
5
40
|
Full Changelog: [v0.0.1...v0.0.2](https://github.com/Ramensoft/handinger-ruby/compare/v0.0.1...v0.0.2)
|
data/README.md
CHANGED
|
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
|
|
|
15
15
|
<!-- x-release-please-start-version -->
|
|
16
16
|
|
|
17
17
|
```ruby
|
|
18
|
-
gem "handinger", "~> 0.0
|
|
18
|
+
gem "handinger", "~> 0.2.0"
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
<!-- x-release-please-end -->
|
|
@@ -30,7 +30,7 @@ handinger = Handinger::Client.new(
|
|
|
30
30
|
api_key: ENV["HANDINGER_API_KEY"] # This is the default and can be omitted
|
|
31
31
|
)
|
|
32
32
|
|
|
33
|
-
worker = handinger.
|
|
33
|
+
worker = handinger.tasks.create(worker_id: "t_org_123_w_01HZY2ZJQ8G7K42W2D7WF6V4GM")
|
|
34
34
|
|
|
35
35
|
puts(worker.id)
|
|
36
36
|
```
|
|
@@ -41,7 +41,7 @@ When the library is unable to connect to the API, or if the API returns a non-su
|
|
|
41
41
|
|
|
42
42
|
```ruby
|
|
43
43
|
begin
|
|
44
|
-
|
|
44
|
+
task = handinger.tasks.create(worker_id: "t_org_123_w_01HZY2ZJQ8G7K42W2D7WF6V4GM")
|
|
45
45
|
rescue Handinger::Errors::APIConnectionError => e
|
|
46
46
|
puts("The server could not be reached")
|
|
47
47
|
puts(e.cause) # an underlying Exception, likely raised within `net/http`
|
|
@@ -84,8 +84,8 @@ handinger = Handinger::Client.new(
|
|
|
84
84
|
)
|
|
85
85
|
|
|
86
86
|
# Or, configure per-request:
|
|
87
|
-
handinger.
|
|
88
|
-
|
|
87
|
+
handinger.tasks.create(
|
|
88
|
+
worker_id: "t_org_123_w_01HZY2ZJQ8G7K42W2D7WF6V4GM",
|
|
89
89
|
request_options: {max_retries: 5}
|
|
90
90
|
)
|
|
91
91
|
```
|
|
@@ -101,7 +101,7 @@ handinger = Handinger::Client.new(
|
|
|
101
101
|
)
|
|
102
102
|
|
|
103
103
|
# Or, configure per-request:
|
|
104
|
-
handinger.
|
|
104
|
+
handinger.tasks.create(worker_id: "t_org_123_w_01HZY2ZJQ8G7K42W2D7WF6V4GM", request_options: {timeout: 5})
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
On timeout, `Handinger::Errors::APITimeoutError` is raised.
|
|
@@ -132,8 +132,8 @@ Note: the `extra_` parameters of the same name overrides the documented paramete
|
|
|
132
132
|
|
|
133
133
|
```ruby
|
|
134
134
|
worker =
|
|
135
|
-
handinger.
|
|
136
|
-
|
|
135
|
+
handinger.tasks.create(
|
|
136
|
+
worker_id: "t_org_123_w_01HZY2ZJQ8G7K42W2D7WF6V4GM",
|
|
137
137
|
request_options: {
|
|
138
138
|
extra_query: {my_query_parameter: value},
|
|
139
139
|
extra_body: {my_body_parameter: value},
|
|
@@ -179,18 +179,18 @@ This library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitio
|
|
|
179
179
|
You can provide typesafe request parameters like so:
|
|
180
180
|
|
|
181
181
|
```ruby
|
|
182
|
-
handinger.
|
|
182
|
+
handinger.tasks.create(worker_id: "t_org_123_w_01HZY2ZJQ8G7K42W2D7WF6V4GM")
|
|
183
183
|
```
|
|
184
184
|
|
|
185
185
|
Or, equivalently:
|
|
186
186
|
|
|
187
187
|
```ruby
|
|
188
188
|
# Hashes work, but are not typesafe:
|
|
189
|
-
handinger.
|
|
189
|
+
handinger.tasks.create(worker_id: "t_org_123_w_01HZY2ZJQ8G7K42W2D7WF6V4GM")
|
|
190
190
|
|
|
191
191
|
# You can also splat a full Params class:
|
|
192
|
-
params = Handinger::
|
|
193
|
-
handinger.
|
|
192
|
+
params = Handinger::TaskCreateParams.new(worker_id: "t_org_123_w_01HZY2ZJQ8G7K42W2D7WF6V4GM")
|
|
193
|
+
handinger.tasks.create(**params)
|
|
194
194
|
```
|
|
195
195
|
|
|
196
196
|
### Enums
|
|
@@ -198,11 +198,11 @@ handinger.workers.create(**params)
|
|
|
198
198
|
Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime:
|
|
199
199
|
|
|
200
200
|
```ruby
|
|
201
|
-
# :
|
|
202
|
-
puts(Handinger::CreateWorker::
|
|
201
|
+
# :public
|
|
202
|
+
puts(Handinger::CreateWorker::Visibility::PUBLIC)
|
|
203
203
|
|
|
204
|
-
# Revealed type: `T.all(Handinger::CreateWorker::
|
|
205
|
-
T.reveal_type(Handinger::CreateWorker::
|
|
204
|
+
# Revealed type: `T.all(Handinger::CreateWorker::Visibility, Symbol)`
|
|
205
|
+
T.reveal_type(Handinger::CreateWorker::Visibility::PUBLIC)
|
|
206
206
|
```
|
|
207
207
|
|
|
208
208
|
Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:
|
|
@@ -210,13 +210,13 @@ Enum parameters have a "relaxed" type, so you can either pass in enum constants
|
|
|
210
210
|
```ruby
|
|
211
211
|
# Using the enum constants preserves the tagged type information:
|
|
212
212
|
handinger.workers.create(
|
|
213
|
-
|
|
213
|
+
visibility: Handinger::CreateWorker::Visibility::PUBLIC,
|
|
214
214
|
# …
|
|
215
215
|
)
|
|
216
216
|
|
|
217
217
|
# Literal values are also permissible:
|
|
218
218
|
handinger.workers.create(
|
|
219
|
-
|
|
219
|
+
visibility: :public,
|
|
220
220
|
# …
|
|
221
221
|
)
|
|
222
222
|
```
|
data/lib/handinger/client.rb
CHANGED
|
@@ -18,9 +18,14 @@ module Handinger
|
|
|
18
18
|
# @return [String]
|
|
19
19
|
attr_reader :api_key
|
|
20
20
|
|
|
21
|
+
# Create, retrieve, and manage agent worker templates.
|
|
21
22
|
# @return [Handinger::Resources::Workers]
|
|
22
23
|
attr_reader :workers
|
|
23
24
|
|
|
25
|
+
# Run and inspect tasks against a worker.
|
|
26
|
+
# @return [Handinger::Resources::Tasks]
|
|
27
|
+
attr_reader :tasks
|
|
28
|
+
|
|
24
29
|
# @api private
|
|
25
30
|
#
|
|
26
31
|
# @return [Hash{String=>String}]
|
|
@@ -58,6 +63,19 @@ module Handinger
|
|
|
58
63
|
raise ArgumentError.new("api_key is required, and can be set via environ: \"HANDINGER_API_KEY\"")
|
|
59
64
|
end
|
|
60
65
|
|
|
66
|
+
headers = {}
|
|
67
|
+
custom_headers_env = ENV["HANDINGER_CUSTOM_HEADERS"]
|
|
68
|
+
unless custom_headers_env.nil?
|
|
69
|
+
parsed = {}
|
|
70
|
+
custom_headers_env.split("\n").each do |line|
|
|
71
|
+
colon = line.index(":")
|
|
72
|
+
unless colon.nil?
|
|
73
|
+
parsed[line[0...colon].strip] = line[(colon + 1)..].strip
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
headers = parsed.merge(headers)
|
|
77
|
+
end
|
|
78
|
+
|
|
61
79
|
@api_key = api_key.to_s
|
|
62
80
|
|
|
63
81
|
super(
|
|
@@ -65,10 +83,12 @@ module Handinger
|
|
|
65
83
|
timeout: timeout,
|
|
66
84
|
max_retries: max_retries,
|
|
67
85
|
initial_retry_delay: initial_retry_delay,
|
|
68
|
-
max_retry_delay: max_retry_delay
|
|
86
|
+
max_retry_delay: max_retry_delay,
|
|
87
|
+
headers: headers
|
|
69
88
|
)
|
|
70
89
|
|
|
71
90
|
@workers = Handinger::Resources::Workers.new(client: self)
|
|
91
|
+
@tasks = Handinger::Resources::Tasks.new(client: self)
|
|
72
92
|
end
|
|
73
93
|
end
|
|
74
94
|
end
|
|
@@ -549,9 +549,7 @@ module Handinger
|
|
|
549
549
|
)
|
|
550
550
|
),
|
|
551
551
|
page: T.nilable(T::Class[Handinger::Internal::Type::BasePage[Handinger::Internal::Type::BaseModel]]),
|
|
552
|
-
stream: T.nilable(
|
|
553
|
-
T::Class[Handinger::Internal::Type::BaseStream[T.anything, Handinger::Internal::Type::BaseModel]]
|
|
554
|
-
),
|
|
552
|
+
stream: T.nilable(T::Class[T.anything]),
|
|
555
553
|
model: T.nilable(Handinger::Internal::Type::Converter::Input),
|
|
556
554
|
options: T.nilable(Handinger::RequestOptions::OrHash)
|
|
557
555
|
}
|
|
@@ -440,9 +440,9 @@ module Handinger
|
|
|
440
440
|
# @example
|
|
441
441
|
# # `create_worker` is a `Handinger::CreateWorker`
|
|
442
442
|
# create_worker => {
|
|
443
|
-
#
|
|
444
|
-
#
|
|
445
|
-
#
|
|
443
|
+
# instructions: instructions,
|
|
444
|
+
# output_schema: output_schema,
|
|
445
|
+
# prompt: prompt
|
|
446
446
|
# }
|
|
447
447
|
def deconstruct_keys(keys)
|
|
448
448
|
(keys || self.class.known_fields.keys)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
class CreateTask < Handinger::Models::CreateWorker
|
|
6
|
+
# @!attribute worker_id
|
|
7
|
+
# Worker id the task belongs to.
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :worker_id, String, api_name: :workerId
|
|
11
|
+
|
|
12
|
+
# @!attribute task_id
|
|
13
|
+
# Optional client-provided task id. Reuse this id to add turns to an existing
|
|
14
|
+
# task.
|
|
15
|
+
#
|
|
16
|
+
# @return [String, nil]
|
|
17
|
+
optional :task_id, String, api_name: :taskId
|
|
18
|
+
|
|
19
|
+
# @!method initialize(worker_id:, task_id: nil)
|
|
20
|
+
# Some parameter documentations has been truncated, see
|
|
21
|
+
# {Handinger::Models::CreateTask} for more details.
|
|
22
|
+
#
|
|
23
|
+
# @param worker_id [String] Worker id the task belongs to.
|
|
24
|
+
#
|
|
25
|
+
# @param task_id [String] Optional client-provided task id. Reuse this id to add turns to an existing task
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -3,34 +3,74 @@
|
|
|
3
3
|
module Handinger
|
|
4
4
|
module Models
|
|
5
5
|
class CreateWorker < Handinger::Internal::Type::BaseModel
|
|
6
|
-
# @!attribute
|
|
6
|
+
# @!attribute instructions
|
|
7
|
+
# Persistent system prompt the worker uses for every task it runs.
|
|
7
8
|
#
|
|
8
|
-
# @return [String]
|
|
9
|
-
|
|
9
|
+
# @return [String, nil]
|
|
10
|
+
optional :instructions, String
|
|
10
11
|
|
|
11
|
-
# @!attribute
|
|
12
|
+
# @!attribute output_schema
|
|
13
|
+
# Optional JSON Schema (Draft-07) describing the structured object the worker must
|
|
14
|
+
# produce. When set, every task response is validated against the schema and
|
|
15
|
+
# exposed as `structuredOutput`.
|
|
12
16
|
#
|
|
13
|
-
# @return [Symbol,
|
|
14
|
-
optional :
|
|
17
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
18
|
+
optional :output_schema,
|
|
19
|
+
Handinger::Internal::Type::HashOf[Handinger::Internal::Type::Unknown],
|
|
20
|
+
api_name: :outputSchema
|
|
15
21
|
|
|
16
|
-
# @!attribute
|
|
22
|
+
# @!attribute prompt
|
|
23
|
+
# Natural-language description of the worker to use for AI-generated instructions
|
|
24
|
+
# when `instructions` is omitted.
|
|
17
25
|
#
|
|
18
|
-
# @return [
|
|
19
|
-
optional :
|
|
26
|
+
# @return [String, nil]
|
|
27
|
+
optional :prompt, String
|
|
20
28
|
|
|
21
|
-
# @!
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
#
|
|
29
|
+
# @!attribute summary
|
|
30
|
+
# Short one-line description of the worker's purpose. Auto-generated when omitted
|
|
31
|
+
# and a `prompt` is provided.
|
|
32
|
+
#
|
|
33
|
+
# @return [String, nil]
|
|
34
|
+
optional :summary, String
|
|
35
|
+
|
|
36
|
+
# @!attribute title
|
|
37
|
+
# Optional display name. When omitted, Handinger assigns a random dog-themed name.
|
|
38
|
+
#
|
|
39
|
+
# @return [String, nil]
|
|
40
|
+
optional :title, String
|
|
25
41
|
|
|
26
|
-
#
|
|
27
|
-
|
|
42
|
+
# @!attribute visibility
|
|
43
|
+
# `public` (default) is visible to all org members. `private` is only visible to
|
|
44
|
+
# invited members.
|
|
45
|
+
#
|
|
46
|
+
# @return [Symbol, Handinger::Models::CreateWorker::Visibility, nil]
|
|
47
|
+
optional :visibility, enum: -> { Handinger::CreateWorker::Visibility }
|
|
48
|
+
|
|
49
|
+
# @!method initialize(instructions: nil, output_schema: nil, prompt: nil, summary: nil, title: nil, visibility: nil)
|
|
50
|
+
# Some parameter documentations has been truncated, see
|
|
51
|
+
# {Handinger::Models::CreateWorker} for more details.
|
|
52
|
+
#
|
|
53
|
+
# @param instructions [String] Persistent system prompt the worker uses for every task it runs.
|
|
54
|
+
#
|
|
55
|
+
# @param output_schema [Hash{Symbol=>Object}] Optional JSON Schema (Draft-07) describing the structured object the worker must
|
|
56
|
+
#
|
|
57
|
+
# @param prompt [String] Natural-language description of the worker to use for AI-generated instructions
|
|
58
|
+
#
|
|
59
|
+
# @param summary [String] Short one-line description of the worker's purpose. Auto-generated when omitted
|
|
60
|
+
#
|
|
61
|
+
# @param title [String] Optional display name. When omitted, Handinger assigns a random dog-themed name.
|
|
62
|
+
#
|
|
63
|
+
# @param visibility [Symbol, Handinger::Models::CreateWorker::Visibility] `public` (default) is visible to all org members. `private` is only visible to i
|
|
64
|
+
|
|
65
|
+
# `public` (default) is visible to all org members. `private` is only visible to
|
|
66
|
+
# invited members.
|
|
67
|
+
#
|
|
68
|
+
# @see Handinger::Models::CreateWorker#visibility
|
|
69
|
+
module Visibility
|
|
28
70
|
extend Handinger::Internal::Type::Enum
|
|
29
71
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
HIGH = :high
|
|
33
|
-
UNLIMITED = :unlimited
|
|
72
|
+
PUBLIC = :public
|
|
73
|
+
PRIVATE = :private
|
|
34
74
|
|
|
35
75
|
# @!method self.values
|
|
36
76
|
# @return [Array<Symbol>]
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
class Task < Handinger::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute id
|
|
7
|
+
#
|
|
8
|
+
# @return [String]
|
|
9
|
+
required :id, String
|
|
10
|
+
|
|
11
|
+
# @!attribute completed_at
|
|
12
|
+
#
|
|
13
|
+
# @return [String, nil]
|
|
14
|
+
required :completed_at, String, api_name: :completedAt, nil?: true
|
|
15
|
+
|
|
16
|
+
# @!attribute created_at
|
|
17
|
+
#
|
|
18
|
+
# @return [String]
|
|
19
|
+
required :created_at, String, api_name: :createdAt
|
|
20
|
+
|
|
21
|
+
# @!attribute created_by_user_id
|
|
22
|
+
#
|
|
23
|
+
# @return [String, nil]
|
|
24
|
+
required :created_by_user_id, String, api_name: :createdByUserId, nil?: true
|
|
25
|
+
|
|
26
|
+
# @!attribute organization_id
|
|
27
|
+
#
|
|
28
|
+
# @return [String]
|
|
29
|
+
required :organization_id, String, api_name: :organizationId
|
|
30
|
+
|
|
31
|
+
# @!attribute status
|
|
32
|
+
#
|
|
33
|
+
# @return [Symbol, Handinger::Models::Task::Status]
|
|
34
|
+
required :status, enum: -> { Handinger::Task::Status }
|
|
35
|
+
|
|
36
|
+
# @!attribute title
|
|
37
|
+
#
|
|
38
|
+
# @return [String]
|
|
39
|
+
required :title, String
|
|
40
|
+
|
|
41
|
+
# @!attribute totals
|
|
42
|
+
#
|
|
43
|
+
# @return [Handinger::Models::Task::Totals]
|
|
44
|
+
required :totals, -> { Handinger::Task::Totals }
|
|
45
|
+
|
|
46
|
+
# @!attribute triggered_by
|
|
47
|
+
#
|
|
48
|
+
# @return [Symbol, Handinger::Models::Task::TriggeredBy]
|
|
49
|
+
required :triggered_by, enum: -> { Handinger::Task::TriggeredBy }, api_name: :triggeredBy
|
|
50
|
+
|
|
51
|
+
# @!attribute worker_id
|
|
52
|
+
#
|
|
53
|
+
# @return [String]
|
|
54
|
+
required :worker_id, String, api_name: :workerId
|
|
55
|
+
|
|
56
|
+
# @!method initialize(id:, completed_at:, created_at:, created_by_user_id:, organization_id:, status:, title:, totals:, triggered_by:, worker_id:)
|
|
57
|
+
# @param id [String]
|
|
58
|
+
# @param completed_at [String, nil]
|
|
59
|
+
# @param created_at [String]
|
|
60
|
+
# @param created_by_user_id [String, nil]
|
|
61
|
+
# @param organization_id [String]
|
|
62
|
+
# @param status [Symbol, Handinger::Models::Task::Status]
|
|
63
|
+
# @param title [String]
|
|
64
|
+
# @param totals [Handinger::Models::Task::Totals]
|
|
65
|
+
# @param triggered_by [Symbol, Handinger::Models::Task::TriggeredBy]
|
|
66
|
+
# @param worker_id [String]
|
|
67
|
+
|
|
68
|
+
# @see Handinger::Models::Task#status
|
|
69
|
+
module Status
|
|
70
|
+
extend Handinger::Internal::Type::Enum
|
|
71
|
+
|
|
72
|
+
PENDING = :pending
|
|
73
|
+
RUNNING = :running
|
|
74
|
+
COMPLETED = :completed
|
|
75
|
+
ERROR = :error
|
|
76
|
+
ABORTED = :aborted
|
|
77
|
+
|
|
78
|
+
# @!method self.values
|
|
79
|
+
# @return [Array<Symbol>]
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# @see Handinger::Models::Task#totals
|
|
83
|
+
class Totals < Handinger::Internal::Type::BaseModel
|
|
84
|
+
# @!attribute credits
|
|
85
|
+
#
|
|
86
|
+
# @return [Float]
|
|
87
|
+
required :credits, Float
|
|
88
|
+
|
|
89
|
+
# @!attribute duration_ms
|
|
90
|
+
#
|
|
91
|
+
# @return [Float]
|
|
92
|
+
required :duration_ms, Float, api_name: :durationMs
|
|
93
|
+
|
|
94
|
+
# @!attribute turn_count
|
|
95
|
+
#
|
|
96
|
+
# @return [Float]
|
|
97
|
+
required :turn_count, Float, api_name: :turnCount
|
|
98
|
+
|
|
99
|
+
# @!method initialize(credits:, duration_ms:, turn_count:)
|
|
100
|
+
# @param credits [Float]
|
|
101
|
+
# @param duration_ms [Float]
|
|
102
|
+
# @param turn_count [Float]
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# @see Handinger::Models::Task#triggered_by
|
|
106
|
+
module TriggeredBy
|
|
107
|
+
extend Handinger::Internal::Type::Enum
|
|
108
|
+
|
|
109
|
+
API = :api
|
|
110
|
+
EMAIL = :email
|
|
111
|
+
SCHEDULE = :schedule
|
|
112
|
+
UI = :ui
|
|
113
|
+
|
|
114
|
+
# @!method self.values
|
|
115
|
+
# @return [Array<Symbol>]
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
# @see Handinger::Resources::Tasks#create
|
|
6
|
+
class TaskCreateParams < Handinger::Models::CreateTask
|
|
7
|
+
extend Handinger::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Handinger::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!method initialize(request_options: {})
|
|
11
|
+
# @param request_options [Handinger::RequestOptions, Hash{Symbol=>Object}]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
module Handinger
|
|
4
4
|
module Models
|
|
5
|
-
# @see Handinger::Resources::
|
|
6
|
-
class
|
|
5
|
+
# @see Handinger::Resources::Tasks#retrieve
|
|
6
|
+
class TaskRetrieveParams < Handinger::Internal::Type::BaseModel
|
|
7
7
|
extend Handinger::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Handinger::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
|
-
# @!attribute
|
|
10
|
+
# @!attribute task_id
|
|
11
11
|
#
|
|
12
12
|
# @return [String]
|
|
13
|
-
required :
|
|
13
|
+
required :task_id, String
|
|
14
14
|
|
|
15
|
-
# @!method initialize(
|
|
16
|
-
# @param
|
|
15
|
+
# @!method initialize(task_id:, request_options: {})
|
|
16
|
+
# @param task_id [String]
|
|
17
17
|
# @param request_options [Handinger::RequestOptions, Hash{Symbol=>Object}]
|
|
18
18
|
end
|
|
19
19
|
end
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
# @see Handinger::Resources::Tasks#retrieve
|
|
6
|
+
class TaskWithTurns < Handinger::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute task
|
|
8
|
+
#
|
|
9
|
+
# @return [Handinger::Models::Task]
|
|
10
|
+
required :task, -> { Handinger::Task }
|
|
11
|
+
|
|
12
|
+
# @!attribute turns
|
|
13
|
+
#
|
|
14
|
+
# @return [Array<Handinger::Models::TaskWithTurns::Turn>]
|
|
15
|
+
required :turns, -> { Handinger::Internal::Type::ArrayOf[Handinger::TaskWithTurns::Turn] }
|
|
16
|
+
|
|
17
|
+
# @!method initialize(task:, turns:)
|
|
18
|
+
# @param task [Handinger::Models::Task]
|
|
19
|
+
# @param turns [Array<Handinger::Models::TaskWithTurns::Turn>]
|
|
20
|
+
|
|
21
|
+
class Turn < Handinger::Internal::Type::BaseModel
|
|
22
|
+
# @!attribute id
|
|
23
|
+
#
|
|
24
|
+
# @return [String]
|
|
25
|
+
required :id, String
|
|
26
|
+
|
|
27
|
+
# @!attribute completed_at
|
|
28
|
+
#
|
|
29
|
+
# @return [String, nil]
|
|
30
|
+
required :completed_at, String, api_name: :completedAt, nil?: true
|
|
31
|
+
|
|
32
|
+
# @!attribute credits
|
|
33
|
+
#
|
|
34
|
+
# @return [Float]
|
|
35
|
+
required :credits, Float
|
|
36
|
+
|
|
37
|
+
# @!attribute duration_ms
|
|
38
|
+
#
|
|
39
|
+
# @return [Integer]
|
|
40
|
+
required :duration_ms, Integer, api_name: :durationMs
|
|
41
|
+
|
|
42
|
+
# @!attribute input
|
|
43
|
+
#
|
|
44
|
+
# @return [String]
|
|
45
|
+
required :input, String
|
|
46
|
+
|
|
47
|
+
# @!attribute input_tokens
|
|
48
|
+
#
|
|
49
|
+
# @return [Integer]
|
|
50
|
+
required :input_tokens, Integer, api_name: :inputTokens
|
|
51
|
+
|
|
52
|
+
# @!attribute output_text
|
|
53
|
+
#
|
|
54
|
+
# @return [String]
|
|
55
|
+
required :output_text, String, api_name: :outputText
|
|
56
|
+
|
|
57
|
+
# @!attribute output_tokens
|
|
58
|
+
#
|
|
59
|
+
# @return [Integer]
|
|
60
|
+
required :output_tokens, Integer, api_name: :outputTokens
|
|
61
|
+
|
|
62
|
+
# @!attribute role
|
|
63
|
+
#
|
|
64
|
+
# @return [String]
|
|
65
|
+
required :role, String
|
|
66
|
+
|
|
67
|
+
# @!attribute seq
|
|
68
|
+
#
|
|
69
|
+
# @return [Integer]
|
|
70
|
+
required :seq, Integer
|
|
71
|
+
|
|
72
|
+
# @!attribute started_at
|
|
73
|
+
#
|
|
74
|
+
# @return [String]
|
|
75
|
+
required :started_at, String, api_name: :startedAt
|
|
76
|
+
|
|
77
|
+
# @!attribute status
|
|
78
|
+
#
|
|
79
|
+
# @return [String]
|
|
80
|
+
required :status, String
|
|
81
|
+
|
|
82
|
+
# @!attribute structured_output
|
|
83
|
+
#
|
|
84
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
85
|
+
required :structured_output,
|
|
86
|
+
Handinger::Internal::Type::HashOf[Handinger::Internal::Type::Unknown],
|
|
87
|
+
api_name: :structuredOutput,
|
|
88
|
+
nil?: true
|
|
89
|
+
|
|
90
|
+
# @!attribute task_id
|
|
91
|
+
#
|
|
92
|
+
# @return [String]
|
|
93
|
+
required :task_id, String, api_name: :taskId
|
|
94
|
+
|
|
95
|
+
# @!method initialize(id:, completed_at:, credits:, duration_ms:, input:, input_tokens:, output_text:, output_tokens:, role:, seq:, started_at:, status:, structured_output:, task_id:)
|
|
96
|
+
# @param id [String]
|
|
97
|
+
# @param completed_at [String, nil]
|
|
98
|
+
# @param credits [Float]
|
|
99
|
+
# @param duration_ms [Integer]
|
|
100
|
+
# @param input [String]
|
|
101
|
+
# @param input_tokens [Integer]
|
|
102
|
+
# @param output_text [String]
|
|
103
|
+
# @param output_tokens [Integer]
|
|
104
|
+
# @param role [String]
|
|
105
|
+
# @param seq [Integer]
|
|
106
|
+
# @param started_at [String]
|
|
107
|
+
# @param status [String]
|
|
108
|
+
# @param structured_output [Hash{Symbol=>Object}, nil]
|
|
109
|
+
# @param task_id [String]
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|