Class: Vellum::WorkflowExpandMetaRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/vellum_ai/types/workflow_expand_meta_request.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(usage: OMIT, cost: OMIT, model_name: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowExpandMetaRequest

Parameters:

  • model_name (Boolean) (defaults to: OMIT)

    If enabled, the Prompt Node FULFILLED events will include model host name

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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

#costObject (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_nameBoolean (readonly)

Returns If enabled, the Prompt Node FULFILLED events will include model host name.

Returns:

  • (Boolean)

    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

#usageObject (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

Parameters:

  • json_object (String)

Returns:



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

Parameters:

  • obj (Object)

Returns:

  • (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_jsonString

Returns:

  • (String)


59
60
61
# File 'lib/vellum_ai/types/workflow_expand_meta_request.rb', line 59

def to_json
  @_field_set&.to_json
end