Class: Vellum::WorkflowResultEventOutputDataFunctionCall

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

Overview

A Function Call output returned from a Workflow execution.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: OMIT, name:, state:, node_id:, delta: OMIT, type:, value: OMIT, additional_properties: nil) ⇒ Vellum::WorkflowResultEventOutputDataFunctionCall

Parameters:

  • type (String)
  • value (Vellum::FunctionCall) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 43

def initialize(id: OMIT, name:, state:, node_id:, delta: OMIT, type:, value: OMIT, additional_properties: nil)
  @id = id if id != OMIT
  @name = name
  @state = state
  @node_id = node_id
  @delta = delta if delta != OMIT
  @type = type
  @value = value if value != OMIT
  @additional_properties = additional_properties
  @_field_set = { "id": id, "name": name, "state": state, "node_id": node_id, "delta": delta, "type": type, "value": value }.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



26
27
28
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 26

def additional_properties
  @additional_properties
end

#deltaObject (readonly)

STREAMING.



20
21
22
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 20

def delta
  @delta
end

#idString (readonly)

Returns:

  • (String)


11
12
13
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 11

def id
  @id
end

#nameString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 13

def name
  @name
end

#node_idString (readonly)

Returns:

  • (String)


17
18
19
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 17

def node_id
  @node_id
end

#stateVellum::WorkflowNodeResultEventState (readonly)



15
16
17
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 15

def state
  @state
end

#typeString (readonly)

Returns:

  • (String)


22
23
24
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 22

def type
  @type
end

#valueVellum::FunctionCall (readonly)



24
25
26
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 24

def value
  @value
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::WorkflowResultEventOutputDataFunctionCall

Parameters:

  • json_object (String)

Returns:



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 61

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  name = parsed_json["name"]
  state = parsed_json["state"]
  node_id = parsed_json["node_id"]
  delta = parsed_json["delta"]
  type = parsed_json["type"]
  unless parsed_json["value"].nil?
    value = parsed_json["value"].to_json
    value = Vellum::FunctionCall.from_json(json_object: value)
  else
    value = nil
  end
  new(
    id: id,
    name: name,
    state: state,
    node_id: node_id,
    delta: delta,
    type: type,
    value: value,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


100
101
102
103
104
105
106
107
108
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 100

def self.validate_raw(obj:)
  obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.state.is_a?(Vellum::WorkflowNodeResultEventState) != false || raise("Passed value for field obj.state is not the expected type, validation failed.")
  obj.node_id.is_a?(String) != false || raise("Passed value for field obj.node_id is not the expected type, validation failed.")
  obj.delta&.is_a?(String) != false || raise("Passed value for field obj.delta is not the expected type, validation failed.")
  obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
  obj.value.nil? || Vellum::FunctionCall.validate_raw(obj: obj.value)
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


91
92
93
# File 'lib/vellum_ai/types/workflow_result_event_output_data_function_call.rb', line 91

def to_json
  @_field_set&.to_json
end