vellum_ai 0.3.10 → 0.3.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ee15857c4f6d078afa21d87b58baf72fa919289417db31edd4d749d76616dac
4
- data.tar.gz: 2b3ef152052326857531cfcea45ee4baa5ec17285aeceab9f1e1fb42719e08f7
3
+ metadata.gz: a34112cfe303a361bb71b349a1b752f9af3a0aeab320d337423fff77fb2b2cac
4
+ data.tar.gz: 3de6e6dc8f28729679ae89cb99a7bd210520457564910e499c0ebdddd938a219
5
5
  SHA512:
6
- metadata.gz: 46b1deb69aee31554a0fef8440a43de43027687f2be4d39c39491a3b0221852961a00759ad42837ce6d2ad16a0aea89ecd2a7671e387e70fa3ac91c1093c7879
7
- data.tar.gz: d9325756359ce00b83ba6fa59f6ae988e801c04e420645ae653e43f592a5ae702caac0ccc00c58e026c2ce4f92bd0490c99a6cf25c1865e689e3295d47a5440e
6
+ metadata.gz: f728fd9611386219ed4871bd39a5fba81166c72f04e42d4c877f1f5e4539d5178d0f4b1a195b5090cbba8091e49fb4985dab61903ec5bbd6c89f0fc2bdac0bca
7
+ data.tar.gz: 6d9034005bbdfa8a321ddd061a6aacbfa64ab2421506069726eb56ca6bf07eef593ef55903aa354fe1b4e9fc1e72578f93700ace1c547374992738115a461fdb
data/lib/requests.rb CHANGED
@@ -20,7 +20,7 @@ module Vellum
20
20
  @headers = {
21
21
  "X-Fern-Language": "Ruby",
22
22
  "X-Fern-SDK-Name": "Vellum",
23
- "X-Fern-SDK-Version": "0.3.10",
23
+ "X-Fern-SDK-Version": "0.3.11",
24
24
  "X_API_KEY": api_key.to_s
25
25
  }
26
26
  @conn = Faraday.new(headers: @headers) do |faraday|
@@ -46,7 +46,7 @@ module Vellum
46
46
  @headers = {
47
47
  "X-Fern-Language": "Ruby",
48
48
  "X-Fern-SDK-Name": "Vellum",
49
- "X-Fern-SDK-Version": "0.3.10",
49
+ "X-Fern-SDK-Version": "0.3.11",
50
50
  "X_API_KEY": api_key.to_s
51
51
  }
52
52
  @conn = Faraday.new(headers: @headers) do |faraday|
data/lib/types_export.rb CHANGED
@@ -49,6 +49,15 @@ require_relative "vellum_ai/types/execute_workflow_error_response"
49
49
  require_relative "vellum_ai/types/execute_workflow_response"
50
50
  require_relative "vellum_ai/types/execute_workflow_stream_error_response"
51
51
  require_relative "vellum_ai/types/execute_workflow_workflow_result_event"
52
+ require_relative "vellum_ai/types/execution_array_vellum_value"
53
+ require_relative "vellum_ai/types/execution_chat_history_vellum_value"
54
+ require_relative "vellum_ai/types/execution_error_vellum_value"
55
+ require_relative "vellum_ai/types/execution_function_call_vellum_value"
56
+ require_relative "vellum_ai/types/execution_json_vellum_value"
57
+ require_relative "vellum_ai/types/execution_number_vellum_value"
58
+ require_relative "vellum_ai/types/execution_search_results_vellum_value"
59
+ require_relative "vellum_ai/types/execution_string_vellum_value"
60
+ require_relative "vellum_ai/types/execution_vellum_value"
52
61
  require_relative "vellum_ai/types/finish_reason_enum"
53
62
  require_relative "vellum_ai/types/fulfilled_enum"
54
63
  require_relative "vellum_ai/types/fulfilled_execute_prompt_event"
@@ -60,9 +60,11 @@ module Vellum
60
60
  # @param deployment_id [String] The ID of the deployment. Must provide either this or deployment_name.
61
61
  # @param deployment_name [String] The name of the deployment. Must provide either this or deployment_id.
62
62
  # @param inputs [Array<Hash>] The list of inputs defined in the Prompt's deployment with their corresponding values.Request of type Array<PromptDeploymentInputRequest>, as a Hash
63
+ # @param release_tag [String] Optionally specify a release tag if you want to pin to a specific release of the Workflow Deployment
63
64
  # @param request_options [RequestOptions]
64
65
  # @return [DeploymentProviderPayloadResponse]
65
- def retrieve_provider_payload(inputs:, deployment_id: nil, deployment_name: nil, request_options: nil)
66
+ def retrieve_provider_payload(inputs:, deployment_id: nil, deployment_name: nil, release_tag: nil,
67
+ request_options: nil)
66
68
  response = @request_client.conn.post do |req|
67
69
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
68
70
  req.headers["X_API_KEY"] = request_options.api_key unless request_options&.api_key.nil?
@@ -71,7 +73,8 @@ module Vellum
71
73
  **(request_options&.additional_body_parameters || {}),
72
74
  deployment_id: deployment_id,
73
75
  deployment_name: deployment_name,
74
- inputs: inputs
76
+ inputs: inputs,
77
+ release_tag: release_tag
75
78
  }.compact
76
79
  req.url "#{@request_client.default_environment[:Default]}/v1/deployments/provider-payload"
77
80
  end
@@ -134,9 +137,11 @@ module Vellum
134
137
  # @param deployment_id [String] The ID of the deployment. Must provide either this or deployment_name.
135
138
  # @param deployment_name [String] The name of the deployment. Must provide either this or deployment_id.
136
139
  # @param inputs [Array<Hash>] The list of inputs defined in the Prompt's deployment with their corresponding values.Request of type Array<PromptDeploymentInputRequest>, as a Hash
140
+ # @param release_tag [String] Optionally specify a release tag if you want to pin to a specific release of the Workflow Deployment
137
141
  # @param request_options [RequestOptions]
138
142
  # @return [DeploymentProviderPayloadResponse]
139
- def retrieve_provider_payload(inputs:, deployment_id: nil, deployment_name: nil, request_options: nil)
143
+ def retrieve_provider_payload(inputs:, deployment_id: nil, deployment_name: nil, release_tag: nil,
144
+ request_options: nil)
140
145
  Async do
141
146
  response = @request_client.conn.post do |req|
142
147
  req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
@@ -146,7 +151,8 @@ module Vellum
146
151
  **(request_options&.additional_body_parameters || {}),
