deeprails 0.11.0 → 0.12.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 +18 -0
- data/README.md +26 -40
- data/lib/deeprails/internal/transport/base_client.rb +7 -1
- data/lib/deeprails/internal/transport/pooled_net_requester.rb +6 -2
- data/lib/deeprails/internal/type/base_model.rb +5 -5
- data/lib/deeprails/models/defend_create_response.rb +51 -0
- data/lib/deeprails/models/defend_create_workflow_params.rb +19 -19
- data/lib/deeprails/models/defend_response.rb +278 -38
- data/lib/deeprails/models/defend_retrieve_workflow_params.rb +13 -1
- data/lib/deeprails/models/defend_update_response.rb +51 -0
- data/lib/deeprails/models/file_response.rb +6 -22
- data/lib/deeprails/models/file_upload_params.rb +3 -3
- data/lib/deeprails/models/monitor_create_response.rb +51 -0
- data/lib/deeprails/models/monitor_detail_response.rb +69 -70
- data/lib/deeprails/models/monitor_event_detail_response.rb +182 -0
- data/lib/deeprails/models/monitor_event_response.rb +1 -9
- data/lib/deeprails/models/monitor_retrieve_params.rb +6 -2
- data/lib/deeprails/models/monitor_update_params.rb +11 -11
- data/lib/deeprails/models/monitor_update_response.rb +51 -0
- data/lib/deeprails/models/workflow_event_detail_response.rb +314 -0
- data/lib/deeprails/models/workflow_event_response.rb +29 -30
- data/lib/deeprails/models.rb +12 -2
- data/lib/deeprails/resources/defend.rb +20 -13
- data/lib/deeprails/resources/files.rb +1 -1
- data/lib/deeprails/resources/monitor.rb +11 -8
- data/lib/deeprails/version.rb +1 -1
- data/lib/deeprails.rb +7 -1
- data/manifest.yaml +1 -0
- data/rbi/deeprails/internal/transport/base_client.rbi +5 -0
- data/rbi/deeprails/internal/transport/pooled_net_requester.rbi +6 -2
- data/rbi/deeprails/internal/type/base_model.rbi +8 -4
- data/rbi/deeprails/models/defend_create_response.rbi +83 -0
- data/rbi/deeprails/models/defend_create_workflow_params.rbi +33 -27
- data/rbi/deeprails/models/defend_response.rbi +555 -72
- data/rbi/deeprails/models/defend_retrieve_workflow_params.rbi +23 -5
- data/rbi/deeprails/models/defend_update_response.rbi +83 -0
- data/rbi/deeprails/models/file_response.rbi +11 -39
- data/rbi/deeprails/models/file_upload_params.rbi +3 -6
- data/rbi/deeprails/models/monitor_create_response.rbi +83 -0
- data/rbi/deeprails/models/monitor_detail_response.rbi +144 -104
- data/rbi/deeprails/models/monitor_event_detail_response.rbi +383 -0
- data/rbi/deeprails/models/monitor_event_response.rbi +4 -18
- data/rbi/deeprails/models/monitor_retrieve_params.rbi +4 -2
- data/rbi/deeprails/models/monitor_update_params.rbi +21 -38
- data/rbi/deeprails/models/monitor_update_response.rbi +83 -0
- data/rbi/deeprails/models/workflow_event_detail_response.rbi +685 -0
- data/rbi/deeprails/models/workflow_event_response.rbi +49 -42
- data/rbi/deeprails/models.rbi +12 -2
- data/rbi/deeprails/resources/defend.rbi +17 -12
- data/rbi/deeprails/resources/files.rbi +1 -1
- data/rbi/deeprails/resources/monitor.rbi +8 -8
- data/sig/deeprails/internal/transport/base_client.rbs +2 -0
- data/sig/deeprails/internal/transport/pooled_net_requester.rbs +4 -1
- data/sig/deeprails/models/defend_create_response.rbs +41 -0
- data/sig/deeprails/models/defend_create_workflow_params.rbs +7 -7
- data/sig/deeprails/models/defend_response.rbs +297 -28
- data/sig/deeprails/models/defend_retrieve_workflow_params.rbs +13 -3
- data/sig/deeprails/models/defend_update_response.rbs +41 -0
- data/sig/deeprails/models/file_response.rbs +5 -27
- data/sig/deeprails/models/file_upload_params.rbs +4 -5
- data/sig/deeprails/models/monitor_create_response.rbs +41 -0
- data/sig/deeprails/models/monitor_detail_response.rbs +72 -61
- data/sig/deeprails/models/monitor_event_detail_response.rbs +181 -0
- data/sig/deeprails/models/monitor_event_response.rbs +2 -15
- data/sig/deeprails/models/monitor_update_params.rbs +13 -13
- data/sig/deeprails/models/monitor_update_response.rbs +41 -0
- data/sig/deeprails/models/workflow_event_detail_response.rbs +315 -0
- data/sig/deeprails/models/workflow_event_response.rbs +24 -24
- data/sig/deeprails/models.rbs +12 -2
- data/sig/deeprails/resources/defend.rbs +5 -4
- data/sig/deeprails/resources/files.rbs +1 -1
- data/sig/deeprails/resources/monitor.rbs +3 -3
- metadata +20 -5
- data/lib/deeprails/models/monitor_response.rb +0 -83
- data/rbi/deeprails/models/monitor_response.rbi +0 -142
- data/sig/deeprails/models/monitor_response.rbs +0 -73
|
@@ -8,77 +8,84 @@ module Deeprails
|
|
|
8
8
|
T.any(Deeprails::WorkflowEventResponse, Deeprails::Internal::AnyHash)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
+
# The time the event was created in UTC.
|
|
12
|
+
sig { returns(Time) }
|
|
13
|
+
attr_accessor :created_at
|
|
14
|
+
|
|
11
15
|
# A unique workflow event ID.
|
|
12
16
|
sig { returns(String) }
|
|
13
17
|
attr_accessor :event_id
|
|
14
18
|
|
|
19
|
+
# Status of the event.
|
|
20
|
+
sig { returns(Deeprails::WorkflowEventResponse::Status::TaggedSymbol) }
|
|
21
|
+
attr_accessor :status
|
|
22
|
+
|
|
15
23
|
# Workflow ID associated with the event.
|
|
16
24
|
sig { returns(String) }
|
|
17
25
|
attr_accessor :workflow_id
|
|
18
26
|
|
|
19
|
-
# Count of improvement attempts for the event. If greater than one then all
|
|
20
|
-
# previous improvement attempts failed.
|
|
21
|
-
sig { returns(T.nilable(Integer)) }
|
|
22
|
-
attr_reader :attempt_number
|
|
23
|
-
|
|
24
|
-
sig { params(attempt_number: Integer).void }
|
|
25
|
-
attr_writer :attempt_number
|
|
26
|
-
|
|
27
|
-
# A unique evaluation ID associated with this event. Every event has one or more
|
|
28
|
-
# evaluation attempts.
|
|
29
|
-
sig { returns(T.nilable(String)) }
|
|
30
|
-
attr_reader :evaluation_id
|
|
31
|
-
|
|
32
|
-
sig { params(evaluation_id: String).void }
|
|
33
|
-
attr_writer :evaluation_id
|
|
34
|
-
|
|
35
|
-
# `False` if evaluation passed all of the guardrail metrics, `True` if evaluation
|
|
36
|
-
# failed any of the guardrail metrics.
|
|
37
|
-
sig { returns(T.nilable(T::Boolean)) }
|
|
38
|
-
attr_reader :filtered
|
|
39
|
-
|
|
40
|
-
sig { params(filtered: T::Boolean).void }
|
|
41
|
-
attr_writer :filtered
|
|
42
|
-
|
|
43
27
|
sig do
|
|
44
28
|
params(
|
|
29
|
+
created_at: Time,
|
|
45
30
|
event_id: String,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
evaluation_id: String,
|
|
49
|
-
filtered: T::Boolean
|
|
31
|
+
status: Deeprails::WorkflowEventResponse::Status::OrSymbol,
|
|
32
|
+
workflow_id: String
|
|
50
33
|
).returns(T.attached_class)
|
|
51
34
|
end
|
|
52
35
|
def self.new(
|
|
36
|
+
# The time the event was created in UTC.
|
|
37
|
+
created_at:,
|
|
53
38
|
# A unique workflow event ID.
|
|
54
39
|
event_id:,
|
|
40
|
+
# Status of the event.
|
|
41
|
+
status:,
|
|
55
42
|
# Workflow ID associated with the event.
|
|
56
|
-
workflow_id
|
|
57
|
-
# Count of improvement attempts for the event. If greater than one then all
|
|
58
|
-
# previous improvement attempts failed.
|
|
59
|
-
attempt_number: nil,
|
|
60
|
-
# A unique evaluation ID associated with this event. Every event has one or more
|
|
61
|
-
# evaluation attempts.
|
|
62
|
-
evaluation_id: nil,
|
|
63
|
-
# `False` if evaluation passed all of the guardrail metrics, `True` if evaluation
|
|
64
|
-
# failed any of the guardrail metrics.
|
|
65
|
-
filtered: nil
|
|
43
|
+
workflow_id:
|
|
66
44
|
)
|
|
67
45
|
end
|
|
68
46
|
|
|
69
47
|
sig do
|
|
70
48
|
override.returns(
|
|
71
49
|
{
|
|
50
|
+
created_at: Time,
|
|
72
51
|
event_id: String,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
evaluation_id: String,
|
|
76
|
-
filtered: T::Boolean
|
|
52
|
+
status: Deeprails::WorkflowEventResponse::Status::TaggedSymbol,
|
|
53
|
+
workflow_id: String
|
|
77
54
|
}
|
|
78
55
|
)
|
|
79
56
|
end
|
|
80
57
|
def to_hash
|
|
81
58
|
end
|
|
59
|
+
|
|
60
|
+
# Status of the event.
|
|
61
|
+
module Status
|
|
62
|
+
extend Deeprails::Internal::Type::Enum
|
|
63
|
+
|
|
64
|
+
TaggedSymbol =
|
|
65
|
+
T.type_alias do
|
|
66
|
+
T.all(Symbol, Deeprails::WorkflowEventResponse::Status)
|
|
67
|
+
end
|
|
68
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
69
|
+
|
|
70
|
+
IN_PROGRESS =
|
|
71
|
+
T.let(
|
|
72
|
+
:"In Progress",
|
|
73
|
+
Deeprails::WorkflowEventResponse::Status::TaggedSymbol
|
|
74
|
+
)
|
|
75
|
+
COMPLETED =
|
|
76
|
+
T.let(
|
|
77
|
+
:Completed,
|
|
78
|
+
Deeprails::WorkflowEventResponse::Status::TaggedSymbol
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
sig do
|
|
82
|
+
override.returns(
|
|
83
|
+
T::Array[Deeprails::WorkflowEventResponse::Status::TaggedSymbol]
|
|
84
|
+
)
|
|
85
|
+
end
|
|
86
|
+
def self.values
|
|
87
|
+
end
|
|
88
|
+
end
|
|
82
89
|
end
|
|
83
90
|
end
|
|
84
91
|
end
|
data/rbi/deeprails/models.rbi
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# typed: strong
|
|
2
2
|
|
|
3
3
|
module Deeprails
|
|
4
|
+
DefendCreateResponse = Deeprails::Models::DefendCreateResponse
|
|
5
|
+
|
|
4
6
|
DefendCreateWorkflowParams = Deeprails::Models::DefendCreateWorkflowParams
|
|
5
7
|
|
|
6
8
|
DefendResponse = Deeprails::Models::DefendResponse
|
|
@@ -11,6 +13,8 @@ module Deeprails
|
|
|
11
13
|
|
|
12
14
|
DefendSubmitEventParams = Deeprails::Models::DefendSubmitEventParams
|
|
13
15
|
|
|
16
|
+
DefendUpdateResponse = Deeprails::Models::DefendUpdateResponse
|
|
17
|
+
|
|
14
18
|
DefendUpdateWorkflowParams = Deeprails::Models::DefendUpdateWorkflowParams
|
|
15
19
|
|
|
16
20
|
FileResponse = Deeprails::Models::FileResponse
|
|
@@ -19,11 +23,13 @@ module Deeprails
|
|
|
19
23
|
|
|
20
24
|
MonitorCreateParams = Deeprails::Models::MonitorCreateParams
|
|
21
25
|
|
|
26
|
+
MonitorCreateResponse = Deeprails::Models::MonitorCreateResponse
|
|
27
|
+
|
|
22
28
|
MonitorDetailResponse = Deeprails::Models::MonitorDetailResponse
|
|
23
29
|
|
|
24
|
-
|
|
30
|
+
MonitorEventDetailResponse = Deeprails::Models::MonitorEventDetailResponse
|
|
25
31
|
|
|
26
|
-
|
|
32
|
+
MonitorEventResponse = Deeprails::Models::MonitorEventResponse
|
|
27
33
|
|
|
28
34
|
MonitorRetrieveParams = Deeprails::Models::MonitorRetrieveParams
|
|
29
35
|
|
|
@@ -31,5 +37,9 @@ module Deeprails
|
|
|
31
37
|
|
|
32
38
|
MonitorUpdateParams = Deeprails::Models::MonitorUpdateParams
|
|
33
39
|
|
|
40
|
+
MonitorUpdateResponse = Deeprails::Models::MonitorUpdateResponse
|
|
41
|
+
|
|
42
|
+
WorkflowEventDetailResponse = Deeprails::Models::WorkflowEventDetailResponse
|
|
43
|
+
|
|
34
44
|
WorkflowEventResponse = Deeprails::Models::WorkflowEventResponse
|
|
35
45
|
end
|
|
@@ -10,7 +10,8 @@ module Deeprails
|
|
|
10
10
|
improvement_action:
|
|
11
11
|
Deeprails::DefendCreateWorkflowParams::ImprovementAction::OrSymbol,
|
|
12
12
|
name: String,
|
|
13
|
-
|
|
13
|
+
threshold_type:
|
|
14
|
+
Deeprails::DefendCreateWorkflowParams::ThresholdType::OrSymbol,
|
|
14
15
|
automatic_hallucination_tolerance_levels:
|
|
15
16
|
T::Hash[
|
|
16
17
|
Symbol,
|
|
@@ -22,14 +23,14 @@ module Deeprails
|
|
|
22
23
|
max_improvement_attempts: Integer,
|
|
23
24
|
web_search: T::Boolean,
|
|
24
25
|
request_options: Deeprails::RequestOptions::OrHash
|
|
25
|
-
).returns(Deeprails::
|
|
26
|
+
).returns(Deeprails::DefendCreateResponse)
|
|
26
27
|
end
|
|
27
28
|
def create_workflow(
|
|
28
|
-
# The action used to improve outputs that fail one or guardrail metrics for
|
|
29
|
-
# workflow events. May be `regen`, `fixit`, or `do_nothing`. ReGen runs the
|
|
30
|
-
# input prompt with minor induced variance. FixIt attempts to directly
|
|
31
|
-
# shortcomings of the output using the guardrail failure rationale. Do
|
|
32
|
-
# does not attempt any improvement.
|
|
29
|
+
# The action used to improve outputs that fail one or more guardrail metrics for
|
|
30
|
+
# the workflow events. May be `regen`, `fixit`, or `do_nothing`. ReGen runs the
|
|
31
|
+
# user's input prompt with minor induced variance. FixIt attempts to directly
|
|
32
|
+
# address the shortcomings of the output using the guardrail failure rationale. Do
|
|
33
|
+
# Nothing does not attempt any improvement.
|
|
33
34
|
improvement_action:,
|
|
34
35
|
# Name of the workflow.
|
|
35
36
|
name:,
|
|
@@ -38,7 +39,7 @@ module Deeprails
|
|
|
38
39
|
# qualitative tolerance for the metrics, whereas custom metrics allow the user to
|
|
39
40
|
# set the threshold for each metric as a floating point number between 0.0 and
|
|
40
41
|
# 1.0.
|
|
41
|
-
|
|
42
|
+
threshold_type:,
|
|
42
43
|
# Mapping of guardrail metrics to hallucination tolerance levels (either `low`,
|
|
43
44
|
# `medium`, or `high`). Possible metrics are `completeness`,
|
|
44
45
|
# `instruction_adherence`, `context_adherence`, `ground_truth_adherence`, or
|
|
@@ -53,7 +54,7 @@ module Deeprails
|
|
|
53
54
|
# An array of file IDs to search in the workflow's evaluations. Files must be
|
|
54
55
|
# uploaded via the DeepRails API first.
|
|
55
56
|
file_search: nil,
|
|
56
|
-
# Max. number of improvement action
|
|
57
|
+
# Max. number of improvement action attempts until a given event passes the
|
|
57
58
|
# guardrails. Defaults to 10.
|
|
58
59
|
max_improvement_attempts: nil,
|
|
59
60
|
# Whether to enable web search for this workflow's evaluations. Defaults to false.
|
|
@@ -68,7 +69,7 @@ module Deeprails
|
|
|
68
69
|
event_id: String,
|
|
69
70
|
workflow_id: String,
|
|
70
71
|
request_options: Deeprails::RequestOptions::OrHash
|
|
71
|
-
).returns(Deeprails::
|
|
72
|
+
).returns(Deeprails::WorkflowEventDetailResponse)
|
|
72
73
|
end
|
|
73
74
|
def retrieve_event(
|
|
74
75
|
# The ID of the requested workflow event.
|
|
@@ -83,12 +84,16 @@ module Deeprails
|
|
|
83
84
|
sig do
|
|
84
85
|
params(
|
|
85
86
|
workflow_id: String,
|
|
87
|
+
limit: Integer,
|
|
86
88
|
request_options: Deeprails::RequestOptions::OrHash
|
|
87
89
|
).returns(Deeprails::DefendResponse)
|
|
88
90
|
end
|
|
89
91
|
def retrieve_workflow(
|
|
90
92
|
# The ID of the workflow to retrieve.
|
|
91
93
|
workflow_id,
|
|
94
|
+
# Limit the number of returned events associated with this workflow. Defaults
|
|
95
|
+
# to 10.
|
|
96
|
+
limit: nil,
|
|
92
97
|
request_options: {}
|
|
93
98
|
)
|
|
94
99
|
end
|
|
@@ -128,14 +133,14 @@ module Deeprails
|
|
|
128
133
|
)
|
|
129
134
|
end
|
|
130
135
|
|
|
131
|
-
# Use this endpoint to update an existing
|
|
136
|
+
# Use this endpoint to update an existing defend workflow
|
|
132
137
|
sig do
|
|
133
138
|
params(
|
|
134
139
|
workflow_id: String,
|
|
135
140
|
description: String,
|
|
136
141
|
name: String,
|
|
137
142
|
request_options: Deeprails::RequestOptions::OrHash
|
|
138
|
-
).returns(Deeprails::
|
|
143
|
+
).returns(Deeprails::DefendUpdateResponse)
|
|
139
144
|
end
|
|
140
145
|
def update_workflow(
|
|
141
146
|
# The ID of the workflow to edit.
|
|
@@ -14,7 +14,7 @@ module Deeprails
|
|
|
14
14
|
file_search: T::Array[String],
|
|
15
15
|
web_search: T::Boolean,
|
|
16
16
|
request_options: Deeprails::RequestOptions::OrHash
|
|
17
|
-
).returns(Deeprails::
|
|
17
|
+
).returns(Deeprails::MonitorCreateResponse)
|
|
18
18
|
end
|
|
19
19
|
def create(
|
|
20
20
|
# An array of guardrail metrics that the model input and output pair will be
|
|
@@ -47,7 +47,8 @@ module Deeprails
|
|
|
47
47
|
def retrieve(
|
|
48
48
|
# The ID of the monitor to retrieve.
|
|
49
49
|
monitor_id,
|
|
50
|
-
# Limit the returned
|
|
50
|
+
# Limit the number of returned evaluations associated with this monitor. Defaults
|
|
51
|
+
# to 10.
|
|
51
52
|
limit: nil,
|
|
52
53
|
request_options: {}
|
|
53
54
|
)
|
|
@@ -59,22 +60,21 @@ module Deeprails
|
|
|
59
60
|
params(
|
|
60
61
|
monitor_id: String,
|
|
61
62
|
description: String,
|
|
62
|
-
monitor_status:
|
|
63
|
-
Deeprails::MonitorUpdateParams::MonitorStatus::OrSymbol,
|
|
64
63
|
name: String,
|
|
64
|
+
status: Deeprails::MonitorUpdateParams::Status::OrSymbol,
|
|
65
65
|
request_options: Deeprails::RequestOptions::OrHash
|
|
66
|
-
).returns(Deeprails::
|
|
66
|
+
).returns(Deeprails::MonitorUpdateResponse)
|
|
67
67
|
end
|
|
68
68
|
def update(
|
|
69
69
|
# The ID of the monitor to edit.
|
|
70
70
|
monitor_id,
|
|
71
71
|
# Description of the monitor.
|
|
72
72
|
description: nil,
|
|
73
|
-
# Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
|
|
74
|
-
# longer record and evaluate events.
|
|
75
|
-
monitor_status: nil,
|
|
76
73
|
# Name of the monitor.
|
|
77
74
|
name: nil,
|
|
75
|
+
# Status of the monitor. Can be `active` or `inactive`. Inactive monitors no
|
|
76
|
+
# longer record and evaluate events.
|
|
77
|
+
status: nil,
|
|
78
78
|
request_options: {}
|
|
79
79
|
)
|
|
80
80
|
end
|
|
@@ -17,7 +17,10 @@ module Deeprails
|
|
|
17
17
|
|
|
18
18
|
DEFAULT_MAX_CONNECTIONS: Integer
|
|
19
19
|
|
|
20
|
-
def self.connect: (
|
|
20
|
+
def self.connect: (
|
|
21
|
+
cert_store: OpenSSL::X509::Store,
|
|
22
|
+
url: URI::Generic
|
|
23
|
+
) -> top
|
|
21
24
|
|
|
22
25
|
def self.calibrate_socket_timeout: (top conn, Float deadline) -> void
|
|
23
26
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
module Deeprails
|
|
2
|
+
module Models
|
|
3
|
+
type defend_create_response =
|
|
4
|
+
{
|
|
5
|
+
created_at: Time,
|
|
6
|
+
status: Deeprails::Models::DefendCreateResponse::status,
|
|
7
|
+
workflow_id: String
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
class DefendCreateResponse < Deeprails::Internal::Type::BaseModel
|
|
11
|
+
attr_accessor created_at: Time
|
|
12
|
+
|
|
13
|
+
attr_accessor status: Deeprails::Models::DefendCreateResponse::status
|
|
14
|
+
|
|
15
|
+
attr_accessor workflow_id: String
|
|
16
|
+
|
|
17
|
+
def initialize: (
|
|
18
|
+
created_at: Time,
|
|
19
|
+
status: Deeprails::Models::DefendCreateResponse::status,
|
|
20
|
+
workflow_id: String
|
|
21
|
+
) -> void
|
|
22
|
+
|
|
23
|
+
def to_hash: -> {
|
|
24
|
+
created_at: Time,
|
|
25
|
+
status: Deeprails::Models::DefendCreateResponse::status,
|
|
26
|
+
workflow_id: String
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type status = :inactive | :active
|
|
30
|
+
|
|
31
|
+
module Status
|
|
32
|
+
extend Deeprails::Internal::Type::Enum
|
|
33
|
+
|
|
34
|
+
INACTIVE: :inactive
|
|
35
|
+
ACTIVE: :active
|
|
36
|
+
|
|
37
|
+
def self?.values: -> ::Array[Deeprails::Models::DefendCreateResponse::status]
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -4,7 +4,7 @@ module Deeprails
|
|
|
4
4
|
{
|
|
5
5
|
improvement_action: Deeprails::Models::DefendCreateWorkflowParams::improvement_action,
|
|
6
6
|
name: String,
|
|
7
|
-
|
|
7
|
+
threshold_type: Deeprails::Models::DefendCreateWorkflowParams::threshold_type,
|
|
8
8
|
automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendCreateWorkflowParams::automatic_hallucination_tolerance_level],
|
|
9
9
|
custom_hallucination_threshold_values: ::Hash[Symbol, Float],
|
|
10
10
|
description: String,
|
|
@@ -22,7 +22,7 @@ module Deeprails
|
|
|
22
22
|
|
|
23
23
|
attr_accessor name: String
|
|
24
24
|
|
|
25
|
-
attr_accessor
|
|
25
|
+
attr_accessor threshold_type: Deeprails::Models::DefendCreateWorkflowParams::threshold_type
|
|
26
26
|
|
|
27
27
|
attr_reader automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendCreateWorkflowParams::automatic_hallucination_tolerance_level]?
|
|
28
28
|
|
|
@@ -55,7 +55,7 @@ module Deeprails
|
|
|
55
55
|
def initialize: (
|
|
56
56
|
improvement_action: Deeprails::Models::DefendCreateWorkflowParams::improvement_action,
|
|
57
57
|
name: String,
|
|
58
|
-
|
|
58
|
+
threshold_type: Deeprails::Models::DefendCreateWorkflowParams::threshold_type,
|
|
59
59
|
?automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendCreateWorkflowParams::automatic_hallucination_tolerance_level],
|
|
60
60
|
?custom_hallucination_threshold_values: ::Hash[Symbol, Float],
|
|
61
61
|
?description: String,
|
|
@@ -68,7 +68,7 @@ module Deeprails
|
|
|
68
68
|
def to_hash: -> {
|
|
69
69
|
improvement_action: Deeprails::Models::DefendCreateWorkflowParams::improvement_action,
|
|
70
70
|
name: String,
|
|
71
|
-
|
|
71
|
+
threshold_type: Deeprails::Models::DefendCreateWorkflowParams::threshold_type,
|
|
72
72
|
automatic_hallucination_tolerance_levels: ::Hash[Symbol, Deeprails::Models::DefendCreateWorkflowParams::automatic_hallucination_tolerance_level],
|
|
73
73
|
custom_hallucination_threshold_values: ::Hash[Symbol, Float],
|
|
74
74
|
description: String,
|
|
@@ -90,15 +90,15 @@ module Deeprails
|
|
|
90
90
|
def self?.values: -> ::Array[Deeprails::Models::DefendCreateWorkflowParams::improvement_action]
|
|
91
91
|
end
|
|
92
92
|
|
|
93
|
-
type
|
|
93
|
+
type threshold_type = :automatic | :custom
|
|
94
94
|
|
|
95
|
-
module
|
|
95
|
+
module ThresholdType
|
|
96
96
|
extend Deeprails::Internal::Type::Enum
|
|
97
97
|
|
|
98
98
|
AUTOMATIC: :automatic
|
|
99
99
|
CUSTOM: :custom
|
|
100
100
|
|
|
101
|
-
def self?.values: -> ::Array[Deeprails::Models::DefendCreateWorkflowParams::
|
|
101
|
+
def self?.values: -> ::Array[Deeprails::Models::DefendCreateWorkflowParams::threshold_type]
|
|
102
102
|
end
|
|
103
103
|
|
|
104
104
|
type automatic_hallucination_tolerance_level = :low | :medium | :high
|