Class: Vellum::WorkflowExpandMetaRequest
- Inherits:
-
Object
- Object
- Vellum::WorkflowExpandMetaRequest
- Defined in:
- lib/vellum_ai/types/workflow_expand_meta_request.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#cost ⇒ Object
readonly
tracking.
-
#model_name ⇒ Boolean
readonly
If enabled, the Prompt Node FULFILLED events will include model host name.
-
#usage ⇒ Object
readonly
tracking.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(usage: OMIT, cost: OMIT, model_name: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowExpandMetaRequest constructor
- #to_json ⇒ String
Constructor Details
#initialize(usage: OMIT, cost: OMIT, model_name: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowExpandMetaRequest
30 31 32 33 34 35 36 37 38 |
# File 'lib/vellum_ai/types/workflow_expand_meta_request.rb', line 30 def initialize(usage: OMIT, cost: OMIT, model_name: OMIT, additional_properties: nil) @usage = usage if usage != OMIT @cost = cost if cost != OMIT @model_name = model_name if model_name != OMIT @additional_properties = additional_properties @_field_set = { "usage": usage, "cost": cost, "model_name": model_name }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
16 17 18 |
# File 'lib/vellum_ai/types/workflow_expand_meta_request.rb', line 16 def additional_properties @additional_properties end |
#cost ⇒ Object (readonly)
tracking. This may increase latency for some model hosts.
12 13 14 |
# File 'lib/vellum_ai/types/workflow_expand_meta_request.rb', line 12 def cost @cost end |
#model_name ⇒ Boolean (readonly)
Returns If enabled, the Prompt Node FULFILLED events will include model host name.
14 15 16 |
# File 'lib/vellum_ai/types/workflow_expand_meta_request.rb', line 14 def model_name @model_name end |
#usage ⇒ Object (readonly)
tracking. This may increase latency for some model hosts.
9 10 11 |
# File 'lib/vellum_ai/types/workflow_expand_meta_request.rb', line 9 def usage @usage end |
Class Method Details
.from_json(json_object:) ⇒ Vellum::WorkflowExpandMetaRequest
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/vellum_ai/types/workflow_expand_meta_request.rb', line 43 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) usage = parsed_json["usage"] cost = parsed_json["cost"] model_name = parsed_json["model_name"] new( usage: usage, cost: cost, model_name: model_name, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
68 69 70 71 72 |
# File 'lib/vellum_ai/types/workflow_expand_meta_request.rb', line 68 def self.validate_raw(obj:) obj.usage&.is_a?(Boolean) != false || raise("Passed value for field obj.usage is not the expected type, validation failed.") obj.cost&.is_a?(Boolean) != false || raise("Passed value for field obj.cost is not the expected type, validation failed.") obj.model_name&.is_a?(Boolean) != false || raise("Passed value for field obj.model_name is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
59 60 61 |
# File 'lib/vellum_ai/types/workflow_expand_meta_request.rb', line 59 def to_json @_field_set&.to_json end |