147
152
  deployment_id: deployment_id,
148
153
  deployment_name: deployment_name,
149
- inputs: inputs
154
+ inputs: inputs,
155
+ release_tag: release_tag
150
156
  }.compact
151
157
  req.url "#{@request_client.default_environment[:Default]}/v1/deployments/provider-payload"
152
158
  end
@@ -6,20 +6,23 @@ require "json"
6
6
 
7
7
  module Vellum
8
8
  class ChatMessage
9
- attr_reader :text, :role, :content, :additional_properties
9
+ attr_reader :text, :role, :content, :source, :additional_properties
10
10
 
11
11
  # @param text [String]
12
12
  # @param role [CHAT_MESSAGE_ROLE]
13
13
  # @param content [ChatMessageContent]
14
+ # @param source [String] An optional identifier representing who or what generated this message.
14
15
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
15
16
  # @return [ChatMessage]
16
- def initialize(role:, text: nil, content: nil, additional_properties: nil)
17
+ def initialize(role:, text: nil, content: nil, source: nil, additional_properties: nil)
17
18
  # @type [String]
18
19
  @text = text
19
20
  # @type [CHAT_MESSAGE_ROLE]
20
21
  @role = role
21
22
  # @type [ChatMessageContent]
22
23
  @content = content
24
+ # @type [String] An optional identifier representing who or what generated this message.
25
+ @source = source
23
26
  # @type [OpenStruct] Additional properties unmapped to the current class definition
24
27
  @additional_properties = additional_properties
25
28
  end
@@ -39,14 +42,15 @@ module Vellum
39
42
  content = parsed_json["content"].to_json
40
43
  content = ChatMessageContent.from_json(json_object: content)
41
44
  end
42
- new(text: text, role: role, content: content, additional_properties: struct)
45
+ source = struct.source
46
+ new(text: text, role: role, content: content, source: source, additional_properties: struct)
43
47
  end
44
48
 
45
49
  # Serialize an instance of ChatMessage to a JSON object
46
50
  #
47
51
  # @return [JSON]
48
52
  def to_json(*_args)
49
- { "text": @text, "role": CHAT_MESSAGE_ROLE[@role] || @role, "content": @content }.to_json
53
+ { "text": @text, "role": CHAT_MESSAGE_ROLE[@role] || @role, "content": @content, "source": @source }.to_json
50
54
  end
51
55
 
52
56
  # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
@@ -57,6 +61,7 @@ module Vellum
57
61
  obj.text&.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
58
62
  obj.role.is_a?(CHAT_MESSAGE_ROLE) != false || raise("Passed value for field obj.role is not the expected type, validation failed.")
59
63
  obj.content.nil? || ChatMessageContent.validate_raw(obj: obj.content)
64
+ obj.source&.is_a?(String) != false || raise("Passed value for field obj.source is not the expected type, validation failed.")
60
65
  end
61
66
  end
62
67
  end
@@ -6,20 +6,23 @@ require "json"
6
6
 
7
7
  module Vellum
8
8
  class ChatMessageRequest
9
- attr_reader :text, :role, :content, :additional_properties
9
+ attr_reader :text, :role, :content, :source, :additional_properties
10
10
 
11
11
  # @param text [String]
12
12
  # @param role [CHAT_MESSAGE_ROLE]
13
13
  # @param content [ChatMessageContentRequest]
14
+ # @param source [String] An optional identifier representing who or what generated this message.
14
15
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
15
16
  # @return [ChatMessageRequest]
16
- def initialize(role:, text: nil, content: nil, additional_properties: nil)
17
+ def initialize(role:, text: nil, content: nil, source: nil, additional_properties: nil)
17
18
  # @type [String]
18
19
  @text = text
19
20
  # @type [CHAT_MESSAGE_ROLE]
20
21
  @role = role
21
22
  # @type [ChatMessageContentRequest]
22
23
  @content = content
24
+ # @type [String] An optional identifier representing who or what generated this message.
25
+ @source = source
23
26
  # @type [OpenStruct] Additional properties unmapped to the current class definition
24
27
  @additional_properties = additional_properties
25
28
  end
@@ -39,14 +42,15 @@ module Vellum
39
42
  content = parsed_json["content"].to_json
40
43
  content = ChatMessageContentRequest.from_json(json_object: content)
41
44
  end
42
- new(text: text, role: role, content: content, additional_properties: struct)
45
+ source = struct.source
46
+ new(text: text, role: role, content: content, source: source, additional_properties: struct)
43
47
  end
44
48
 
45
49
  # Serialize an instance of ChatMessageRequest to a JSON object
46
50
  #
47
51
  # @return [JSON]
48
52
  def to_json(*_args)
49
- { "text": @text, "role": CHAT_MESSAGE_ROLE[@role] || @role, "content": @content }.to_json
53
+ { "text": @text, "role": CHAT_MESSAGE_ROLE[@role] || @role, "content": @content, "source": @source }.to_json
50
54
  end
51
55
 
52
56
  # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
@@ -57,6 +61,7 @@ module Vellum
57
61
  obj.text&.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
58
62
  obj.role.is_a?(CHAT_MESSAGE_ROLE) != false || raise("Passed value for field obj.role is not the expected type, validation failed.")
59
63
  obj.content.nil? || ChatMessageContentRequest.validate_raw(obj: obj.content)
64
+ obj.source&.is_a?(String) != false || raise("Passed value for field obj.source is not the expected type, validation failed.")
60
65
  end
61
66
  end
62
67
  end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "array_variable_value_item"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class ExecutionArrayVellumValue
