handinger 0.12.1 → 0.13.1
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 +21 -0
- data/README.md +1 -1
- data/lib/handinger/models/task_list_turns_params.rb +20 -0
- data/lib/handinger/models/task_retrieve_response.rb +16 -0
- data/lib/handinger/models/task_turn_list.rb +22 -0
- data/lib/handinger/models/turn.rb +150 -0
- data/lib/handinger/models/worker.rb +1 -7
- data/lib/handinger/models.rb +5 -1
- data/lib/handinger/resources/tasks.rb +23 -3
- data/lib/handinger/version.rb +1 -1
- data/lib/handinger.rb +4 -1
- data/rbi/handinger/models/task_list_turns_params.rbi +35 -0
- data/rbi/handinger/models/task_retrieve_response.rbi +29 -0
- data/rbi/handinger/models/task_turn_list.rbi +33 -0
- data/rbi/handinger/models/turn.rbi +169 -0
- data/rbi/handinger/models/worker.rbi +3 -13
- data/rbi/handinger/models.rbi +5 -1
- data/rbi/handinger/resources/tasks.rbi +16 -2
- data/sig/handinger/models/task_list_turns_params.rbs +23 -0
- data/sig/handinger/models/task_retrieve_response.rbs +13 -0
- data/sig/handinger/models/task_turn_list.rbs +15 -0
- data/sig/handinger/models/turn.rbs +119 -0
- data/sig/handinger/models/worker.rbs +3 -7
- data/sig/handinger/models.rbs +5 -1
- data/sig/handinger/resources/tasks.rbs +6 -1
- metadata +14 -5
- data/lib/handinger/models/task_with_turns.rb +0 -131
- data/rbi/handinger/models/task_with_turns.rbi +0 -153
- data/sig/handinger/models/task_with_turns.rbs +0 -104
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a452933631b479a699417708d1f6e57d772495ed1c63ba89b5b45ecebd924f21
|
|
4
|
+
data.tar.gz: 73ba3e1c4f986c900edd516f089584c5d3d0fe6d3784457cf25de0fc9b87e10d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4066a67f7dd3a8cc293bedecc376b3448bc123a4f65d10573905498a1b9e8c79410fdd253889a5ded53c302b67ff27d3f2ae3206c4c5981495d4acc11fd2bdf5
|
|
7
|
+
data.tar.gz: c9964bdc90c3dfa466ab409036bb5dfec30eb4e6f20251451747524ca6ad35c50e773e8aec7dfc76fd440c1543e86e75e8b74cdc0e11f87f5ad177d97500a65b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.13.1 (2026-07-10)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.13.0...v0.13.1](https://github.com/ramensoft/handinger-ruby/compare/v0.13.0...v0.13.1)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* **api:** remove credits field from worker usage model ([47ef3e5](https://github.com/ramensoft/handinger-ruby/commit/47ef3e58e27b2e40a42f7902e76bee627f6190ae))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Chores
|
|
13
|
+
|
|
14
|
+
* **internal:** bound formatter parallelism to CPU count ([611c87b](https://github.com/ramensoft/handinger-ruby/commit/611c87bb55ff2a7e76ec2a4540dbad0e716d161f))
|
|
15
|
+
|
|
16
|
+
## 0.13.0 (2026-06-23)
|
|
17
|
+
|
|
18
|
+
Full Changelog: [v0.12.1...v0.13.0](https://github.com/ramensoft/handinger-ruby/compare/v0.12.1...v0.13.0)
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **api:** add files field and File model to TaskWithTurns::Turn ([0428e6c](https://github.com/ramensoft/handinger-ruby/commit/0428e6c7c8e66cf90fe2c5151ab0555787139ef9))
|
|
23
|
+
|
|
3
24
|
## 0.12.1 (2026-06-17)
|
|
4
25
|
|
|
5
26
|
Full Changelog: [v0.12.0...v0.12.1](https://github.com/ramensoft/handinger-ruby/compare/v0.12.0...v0.12.1)
|
data/README.md
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
# @see Handinger::Resources::Tasks#list_turns
|
|
6
|
+
class TaskListTurnsParams < Handinger::Internal::Type::BaseModel
|
|
7
|
+
extend Handinger::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Handinger::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute task_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :task_id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(task_id:, request_options: {})
|
|
16
|
+
# @param task_id [String]
|
|
17
|
+
# @param request_options [Handinger::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
# @see Handinger::Resources::Tasks#retrieve
|
|
6
|
+
class TaskRetrieveResponse < Handinger::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute task
|
|
8
|
+
#
|
|
9
|
+
# @return [Handinger::Models::Task]
|
|
10
|
+
required :task, -> { Handinger::Task }
|
|
11
|
+
|
|
12
|
+
# @!method initialize(task:)
|
|
13
|
+
# @param task [Handinger::Models::Task]
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
# @see Handinger::Resources::Tasks#list_turns
|
|
6
|
+
class TaskTurnList < Handinger::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute items
|
|
8
|
+
#
|
|
9
|
+
# @return [Array<Handinger::Models::Turn>]
|
|
10
|
+
required :items, -> { Handinger::Internal::Type::ArrayOf[Handinger::Turn] }
|
|
11
|
+
|
|
12
|
+
# @!attribute task_id
|
|
13
|
+
#
|
|
14
|
+
# @return [String]
|
|
15
|
+
required :task_id, String, api_name: :taskId
|
|
16
|
+
|
|
17
|
+
# @!method initialize(items:, task_id:)
|
|
18
|
+
# @param items [Array<Handinger::Models::Turn>]
|
|
19
|
+
# @param task_id [String]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
class Turn < 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 credits
|
|
17
|
+
#
|
|
18
|
+
# @return [Integer]
|
|
19
|
+
required :credits, Integer
|
|
20
|
+
|
|
21
|
+
# @!attribute duration_ms
|
|
22
|
+
#
|
|
23
|
+
# @return [Integer]
|
|
24
|
+
required :duration_ms, Integer, api_name: :durationMs
|
|
25
|
+
|
|
26
|
+
# @!attribute files
|
|
27
|
+
# Files published by this turn.
|
|
28
|
+
#
|
|
29
|
+
# @return [Array<Handinger::Models::Turn::File>]
|
|
30
|
+
required :files, -> { Handinger::Internal::Type::ArrayOf[Handinger::Turn::File] }
|
|
31
|
+
|
|
32
|
+
# @!attribute input
|
|
33
|
+
#
|
|
34
|
+
# @return [String]
|
|
35
|
+
required :input, String
|
|
36
|
+
|
|
37
|
+
# @!attribute input_tokens
|
|
38
|
+
#
|
|
39
|
+
# @return [Integer]
|
|
40
|
+
required :input_tokens, Integer, api_name: :inputTokens
|
|
41
|
+
|
|
42
|
+
# @!attribute output_text
|
|
43
|
+
#
|
|
44
|
+
# @return [String]
|
|
45
|
+
required :output_text, String, api_name: :outputText
|
|
46
|
+
|
|
47
|
+
# @!attribute output_tokens
|
|
48
|
+
#
|
|
49
|
+
# @return [Integer]
|
|
50
|
+
required :output_tokens, Integer, api_name: :outputTokens
|
|
51
|
+
|
|
52
|
+
# @!attribute role
|
|
53
|
+
#
|
|
54
|
+
# @return [String]
|
|
55
|
+
required :role, String
|
|
56
|
+
|
|
57
|
+
# @!attribute seq
|
|
58
|
+
#
|
|
59
|
+
# @return [Integer]
|
|
60
|
+
required :seq, Integer
|
|
61
|
+
|
|
62
|
+
# @!attribute started_at
|
|
63
|
+
#
|
|
64
|
+
# @return [String]
|
|
65
|
+
required :started_at, String, api_name: :startedAt
|
|
66
|
+
|
|
67
|
+
# @!attribute status
|
|
68
|
+
#
|
|
69
|
+
# @return [String]
|
|
70
|
+
required :status, String
|
|
71
|
+
|
|
72
|
+
# @!attribute structured_output
|
|
73
|
+
# Structured JSON payload when the worker is configured with an output schema.
|
|
74
|
+
# `null` otherwise.
|
|
75
|
+
#
|
|
76
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
77
|
+
required :structured_output,
|
|
78
|
+
Handinger::Internal::Type::HashOf[Handinger::Internal::Type::Unknown],
|
|
79
|
+
api_name: :structuredOutput,
|
|
80
|
+
nil?: true
|
|
81
|
+
|
|
82
|
+
# @!attribute task_id
|
|
83
|
+
#
|
|
84
|
+
# @return [String]
|
|
85
|
+
required :task_id, String, api_name: :taskId
|
|
86
|
+
|
|
87
|
+
# @!method initialize(id:, completed_at:, credits:, duration_ms:, files:, input:, input_tokens:, output_text:, output_tokens:, role:, seq:, started_at:, status:, structured_output:, task_id:)
|
|
88
|
+
# Some parameter documentations has been truncated, see {Handinger::Models::Turn}
|
|
89
|
+
# for more details.
|
|
90
|
+
#
|
|
91
|
+
# @param id [String]
|
|
92
|
+
#
|
|
93
|
+
# @param completed_at [String, nil]
|
|
94
|
+
#
|
|
95
|
+
# @param credits [Integer]
|
|
96
|
+
#
|
|
97
|
+
# @param duration_ms [Integer]
|
|
98
|
+
#
|
|
99
|
+
# @param files [Array<Handinger::Models::Turn::File>] Files published by this turn.
|
|
100
|
+
#
|
|
101
|
+
# @param input [String]
|
|
102
|
+
#
|
|
103
|
+
# @param input_tokens [Integer]
|
|
104
|
+
#
|
|
105
|
+
# @param output_text [String]
|
|
106
|
+
#
|
|
107
|
+
# @param output_tokens [Integer]
|
|
108
|
+
#
|
|
109
|
+
# @param role [String]
|
|
110
|
+
#
|
|
111
|
+
# @param seq [Integer]
|
|
112
|
+
#
|
|
113
|
+
# @param started_at [String]
|
|
114
|
+
#
|
|
115
|
+
# @param status [String]
|
|
116
|
+
#
|
|
117
|
+
# @param structured_output [Hash{Symbol=>Object}, nil] Structured JSON payload when the worker is configured with an output schema. `nu
|
|
118
|
+
#
|
|
119
|
+
# @param task_id [String]
|
|
120
|
+
|
|
121
|
+
class File < Handinger::Internal::Type::BaseModel
|
|
122
|
+
# @!attribute filename
|
|
123
|
+
#
|
|
124
|
+
# @return [String, nil]
|
|
125
|
+
required :filename, String, nil?: true
|
|
126
|
+
|
|
127
|
+
# @!attribute media_type
|
|
128
|
+
#
|
|
129
|
+
# @return [String]
|
|
130
|
+
required :media_type, String, api_name: :mediaType
|
|
131
|
+
|
|
132
|
+
# @!attribute url
|
|
133
|
+
#
|
|
134
|
+
# @return [String]
|
|
135
|
+
required :url, String
|
|
136
|
+
|
|
137
|
+
# @!attribute size
|
|
138
|
+
#
|
|
139
|
+
# @return [Integer, nil]
|
|
140
|
+
optional :size, Integer
|
|
141
|
+
|
|
142
|
+
# @!method initialize(filename:, media_type:, url:, size: nil)
|
|
143
|
+
# @param filename [String, nil]
|
|
144
|
+
# @param media_type [String]
|
|
145
|
+
# @param url [String]
|
|
146
|
+
# @param size [Integer]
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
@@ -240,18 +240,12 @@ module Handinger
|
|
|
240
240
|
|
|
241
241
|
# @see Handinger::Models::Worker#usage
|
|
242
242
|
class Usage < Handinger::Internal::Type::BaseModel
|
|
243
|
-
# @!attribute credits
|
|
244
|
-
#
|
|
245
|
-
# @return [Integer, nil]
|
|
246
|
-
optional :credits, Integer
|
|
247
|
-
|
|
248
243
|
# @!attribute duration_ms
|
|
249
244
|
#
|
|
250
245
|
# @return [Integer, nil]
|
|
251
246
|
optional :duration_ms, Integer, api_name: :durationMs
|
|
252
247
|
|
|
253
|
-
# @!method initialize(
|
|
254
|
-
# @param credits [Integer]
|
|
248
|
+
# @!method initialize(duration_ms: nil)
|
|
255
249
|
# @param duration_ms [Integer]
|
|
256
250
|
end
|
|
257
251
|
end
|
data/lib/handinger/models.rb
CHANGED
|
@@ -53,9 +53,13 @@ module Handinger
|
|
|
53
53
|
|
|
54
54
|
TaskDeleteParams = Handinger::Models::TaskDeleteParams
|
|
55
55
|
|
|
56
|
+
TaskListTurnsParams = Handinger::Models::TaskListTurnsParams
|
|
57
|
+
|
|
56
58
|
TaskRetrieveParams = Handinger::Models::TaskRetrieveParams
|
|
57
59
|
|
|
58
|
-
|
|
60
|
+
TaskTurnList = Handinger::Models::TaskTurnList
|
|
61
|
+
|
|
62
|
+
Turn = Handinger::Models::Turn
|
|
59
63
|
|
|
60
64
|
UpdateWorker = Handinger::Models::UpdateWorker
|
|
61
65
|
|
|
@@ -40,7 +40,7 @@ module Handinger
|
|
|
40
40
|
)
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
-
# Retrieve a single task
|
|
43
|
+
# Retrieve a single task.
|
|
44
44
|
#
|
|
45
45
|
# @overload retrieve(task_id, request_options: {})
|
|
46
46
|
#
|
|
@@ -48,14 +48,14 @@ module Handinger
|
|
|
48
48
|
#
|
|
49
49
|
# @param request_options [Handinger::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
50
50
|
#
|
|
51
|
-
# @return [Handinger::Models::
|
|
51
|
+
# @return [Handinger::Models::TaskRetrieveResponse]
|
|
52
52
|
#
|
|
53
53
|
# @see Handinger::Models::TaskRetrieveParams
|
|
54
54
|
def retrieve(task_id, params = {})
|
|
55
55
|
@client.request(
|
|
56
56
|
method: :get,
|
|
57
57
|
path: ["api/tasks/%1$s", task_id],
|
|
58
|
-
model: Handinger::
|
|
58
|
+
model: Handinger::Models::TaskRetrieveResponse,
|
|
59
59
|
options: params[:request_options]
|
|
60
60
|
)
|
|
61
61
|
end
|
|
@@ -81,6 +81,26 @@ module Handinger
|
|
|
81
81
|
)
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
+
# List the individual turns for a task in execution order.
|
|
85
|
+
#
|
|
86
|
+
# @overload list_turns(task_id, request_options: {})
|
|
87
|
+
#
|
|
88
|
+
# @param task_id [String] Task id returned by the create task endpoint.
|
|
89
|
+
#
|
|
90
|
+
# @param request_options [Handinger::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
91
|
+
#
|
|
92
|
+
# @return [Handinger::Models::TaskTurnList]
|
|
93
|
+
#
|
|
94
|
+
# @see Handinger::Models::TaskListTurnsParams
|
|
95
|
+
def list_turns(task_id, params = {})
|
|
96
|
+
@client.request(
|
|
97
|
+
method: :get,
|
|
98
|
+
path: ["api/tasks/%1$s/turns", task_id],
|
|
99
|
+
model: Handinger::TaskTurnList,
|
|
100
|
+
options: params[:request_options]
|
|
101
|
+
)
|
|
102
|
+
end
|
|
103
|
+
|
|
84
104
|
# @api private
|
|
85
105
|
#
|
|
86
106
|
# @param client [Handinger::Client]
|
data/lib/handinger/version.rb
CHANGED
data/lib/handinger.rb
CHANGED
|
@@ -61,8 +61,11 @@ require_relative "handinger/models/delete_worker_response"
|
|
|
61
61
|
require_relative "handinger/models/task"
|
|
62
62
|
require_relative "handinger/models/task_create_params"
|
|
63
63
|
require_relative "handinger/models/task_delete_params"
|
|
64
|
+
require_relative "handinger/models/task_list_turns_params"
|
|
64
65
|
require_relative "handinger/models/task_retrieve_params"
|
|
65
|
-
require_relative "handinger/models/
|
|
66
|
+
require_relative "handinger/models/task_retrieve_response"
|
|
67
|
+
require_relative "handinger/models/task_turn_list"
|
|
68
|
+
require_relative "handinger/models/turn"
|
|
66
69
|
require_relative "handinger/models/worker"
|
|
67
70
|
require_relative "handinger/models/worker_create_params"
|
|
68
71
|
require_relative "handinger/models/worker_delete_params"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
class TaskListTurnsParams < Handinger::Internal::Type::BaseModel
|
|
6
|
+
extend Handinger::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Handinger::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(Handinger::TaskListTurnsParams, Handinger::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :task_id
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(
|
|
19
|
+
task_id: String,
|
|
20
|
+
request_options: Handinger::RequestOptions::OrHash
|
|
21
|
+
).returns(T.attached_class)
|
|
22
|
+
end
|
|
23
|
+
def self.new(task_id:, request_options: {})
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
sig do
|
|
27
|
+
override.returns(
|
|
28
|
+
{ task_id: String, request_options: Handinger::RequestOptions }
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
def to_hash
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
class TaskRetrieveResponse < Handinger::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Handinger::Models::TaskRetrieveResponse,
|
|
10
|
+
Handinger::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(Handinger::Task) }
|
|
15
|
+
attr_reader :task
|
|
16
|
+
|
|
17
|
+
sig { params(task: Handinger::Task::OrHash).void }
|
|
18
|
+
attr_writer :task
|
|
19
|
+
|
|
20
|
+
sig { params(task: Handinger::Task::OrHash).returns(T.attached_class) }
|
|
21
|
+
def self.new(task:)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
sig { override.returns({ task: Handinger::Task }) }
|
|
25
|
+
def to_hash
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
class TaskTurnList < Handinger::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Handinger::TaskTurnList, Handinger::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
sig { returns(T::Array[Handinger::Turn]) }
|
|
12
|
+
attr_accessor :items
|
|
13
|
+
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :task_id
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(
|
|
19
|
+
items: T::Array[Handinger::Turn::OrHash],
|
|
20
|
+
task_id: String
|
|
21
|
+
).returns(T.attached_class)
|
|
22
|
+
end
|
|
23
|
+
def self.new(items:, task_id:)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
sig do
|
|
27
|
+
override.returns({ items: T::Array[Handinger::Turn], task_id: String })
|
|
28
|
+
end
|
|
29
|
+
def to_hash
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Handinger
|
|
4
|
+
module Models
|
|
5
|
+
class Turn < Handinger::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias { T.any(Handinger::Turn, Handinger::Internal::AnyHash) }
|
|
8
|
+
|
|
9
|
+
sig { returns(String) }
|
|
10
|
+
attr_accessor :id
|
|
11
|
+
|
|
12
|
+
sig { returns(T.nilable(String)) }
|
|
13
|
+
attr_accessor :completed_at
|
|
14
|
+
|
|
15
|
+
sig { returns(Integer) }
|
|
16
|
+
attr_accessor :credits
|
|
17
|
+
|
|
18
|
+
sig { returns(Integer) }
|
|
19
|
+
attr_accessor :duration_ms
|
|
20
|
+
|
|
21
|
+
# Files published by this turn.
|
|
22
|
+
sig { returns(T::Array[Handinger::Turn::File]) }
|
|
23
|
+
attr_accessor :files
|
|
24
|
+
|
|
25
|
+
sig { returns(String) }
|
|
26
|
+
attr_accessor :input
|
|
27
|
+
|
|
28
|
+
sig { returns(Integer) }
|
|
29
|
+
attr_accessor :input_tokens
|
|
30
|
+
|
|
31
|
+
sig { returns(String) }
|
|
32
|
+
attr_accessor :output_text
|
|
33
|
+
|
|
34
|
+
sig { returns(Integer) }
|
|
35
|
+
attr_accessor :output_tokens
|
|
36
|
+
|
|
37
|
+
sig { returns(String) }
|
|
38
|
+
attr_accessor :role
|
|
39
|
+
|
|
40
|
+
sig { returns(Integer) }
|
|
41
|
+
attr_accessor :seq
|
|
42
|
+
|
|
43
|
+
sig { returns(String) }
|
|
44
|
+
attr_accessor :started_at
|
|
45
|
+
|
|
46
|
+
sig { returns(String) }
|
|
47
|
+
attr_accessor :status
|
|
48
|
+
|
|
49
|
+
# Structured JSON payload when the worker is configured with an output schema.
|
|
50
|
+
# `null` otherwise.
|
|
51
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
52
|
+
attr_accessor :structured_output
|
|
53
|
+
|
|
54
|
+
sig { returns(String) }
|
|
55
|
+
attr_accessor :task_id
|
|
56
|
+
|
|
57
|
+
sig do
|
|
58
|
+
params(
|
|
59
|
+
id: String,
|
|
60
|
+
completed_at: T.nilable(String),
|
|
61
|
+
credits: Integer,
|
|
62
|
+
duration_ms: Integer,
|
|
63
|
+
files: T::Array[Handinger::Turn::File::OrHash],
|
|
64
|
+
input: String,
|
|
65
|
+
input_tokens: Integer,
|
|
66
|
+
output_text: String,
|
|
67
|
+
output_tokens: Integer,
|
|
68
|
+
role: String,
|
|
69
|
+
seq: Integer,
|
|
70
|
+
started_at: String,
|
|
71
|
+
status: String,
|
|
72
|
+
structured_output: T.nilable(T::Hash[Symbol, T.anything]),
|
|
73
|
+
task_id: String
|
|
74
|
+
).returns(T.attached_class)
|
|
75
|
+
end
|
|
76
|
+
def self.new(
|
|
77
|
+
id:,
|
|
78
|
+
completed_at:,
|
|
79
|
+
credits:,
|
|
80
|
+
duration_ms:,
|
|
81
|
+
# Files published by this turn.
|
|
82
|
+
files:,
|
|
83
|
+
input:,
|
|
84
|
+
input_tokens:,
|
|
85
|
+
output_text:,
|
|
86
|
+
output_tokens:,
|
|
87
|
+
role:,
|
|
88
|
+
seq:,
|
|
89
|
+
started_at:,
|
|
90
|
+
status:,
|
|
91
|
+
# Structured JSON payload when the worker is configured with an output schema.
|
|
92
|
+
# `null` otherwise.
|
|
93
|
+
structured_output:,
|
|
94
|
+
task_id:
|
|
95
|
+
)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
sig do
|
|
99
|
+
override.returns(
|
|
100
|
+
{
|
|
101
|
+
id: String,
|
|
102
|
+
completed_at: T.nilable(String),
|
|
103
|
+
credits: Integer,
|
|
104
|
+
duration_ms: Integer,
|
|
105
|
+
files: T::Array[Handinger::Turn::File],
|
|
106
|
+
input: String,
|
|
107
|
+
input_tokens: Integer,
|
|
108
|
+
output_text: String,
|
|
109
|
+
output_tokens: Integer,
|
|
110
|
+
role: String,
|
|
111
|
+
seq: Integer,
|
|
112
|
+
started_at: String,
|
|
113
|
+
status: String,
|
|
114
|
+
structured_output: T.nilable(T::Hash[Symbol, T.anything]),
|
|
115
|
+
task_id: String
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
def to_hash
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
class File < Handinger::Internal::Type::BaseModel
|
|
123
|
+
OrHash =
|
|
124
|
+
T.type_alias do
|
|
125
|
+
T.any(Handinger::Turn::File, Handinger::Internal::AnyHash)
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
sig { returns(T.nilable(String)) }
|
|
129
|
+
attr_accessor :filename
|
|
130
|
+
|
|
131
|
+
sig { returns(String) }
|
|
132
|
+
attr_accessor :media_type
|
|
133
|
+
|
|
134
|
+
sig { returns(String) }
|
|
135
|
+
attr_accessor :url
|
|
136
|
+
|
|
137
|
+
sig { returns(T.nilable(Integer)) }
|
|
138
|
+
attr_reader :size
|
|
139
|
+
|
|
140
|
+
sig { params(size: Integer).void }
|
|
141
|
+
attr_writer :size
|
|
142
|
+
|
|
143
|
+
sig do
|
|
144
|
+
params(
|
|
145
|
+
filename: T.nilable(String),
|
|
146
|
+
media_type: String,
|
|
147
|
+
url: String,
|
|
148
|
+
size: Integer
|
|
149
|
+
).returns(T.attached_class)
|
|
150
|
+
end
|
|
151
|
+
def self.new(filename:, media_type:, url:, size: nil)
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
sig do
|
|
155
|
+
override.returns(
|
|
156
|
+
{
|
|
157
|
+
filename: T.nilable(String),
|
|
158
|
+
media_type: String,
|
|
159
|
+
url: String,
|
|
160
|
+
size: Integer
|
|
161
|
+
}
|
|
162
|
+
)
|
|
163
|
+
end
|
|
164
|
+
def to_hash
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
end
|
|
@@ -309,27 +309,17 @@ module Handinger
|
|
|
309
309
|
T.any(Handinger::Worker::Usage, Handinger::Internal::AnyHash)
|
|
310
310
|
end
|
|
311
311
|
|
|
312
|
-
sig { returns(T.nilable(Integer)) }
|
|
313
|
-
attr_reader :credits
|
|
314
|
-
|
|
315
|
-
sig { params(credits: Integer).void }
|
|
316
|
-
attr_writer :credits
|
|
317
|
-
|
|
318
312
|
sig { returns(T.nilable(Integer)) }
|
|
319
313
|
attr_reader :duration_ms
|
|
320
314
|
|
|
321
315
|
sig { params(duration_ms: Integer).void }
|
|
322
316
|
attr_writer :duration_ms
|
|
323
317
|
|
|
324
|
-
sig
|
|
325
|
-
|
|
326
|
-
T.attached_class
|
|
327
|
-
)
|
|
328
|
-
end
|
|
329
|
-
def self.new(credits: nil, duration_ms: nil)
|
|
318
|
+
sig { params(duration_ms: Integer).returns(T.attached_class) }
|
|
319
|
+
def self.new(duration_ms: nil)
|
|
330
320
|
end
|
|
331
321
|
|
|
332
|
-
sig { override.returns({
|
|
322
|
+
sig { override.returns({ duration_ms: Integer }) }
|
|
333
323
|
def to_hash
|
|
334
324
|
end
|
|
335
325
|
end
|
data/rbi/handinger/models.rbi
CHANGED
|
@@ -15,9 +15,13 @@ module Handinger
|
|
|
15
15
|
|
|
16
16
|
TaskDeleteParams = Handinger::Models::TaskDeleteParams
|
|
17
17
|
|
|
18
|
+
TaskListTurnsParams = Handinger::Models::TaskListTurnsParams
|
|
19
|
+
|
|
18
20
|
TaskRetrieveParams = Handinger::Models::TaskRetrieveParams
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
TaskTurnList = Handinger::Models::TaskTurnList
|
|
23
|
+
|
|
24
|
+
Turn = Handinger::Models::Turn
|
|
21
25
|
|
|
22
26
|
UpdateWorker = Handinger::Models::UpdateWorker
|
|
23
27
|
|