8
+ attr_reader :id, :name, :value, :additional_properties
9
+
10
+ # @param id [String] The variable's uniquely identifying internal id.
11
+ # @param name [String]
12
+ # @param value [Array<ArrayVariableValueItem>]
13
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
14
+ # @return [ExecutionArrayVellumValue]
15
+ def initialize(id:, name:, value: nil, additional_properties: nil)
16
+ # @type [String] The variable's uniquely identifying internal id.
17
+ @id = id
18
+ # @type [String]
19
+ @name = name
20
+ # @type [Array<ArrayVariableValueItem>]
21
+ @value = value
22
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
23
+ @additional_properties = additional_properties
24
+ end
25
+
26
+ # Deserialize a JSON object to an instance of ExecutionArrayVellumValue
27
+ #
28
+ # @param json_object [JSON]
29
+ # @return [ExecutionArrayVellumValue]
30
+ def self.from_json(json_object:)
31
+ struct = JSON.parse(json_object, object_class: OpenStruct)
32
+ parsed_json = JSON.parse(json_object)
33
+ id = struct.id
34
+ name = struct.name
35
+ value = parsed_json["value"].map do |v|
36
+ v = v.to_json
37
+ ArrayVariableValueItem.from_json(json_object: v)
38
+ end
39
+ new(id: id, name: name, value: value, additional_properties: struct)
40
+ end
41
+
42
+ # Serialize an instance of ExecutionArrayVellumValue to a JSON object
43
+ #
44
+ # @return [JSON]
45
+ def to_json(*_args)
46
+ { "id": @id, "name": @name, "value": @value }.to_json
47
+ end
48
+
49
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
50
+ #
51
+ # @param obj [Object]
52
+ # @return [Void]
53
+ def self.validate_raw(obj:)
54
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
55
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
56
+ obj.value&.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "chat_message"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class ExecutionChatHistoryVellumValue
8
+ attr_reader :id, :name, :value, :additional_properties
9
+
10
+ # @param id [String] The variable's uniquely identifying internal id.
11
+ # @param name [String]
12
+ # @param value [Array<ChatMessage>]
13
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
14
+ # @return [ExecutionChatHistoryVellumValue]
15
+ def initialize(id:, name:, value: nil, additional_properties: nil)
16
+ # @type [String] The variable's uniquely identifying internal id.
17
+ @id = id
18
+ # @type [String]
19
+ @name = name
20
+ # @type [Array<ChatMessage>]
21
+ @value = value
22
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
23
+ @additional_properties = additional_properties
24
+ end
25
+
26
+ # Deserialize a JSON object to an instance of ExecutionChatHistoryVellumValue
27
+ #
28
+ # @param json_object [JSON]
29
+ # @return [ExecutionChatHistoryVellumValue]
30
+ def self.from_json(json_object:)
31
+ struct = JSON.parse(json_object, object_class: OpenStruct)
32
+ parsed_json = JSON.parse(json_object)
33
+ id = struct.id
34
+ name = struct.name
35
+ value = parsed_json["value"].map do |v|
36
+ v = v.to_json
37
+ ChatMessage.from_json(json_object: v)
38
+ end
39
+ new(id: id, name: name, value: value, additional_properties: struct)
40
+ end
41
+
42
+ # Serialize an instance of ExecutionChatHistoryVellumValue to a JSON object
43
+ #
44
+ # @return [JSON]
45
+ def to_json(*_args)
46
+ { "id": @id, "name": @name, "value": @value }.to_json
47
+ end
48
+
49
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
50
+ #
51
+ # @param obj [Object]
52
+ # @return [Void]
53
+ def self.validate_raw(obj:)
54
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
55
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
56
+ obj.value&.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "vellum_error"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class ExecutionErrorVellumValue
8
+ attr_reader :id, :name, :value, :additional_properties
9
+
10
+ # @param id [String] The variable's uniquely identifying internal id.
11
+ # @param name [String]
12
+ # @param value [VellumError]
13
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
14
+ # @return [ExecutionErrorVellumValue]
15
+ def initialize(id:, name:, value: nil, additional_properties: nil)
16
+ # @type [String] The variable's uniquely identifying internal id.
17
+ @id = id
18
+ # @type [String]
19
+ @name = name
20
+ # @type [VellumError]
21
+ @value = value
22
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
23
+ @additional_properties = additional_properties
24
+ end
25
+
26
+ # Deserialize a JSON object to an instance of ExecutionErrorVellumValue
27
+ #
28
+ # @param json_object [JSON]
29
+ # @return [ExecutionErrorVellumValue]
30
+ def self.from_json(json_object:)
31
+ struct = JSON.parse(json_object, object_class: OpenStruct)
32
+ parsed_json = JSON.parse(json_object)
33
+ id = struct.id
34
+ name = struct.name
35
+ if parsed_json["value"].nil?
36
+ value = nil
37
+ else
38
+ value = parsed_json["value"].to_json
39
+ value = VellumError.from_json(json_object: value)
40
+ end
41
+ new(id: id, name: name, value: value, additional_properties: struct)
42
+ end
43
+
44
+ # Serialize an instance of ExecutionErrorVellumValue to a JSON object
45
+ #
46
+ # @return [JSON]
47
+ def to_json(*_args)
48
+ { "id": @id, "name": @name, "value": @value }.to_json
49
+ end
50
+
51
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
52
+ #
53
+ # @param obj [Object]
54
+ # @return [Void]
55
+ def self.validate_raw(obj:)
56
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
57
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
58
+ obj.value.nil? || VellumError.validate_raw(obj: obj.value)
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "function_call"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class ExecutionFunctionCallVellumValue
8
+ attr_reader :id, :name, :value, :additional_properties
9
+
10
+ # @param id [String] The variable's uniquely identifying internal id.
11
+ # @param name [String]
12
+ # @param value [FunctionCall]
13
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
14
+ # @return [ExecutionFunctionCallVellumValue]
15
+ def initialize(id:, name:, value: nil, additional_properties: nil)
16
+ # @type [String] The variable's uniquely identifying internal id.
17
+ @id = id
18
+ # @type [String]
19
+ @name = name
20
+ # @type [FunctionCall]
21
+ @value = value
22
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
23
+ @additional_properties = additional_properties
24
+ end
25
+
26
+ # Deserialize a JSON object to an instance of ExecutionFunctionCallVellumValue
27
+ #
28
+ # @param json_object [JSON]
29
+ # @return [ExecutionFunctionCallVellumValue]
30
+ def self.from_json(json_object:)
31
+ struct = JSON.parse(json_object, object_class: OpenStruct)
32
+ parsed_json = JSON.parse(json_object)
33
+ id = struct.id
34
+ name = struct.name
35
+ if parsed_json["value"].nil?
36
+ value = nil
37
+ else
38
+ value = parsed_json["value"].to_json
39
+ value = FunctionCall.from_json(json_object: value)
40
+ end
41
+ new(id: id, name: name, value: value, additional_properties: struct)
42
+ end
43
+
44
+ # Serialize an instance of ExecutionFunctionCallVellumValue to a JSON object
45
+ #
46
+ # @return [JSON]
47
+ def to_json(*_args)
48
+ { "id": @id, "name": @name, "value": @value }.to_json
49
+ end
50
+
51
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
52
+ #
53
+ # @param obj [Object]
54
+ # @return [Void]
55
+ def self.validate_raw(obj:)
56
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
57
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
58
+ obj.value.nil? || FunctionCall.validate_raw(obj: obj.value)
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+
5
+ module Vellum
6
+ class ExecutionJsonVellumValue
7
+ attr_reader :id, :name, :value, :additional_properties
8
+
9
+ # @param id [String] The variable's uniquely identifying internal id.
10
+ # @param name [String]
11
+ # @param value [Hash{String => String}]
12
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
13
+ # @return [ExecutionJsonVellumValue]
14
+ def initialize(id:, name:, value: nil, additional_properties: nil)
15
+ # @type [String] The variable's uniquely identifying internal id.
16
+ @id = id
17
+ # @type [String]
18
+ @name = name
19
+ # @type [Hash{String => String}]
20
+ @value = value
21
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
22
+ @additional_properties = additional_properties
23
+ end
24
+
25
+ # Deserialize a JSON object to an instance of ExecutionJsonVellumValue
26
+ #
27
+ # @param json_object [JSON]
28
+ # @return [ExecutionJsonVellumValue]
29
+ def self.from_json(json_object:)
30
+ struct = JSON.parse(json_object, object_class: OpenStruct)
31
+ JSON.parse(json_object)
32
+ id = struct.id
33
+ name = struct.name
34
+ value = struct.value
35
+ new(id: id, name: name, value: value, additional_properties: struct)
36
+ end
37
+
38
+ # Serialize an instance of ExecutionJsonVellumValue to a JSON object
39
+ #
40
+ # @return [JSON]
41
+ def to_json(*_args)
42
+ { "id": @id, "name": @name, "value": @value }.to_json
43
+ end
44
+
45
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
46
+ #
47
+ # @param obj [Object]
48
+ # @return [Void]
49
+ def self.validate_raw(obj:)
50
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
51
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
52
+ obj.value&.is_a?(Hash) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+
5
+ module Vellum
6
+ class ExecutionNumberVellumValue
7
+ attr_reader :id, :name, :value, :additional_properties
8
+
9
+ # @param id [String] The variable's uniquely identifying internal id.
10
+ # @param name [String]
11
+ # @param value [Float]
12
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
13
+ # @return [ExecutionNumberVellumValue]
14
+ def initialize(id:, name:, value: nil, additional_properties: nil)
15
+ # @type [String] The variable's uniquely identifying internal id.
16
+ @id = id
17
+ # @type [String]
18
+ @name = name
19
+ # @type [Float]
20
+ @value = value
21
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
22
+ @additional_properties = additional_properties
23
+ end
24
+
25
+ # Deserialize a JSON object to an instance of ExecutionNumberVellumValue
26
+ #
27
+ # @param json_object [JSON]
28
+ # @return [ExecutionNumberVellumValue]
29
+ def self.from_json(json_object:)
30
+ struct = JSON.parse(json_object, object_class: OpenStruct)
31
+ JSON.parse(json_object)
32
+ id = struct.id
33
+ name = struct.name
34
+ value = struct.value
35
+ new(id: id, name: name, value: value, additional_properties: struct)
36
+ end
37
+
38
+ # Serialize an instance of ExecutionNumberVellumValue to a JSON object
39
+ #
40
+ # @return [JSON]
41
+ def to_json(*_args)
42
+ { "id": @id, "name": @name, "value": @value }.to_json
43
+ end
44
+
45
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
46
+ #
47
+ # @param obj [Object]
48
+ # @return [Void]
49
+ def self.validate_raw(obj:)
50
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
51
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
52
+ obj.value&.is_a?(Float) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "search_result"
4
+ require "json"
5
+
6
+ module Vellum
7
+ class ExecutionSearchResultsVellumValue
8
+ attr_reader :id, :name, :value, :additional_properties
9
+
10
+ # @param id [String] The variable's uniquely identifying internal id.
11
+ # @param name [String]
12
+ # @param value [Array<SearchResult>]
13
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
14
+ # @return [ExecutionSearchResultsVellumValue]
15
+ def initialize(id:, name:, value: nil, additional_properties: nil)
16
+ # @type [String] The variable's uniquely identifying internal id.
17
+ @id = id
18
+ # @type [String]
19
+ @name = name
20
+ # @type [Array<SearchResult>]
21
+ @value = value
22
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
23
+ @additional_properties = additional_properties
24
+ end
25
+
26
+ # Deserialize a JSON object to an instance of ExecutionSearchResultsVellumValue
27
+ #
28
+ # @param json_object [JSON]
29
+ # @return [ExecutionSearchResultsVellumValue]
30
+ def self.from_json(json_object:)
31
+ struct = JSON.parse(json_object, object_class: OpenStruct)
32
+ parsed_json = JSON.parse(json_object)
33
+ id = struct.id
34
+ name = struct.name
35
+ value = parsed_json["value"].map do |v|
36
+ v = v.to_json
37
+ SearchResult.from_json(json_object: v)
38
+ end
39
+ new(id: id, name: name, value: value, additional_properties: struct)
40
+ end
41
+
42
+ # Serialize an instance of ExecutionSearchResultsVellumValue to a JSON object
43
+ #
44
+ # @return [JSON]
45
+ def to_json(*_args)
46
+ { "id": @id, "name": @name, "value": @value }.to_json
47
+ end
48
+
49
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
50
+ #
51
+ # @param obj [Object]
52
+ # @return [Void]
53
+ def self.validate_raw(obj:)
54
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
55
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
56
+ obj.value&.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+
5
+ module Vellum
6
+ class ExecutionStringVellumValue
7
+ attr_reader :id, :name, :value, :additional_properties
8
+
9
+ # @param id [String] The variable's uniquely identifying internal id.
10
+ # @param name [String]
11
+ # @param value [String]
12
+ # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
13
+ # @return [ExecutionStringVellumValue]
14
+ def initialize(id:, name:, value: nil, additional_properties: nil)
15
+ # @type [String] The variable's uniquely identifying internal id.
16
+ @id = id
17
+ # @type [String]
18
+ @name = name
19
+ # @type [String]
20
+ @value = value
21
+ # @type [OpenStruct] Additional properties unmapped to the current class definition
22
+ @additional_properties = additional_properties
23
+ end
24
+
25
+ # Deserialize a JSON object to an instance of ExecutionStringVellumValue
26
+ #
27
+ # @param json_object [JSON]
28
+ # @return [ExecutionStringVellumValue]
29
+ def self.from_json(json_object:)
30
+ struct = JSON.parse(json_object, object_class: OpenStruct)
31
+ JSON.parse(json_object)
32
+ id = struct.id
33
+ name = struct.name
34
+ value = struct.value
35
+ new(id: id, name: name, value: value, additional_properties: struct)
36
+ end
37
+
38
+ # Serialize an instance of ExecutionStringVellumValue to a JSON object
39
+ #
40
+ # @return [JSON]
41
+ def to_json(*_args)
42
+ { "id": @id, "name": @name, "value": @value }.to_json
43
+ end
44
+
45
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
46
+ #
47
+ # @param obj [Object]
48
+ # @return [Void]
49
+ def self.validate_raw(obj:)
50
+ obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
51
+ obj.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
52
+ obj.value&.is_a?(String) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,168 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "json"
4
+ require_relative "execution_string_vellum_value"
5
+ require_relative "execution_number_vellum_value"
6
+ require_relative "execution_json_vellum_value"
7
+ require_relative "execution_chat_history_vellum_value"
8
+ require_relative "execution_search_results_vellum_value"
9
+ require_relative "execution_error_vellum_value"
10
+ require_relative "execution_array_vellum_value"
11
+ require_relative "execution_function_call_vellum_value"
12
+
13
+ module Vellum
14
+ class ExecutionVellumValue
15
+ attr_reader :member, :discriminant
16
+
17
+ private_class_method :new
18
+ alias kind_of? is_a?
19
+ # @param member [Object]
20
+ # @param discriminant [String]
21
+ # @return [ExecutionVellumValue]
22
+ def initialize(member:, discriminant:)
23
+ # @type [Object]
24
+ @member = member
25
+ # @type [String]
26
+ @discriminant = discriminant
27
+ end
28
+
29
+ # Deserialize a JSON object to an instance of ExecutionVellumValue
30
+ #
31
+ # @param json_object [JSON]
32
+ # @return [ExecutionVellumValue]
33
+ def self.from_json(json_object:)
34
+ struct = JSON.parse(json_object, object_class: OpenStruct)
35
+ member = case struct.type
36
+ when "STRING"
37
+ ExecutionStringVellumValue.from_json(json_object: json_object)
38
+ when "NUMBER"
39
+ ExecutionNumberVellumValue.from_json(json_object: json_object)
40
+ when "JSON"
41
+ ExecutionJsonVellumValue.from_json(json_object: json_object)
42
+ when "CHAT_HISTORY"
43
+ ExecutionChatHistoryVellumValue.from_json(json_object: json_object)
44
+ when "SEARCH_RESULTS"
45
+ ExecutionSearchResultsVellumValue.from_json(json_object: json_object)
46
+ when "ERROR"
47
+ ExecutionErrorVellumValue.from_json(json_object: json_object)
48
+ when "ARRAY"
49
+ ExecutionArrayVellumValue.from_json(json_object: json_object)
50
+ when "FUNCTION_CALL"
51
+ ExecutionFunctionCallVellumValue.from_json(json_object: json_object)
52
+ else
53
+ ExecutionStringVellumValue.from_json(json_object: json_object)
54
+ end
55
+ new(member: member, discriminant: struct.type)
56
+ end
57
+
58
+ # For Union Types, to_json functionality is delegated to the wrapped member.
59
+ #
60
+ # @return [JSON]
61
+ def to_json(*_args)
62
+ case @discriminant
63
+ when "STRING"
64
+ { **@member.to_json, type: @discriminant }.to_json
65
+ when "NUMBER"
66
+ { **@member.to_json, type: @discriminant }.to_json
67
+ when "JSON"
68
+ { **@member.to_json, type: @discriminant }.to_json
69
+ when "CHAT_HISTORY"
70
+ { **@member.to_json, type: @discriminant }.to_json
71
+ when "SEARCH_RESULTS"
72
+ { **@member.to_json, type: @discriminant }.to_json
73
+ when "ERROR"
74
+ { **@member.to_json, type: @discriminant }.to_json
75
+ when "ARRAY"
76
+ { **@member.to_json, type: @discriminant }.to_json
77
+ when "FUNCTION_CALL"
78
+ { **@member.to_json, type: @discriminant }.to_json
79
+ else
80
+ { "type": @discriminant, value: @member }.to_json
81
+ end
82
+ @member.to_json
83
+ end
84
+
85
+ # Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
86
+ #
87
+ # @param obj [Object]
88
+ # @return [Void]
89
+ def self.validate_raw(obj:)
90
+ case obj.type
91
+ when "STRING"
92
+ ExecutionStringVellumValue.validate_raw(obj: obj)
93
+ when "NUMBER"
94
+ ExecutionNumberVellumValue.validate_raw(obj: obj)
95
+ when "JSON"
96
+ ExecutionJsonVellumValue.validate_raw(obj: obj)
97
+ when "CHAT_HISTORY"
98
+ ExecutionChatHistoryVellumValue.validate_raw(obj: obj)
99
+ when "SEARCH_RESULTS"
100
+ ExecutionSearchResultsVellumValue.validate_raw(obj: obj)
101
+ when "ERROR"
102
+ ExecutionErrorVellumValue.validate_raw(obj: obj)
103
+ when "ARRAY"
104
+ ExecutionArrayVellumValue.validate_raw(obj: obj)
105
+ when "FUNCTION_CALL"
106
+ ExecutionFunctionCallVellumValue.validate_raw(obj: obj)
107
+ else
108
+ raise("Passed value matched no type within the union, validation failed.")
109
+ end
110
+ end
111
+
112
+ # For Union Types, is_a? functionality is delegated to the wrapped member.
113
+ #
114
+ # @param obj [Object]
115
+ # @return [Boolean]
116
+ def is_a?(obj)
117
+ @member.is_a?(obj)
118
+ end
119
+
120
+ # @param member [ExecutionStringVellumValue]
121
+ # @return [ExecutionVellumValue]
122
+ def self.string(member:)
123
+ new(member: member, discriminant: "STRING")
124
+ end
125
+
126
+ # @param member [ExecutionNumberVellumValue]
127
+ # @return [ExecutionVellumValue]
128
+ def self.number(member:)
129
+ new(member: member, discriminant: "NUMBER")
130
+ end
131
+
132
+ # @param member [ExecutionJsonVellumValue]
133
+ # @return [ExecutionVellumValue]
134
+ def self.json(member:)
135
+ new(member: member, discriminant: "JSON")
136
+ end
137
+
138
+ # @param member [ExecutionChatHistoryVellumValue]
139
+ # @return [ExecutionVellumValue]
140
+ def self.chat_history(member:)
141
+ new(member: member, discriminant: "CHAT_HISTORY")
142
+ end
143
+
144
+ # @param member [ExecutionSearchResultsVellumValue]
145
+ # @return [ExecutionVellumValue]
146
+ def self.search_results(member:)
147
+ new(member: member, discriminant: "SEARCH_RESULTS")
148
+ end
149
+
150
+ # @param member [ExecutionErrorVellumValue]
151
+ # @return [ExecutionVellumValue]
152
+ def self.error(member:)
153
+ new(member: member, discriminant: "ERROR")
154
+ end
155
+
156
+ # @param member [ExecutionArrayVellumValue]
157
+ # @return [ExecutionVellumValue]
158
+ def self.array(member:)
159
+ new(member: member, discriminant: "ARRAY")
160
+ end
161
+
162
+ # @param member [ExecutionFunctionCallVellumValue]
163
+ # @return [ExecutionVellumValue]
164
+ def self.function_call(member:)
165
+ new(member: member, discriminant: "FUNCTION_CALL")
166
+ end
167
+ end
168
+ end
@@ -7,11 +7,12 @@ require "json"
7
7
 
8
8
  module Vellum
9
9
  class PromptTemplateBlockProperties
10
- attr_reader :chat_role, :chat_message_unterminated, :template, :template_type, :function_name,
10
+ attr_reader :chat_role, :chat_message_unterminated, :chat_source, :template, :template_type, :function_name,
11
11
  :function_description, :function_parameters, :function_forced, :blocks, :additional_properties
12
12
 
13
13
  # @param chat_role [CHAT_MESSAGE_ROLE]
14
14
  # @param chat_message_unterminated [Boolean]
15
+ # @param chat_source [String]
15
16
  # @param template [String]
16
17
  # @param template_type [VELLUM_VARIABLE_TYPE]
17
18
  # @param function_name [String]
@@ -21,13 +22,15 @@ module Vellum
21
22
  # @param blocks [Array<PromptTemplateBlock>]
22
23
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
23
24
  # @return [PromptTemplateBlockProperties]
24
- def initialize(chat_role: nil, chat_message_unterminated: nil, template: nil, template_type: nil,
25
+ def initialize(chat_role: nil, chat_message_unterminated: nil, chat_source: nil, template: nil, template_type: nil,
25
26
  function_name: nil, function_description: nil, function_parameters: nil, function_forced: nil, blocks: nil, additional_properties: nil)
26
27
  # @type [CHAT_MESSAGE_ROLE]
27
28
  @chat_role = chat_role
28
29
  # @type [Boolean]
29
30
  @chat_message_unterminated = chat_message_unterminated
30
31
  # @type [String]
32
+ @chat_source = chat_source
33
+ # @type [String]
31
34
  @template = template
32
35
  # @type [VELLUM_VARIABLE_TYPE]
33
36
  @template_type = template_type
@@ -54,6 +57,7 @@ module Vellum
54
57
  parsed_json = JSON.parse(json_object)
55
58
  chat_role = CHAT_MESSAGE_ROLE.key(parsed_json["chat_role"]) || parsed_json["chat_role"]
56
59
  chat_message_unterminated = struct.chat_message_unterminated
60
+ chat_source = struct.chat_source
57
61
  template = struct.template
58
62
  template_type = VELLUM_VARIABLE_TYPE.key(parsed_json["template_type"]) || parsed_json["template_type"]
59
63
  function_name = struct.function_name
@@ -64,8 +68,8 @@ module Vellum
64
68
  v = v.to_json
65
69
  PromptTemplateBlock.from_json(json_object: v)
66
70
  end
67
- new(chat_role: chat_role, chat_message_unterminated: chat_message_unterminated, template: template,
68
- template_type: template_type, function_name: function_name, function_description: function_description, function_parameters: function_parameters, function_forced: function_forced, blocks: blocks, additional_properties: struct)
71
+ new(chat_role: chat_role, chat_message_unterminated: chat_message_unterminated, chat_source: chat_source,
72
+ template: template, template_type: template_type, function_name: function_name, function_description: function_description, function_parameters: function_parameters, function_forced: function_forced, blocks: blocks, additional_properties: struct)
69
73
  end
70
74
 
71
75
  # Serialize an instance of PromptTemplateBlockProperties to a JSON object
@@ -75,6 +79,7 @@ module Vellum
75
79
  {
76
80
  "chat_role": CHAT_MESSAGE_ROLE[@chat_role] || @chat_role,
77
81
  "chat_message_unterminated": @chat_message_unterminated,
82
+ "chat_source": @chat_source,
78
83
  "template": @template,
79
84
  "template_type": VELLUM_VARIABLE_TYPE[@template_type] || @template_type,
80
85
  "function_name": @function_name,
@@ -92,6 +97,7 @@ module Vellum
92
97
  def self.validate_raw(obj:)
93
98
  obj.chat_role&.is_a?(CHAT_MESSAGE_ROLE) != false || raise("Passed value for field obj.chat_role is not the expected type, validation failed.")
94
99
  obj.chat_message_unterminated&.is_a?(Boolean) != false || raise("Passed value for field obj.chat_message_unterminated is not the expected type, validation failed.")
100
+ obj.chat_source&.is_a?(String) != false || raise("Passed value for field obj.chat_source is not the expected type, validation failed.")
95
101
  obj.template&.is_a?(String) != false || raise("Passed value for field obj.template is not the expected type, validation failed.")
96
102
  obj.template_type&.is_a?(VELLUM_VARIABLE_TYPE) != false || raise("Passed value for field obj.template_type is not the expected type, validation failed.")
97
103
  obj.function_name&.is_a?(String) != false || raise("Passed value for field obj.function_name is not the expected type, validation failed.")
@@ -7,11 +7,12 @@ require "json"
7
7
 
8
8
  module Vellum
9
9
  class PromptTemplateBlockPropertiesRequest
10
- attr_reader :chat_role, :chat_message_unterminated, :template, :template_type, :function_name,
10
+ attr_reader :chat_role, :chat_message_unterminated, :chat_source, :template, :template_type, :function_name,
11
11
  :function_description, :function_parameters, :function_forced, :blocks, :additional_properties
12
12
 
13
13
  # @param chat_role [CHAT_MESSAGE_ROLE]
14
14
  # @param chat_message_unterminated [Boolean]
15
+ # @param chat_source [String]
15
16
  # @param template [String]
16
17
  # @param template_type [VELLUM_VARIABLE_TYPE]
17
18
  # @param function_name [String]
@@ -21,13 +22,15 @@ module Vellum
21
22
  # @param blocks [Array<PromptTemplateBlockRequest>]
22
23
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
23
24
  # @return [PromptTemplateBlockPropertiesRequest]
24
- def initialize(chat_role: nil, chat_message_unterminated: nil, template: nil, template_type: nil,
25
+ def initialize(chat_role: nil, chat_message_unterminated: nil, chat_source: nil, template: nil, template_type: nil,
25
26
  function_name: nil, function_description: nil, function_parameters: nil, function_forced: nil, blocks: nil, additional_properties: nil)
26
27
  # @type [CHAT_MESSAGE_ROLE]
27
28
  @chat_role = chat_role
28
29
  # @type [Boolean]
29
30
  @chat_message_unterminated = chat_message_unterminated
30
31
  # @type [String]
32
+ @chat_source = chat_source
33
+ # @type [String]
31
34
  @template = template
32
35
  # @type [VELLUM_VARIABLE_TYPE]
33
36
  @template_type = template_type
@@ -54,6 +57,7 @@ module Vellum
54
57
  parsed_json = JSON.parse(json_object)
55
58
  chat_role = CHAT_MESSAGE_ROLE.key(parsed_json["chat_role"]) || parsed_json["chat_role"]
56
59
  chat_message_unterminated = struct.chat_message_unterminated
60
+ chat_source = struct.chat_source
57
61
  template = struct.template
58
62
  template_type = VELLUM_VARIABLE_TYPE.key(parsed_json["template_type"]) || parsed_json["template_type"]
59
63
  function_name = struct.function_name
@@ -64,8 +68,8 @@ module Vellum
64
68
  v = v.to_json
65
69
  PromptTemplateBlockRequest.from_json(json_object: v)
66
70
  end
67
- new(chat_role: chat_role, chat_message_unterminated: chat_message_unterminated, template: template,
68
- template_type: template_type, function_name: function_name, function_description: function_description, function_parameters: function_parameters, function_forced: function_forced, blocks: blocks, additional_properties: struct)
71
+ new(chat_role: chat_role, chat_message_unterminated: chat_message_unterminated, chat_source: chat_source,
72
+ template: template, template_type: template_type, function_name: function_name, function_description: function_description, function_parameters: function_parameters, function_forced: function_forced, blocks: blocks, additional_properties: struct)
69
73
  end
70
74
 
71
75
  # Serialize an instance of PromptTemplateBlockPropertiesRequest to a JSON object
@@ -75,6 +79,7 @@ module Vellum
75
79
  {
76
80
  "chat_role": CHAT_MESSAGE_ROLE[@chat_role] || @chat_role,
77
81
  "chat_message_unterminated": @chat_message_unterminated,
82
+ "chat_source": @chat_source,
78
83
  "template": @template,
79
84
  "template_type": VELLUM_VARIABLE_TYPE[@template_type] || @template_type,
80
85
  "function_name": @function_name,
@@ -92,6 +97,7 @@ module Vellum
92
97
  def self.validate_raw(obj:)
93
98
  obj.chat_role&.is_a?(CHAT_MESSAGE_ROLE) != false || raise("Passed value for field obj.chat_role is not the expected type, validation failed.")
94
99
  obj.chat_message_unterminated&.is_a?(Boolean) != false || raise("Passed value for field obj.chat_message_unterminated is not the expected type, validation failed.")
100
+ obj.chat_source&.is_a?(String) != false || raise("Passed value for field obj.chat_source is not the expected type, validation failed.")
95
101
  obj.template&.is_a?(String) != false || raise("Passed value for field obj.template is not the expected type, validation failed.")
96
102
  obj.template_type&.is_a?(VELLUM_VARIABLE_TYPE) != false || raise("Passed value for field obj.template_type is not the expected type, validation failed.")
97
103
  obj.function_name&.is_a?(String) != false || raise("Passed value for field obj.function_name is not the expected type, validation failed.")
@@ -5,11 +5,12 @@ require "date"
5
5
  require_relative "workflow_result_event_output_data"
6
6
  require_relative "workflow_event_error"
7
7
  require_relative "workflow_output"
8
+ require_relative "execution_vellum_value"
8
9
  require "json"
9
10
 
10
11
  module Vellum
11
12
  class WorkflowResultEvent
12
- attr_reader :id, :state, :ts, :output, :error, :outputs, :additional_properties
13
+ attr_reader :id, :state, :ts, :output, :error, :outputs, :inputs, :additional_properties
13
14
 
14
15
  # @param id [String]
15
16
  # @param state [WORKFLOW_NODE_RESULT_EVENT_STATE]
@@ -17,9 +18,10 @@ module Vellum
17
18
  # @param output [WorkflowResultEventOutputData]
18
19
  # @param error [WorkflowEventError]
19
20
  # @param outputs [Array<WorkflowOutput>]
21
+ # @param inputs [Array<ExecutionVellumValue>]
20
22
  # @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
21
23
  # @return [WorkflowResultEvent]
22
- def initialize(id:, state:, ts:, output: nil, error: nil, outputs: nil, additional_properties: nil)
24
+ def initialize(id:, state:, ts:, output: nil, error: nil, outputs: nil, inputs: nil, additional_properties: nil)
23
25
  # @type [String]
24
26
  @id = id
25
27
  # @type [WORKFLOW_NODE_RESULT_EVENT_STATE]
@@ -32,6 +34,8 @@ module Vellum
32
34
  @error = error
33
35
  # @type [Array<WorkflowOutput>]
34
36
  @outputs = outputs
37
+ # @type [Array<ExecutionVellumValue>]
38
+ @inputs = inputs
35
39
  # @type [OpenStruct] Additional properties unmapped to the current class definition
36
40
  @additional_properties = additional_properties
37
41
  end
@@ -62,7 +66,12 @@ module Vellum
62
66
  v = v.to_json
63
67
  WorkflowOutput.from_json(json_object: v)
64
68
  end
65
- new(id: id, state: state, ts: ts, output: output, error: error, outputs: outputs, additional_properties: struct)
69
+ inputs = parsed_json["inputs"].map do |v|
70
+ v = v.to_json
71
+ ExecutionVellumValue.from_json(json_object: v)
72
+ end
73
+ new(id: id, state: state, ts: ts, output: output, error: error, outputs: outputs, inputs: inputs,
74
+ additional_properties: struct)
66
75
  end
67
76
 
68
77
  # Serialize an instance of WorkflowResultEvent to a JSON object
@@ -75,7 +84,8 @@ module Vellum
75
84
  "ts": @ts,
76
85
  "output": @output,
77
86
  "error": @error,
78
- "outputs": @outputs
87
+ "outputs": @outputs,
88
+ "inputs": @inputs
79
89
  }.to_json
80
90
  end
81
91
 
@@ -90,6 +100,7 @@ module Vellum
90
100
  obj.output.nil? || WorkflowResultEventOutputData.validate_raw(obj: obj.output)
91
101
  obj.error.nil? || WorkflowEventError.validate_raw(obj: obj.error)
92
102
  obj.outputs&.is_a?(Array) != false || raise("Passed value for field obj.outputs is not the expected type, validation failed.")
103
+ obj.inputs&.is_a?(Array) != false || raise("Passed value for field obj.inputs is not the expected type, validation failed.")
93
104
  end
94
105
  end
95
106
  end
data/lib/vellum_ai.rb CHANGED
@@ -96,11 +96,11 @@ module Vellum
96
96
 
97
97
  # Executes a deployed Workflow and returns its outputs.
98
98
  #
99
+ # @param inputs [Array<Hash>] The list of inputs defined in the Workflow's Deployment with their corresponding values.Request of type Array<WorkflowRequestInputRequest>, as a Hash
99
100
  # @param workflow_deployment_id [String] The ID of the Workflow Deployment. Must provide either this or workflow_deployment_name.
100
101
  # @param workflow_deployment_name [String] The name of the Workflow Deployment. Must provide either this or workflow_deployment_id.
101
102
  # @param release_tag [String] Optionally specify a release tag if you want to pin to a specific release of the Workflow Deployment
102
- # @param inputs [Array<Hash>] The list of inputs defined in the Workflow's Deployment with their corresponding values.Request of type Array<WorkflowRequestInputRequest>, as a Hash
103
- # @param external_id [String] Optionally include a unique identifier for monitoring purposes. Must be unique for a given workflow deployment.
103
+ # @param external_id [String] Optionally include a unique identifier for tracking purposes. Must be unique for a given workflow deployment.
104
104
  # @param request_options [RequestOptions]
105
105
  # @return [ExecuteWorkflowResponse]
106
106
  def execute_workflow(inputs:, workflow_deployment_id: nil, workflow_deployment_name: nil, release_tag: nil,
@@ -111,10 +111,10 @@ module Vellum
111
111
  req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
112
112
  req.body = {
113
113
  **(request_options&.additional_body_parameters || {}),
114
+ inputs: inputs,
114
115
  workflow_deployment_id: workflow_deployment_id,
115
116
  workflow_deployment_name: workflow_deployment_name,
116
117
  release_tag: release_tag,
117
- inputs: inputs,
118
118
  external_id: external_id
119
119
  }.compact
120
120
  req.url "#{@request_client.default_environment[:Predict]}/v1/execute-workflow"
@@ -318,11 +318,11 @@ module Vellum
318
318
 
319
319
  # Executes a deployed Workflow and returns its outputs.
320
320
  #
321
+ # @param inputs [Array<Hash>] The list of inputs defined in the Workflow's Deployment with their corresponding values.Request of type Array<WorkflowRequestInputRequest>, as a Hash
321
322
  # @param workflow_deployment_id [String] The ID of the Workflow Deployment. Must provide either this or workflow_deployment_name.
322
323
  # @param workflow_deployment_name [String] The name of the Workflow Deployment. Must provide either this or workflow_deployment_id.
323
324
  # @param release_tag [String] Optionally specify a release tag if you want to pin to a specific release of the Workflow Deployment
324
- # @param inputs [Array<Hash>] The list of inputs defined in the Workflow's Deployment with their corresponding values.Request of type Array<WorkflowRequestInputRequest>, as a Hash
325
- # @param external_id [String] Optionally include a unique identifier for monitoring purposes. Must be unique for a given workflow deployment.
325
+ # @param external_id [String] Optionally include a unique identifier for tracking purposes. Must be unique for a given workflow deployment.
326
326
  # @param request_options [RequestOptions]
327
327
  # @return [ExecuteWorkflowResponse]
328
328
  def execute_workflow(inputs:, workflow_deployment_id: nil, workflow_deployment_name: nil, release_tag: nil,
@@ -333,10 +333,10 @@ module Vellum
333
333
  req.headers = { **req.headers, **(request_options&.additional_headers || {}) }.compact
334
334
  req.body = {
335
335
  **(request_options&.additional_body_parameters || {}),
336
+ inputs: inputs,
336
337
  workflow_deployment_id: workflow_deployment_id,
337
338
  workflow_deployment_name: workflow_deployment_name,
338
339
  release_tag: release_tag,
339
- inputs: inputs,
340
340
  external_id: external_id
341
341
  }.compact
342
342
  req.url "#{@async_request_client.default_environment[:Predict]}/v1/execute-workflow"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vellum_ai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.10
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vellum
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-07 00:00:00.000000000 Z
11
+ date: 2024-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-http-faraday
@@ -148,6 +148,15 @@ files:
148
148
  - lib/vellum_ai/types/execute_workflow_response.rb
149
149
  - lib/vellum_ai/types/execute_workflow_stream_error_response.rb
150
150
  - lib/vellum_ai/types/execute_workflow_workflow_result_event.rb
151
+ - lib/vellum_ai/types/execution_array_vellum_value.rb
152
+ - lib/vellum_ai/types/execution_chat_history_vellum_value.rb
153
+ - lib/vellum_ai/types/execution_error_vellum_value.rb
154
+ - lib/vellum_ai/types/execution_function_call_vellum_value.rb
155
+ - lib/vellum_ai/types/execution_json_vellum_value.rb
156
+ - lib/vellum_ai/types/execution_number_vellum_value.rb
157
+ - lib/vellum_ai/types/execution_search_results_vellum_value.rb
158
+ - lib/vellum_ai/types/execution_string_vellum_value.rb
159
+ - lib/vellum_ai/types/execution_vellum_value.rb
151
160
  - lib/vellum_ai/types/finish_reason_enum.rb
152
161
  - lib/vellum_ai/types/fulfilled_enum.rb
153
162
  - lib/vellum_ai/types/fulfilled_execute_prompt_event.rb