Class: Vellum::PromptDeploymentReleasePromptVersion

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, ml_model_to_workspace_id:, build_config:, additional_properties: nil) ⇒ Vellum::PromptDeploymentReleasePromptVersion

Parameters:



28
29
30
31
32
33
34
# File 'lib/vellum_ai/types/prompt_deployment_release_prompt_version.rb', line 28

def initialize(id:, ml_model_to_workspace_id:, build_config:, additional_properties: nil)
  @id = id
  @ml_model_to_workspace_id = ml_model_to_workspace_id
  @build_config = build_config
  @additional_properties = additional_properties
  @_field_set = { "id": id, "ml_model_to_workspace_id": ml_model_to_workspace_id, "build_config": build_config }
end

Instance Attribute Details

#additional_properties ⇒ OpenStruct (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/prompt_deployment_release_prompt_version.rb', line 16

def additional_properties
  @additional_properties
end

#build_config ⇒ Vellum::COMPONENTS_SCHEMAS_PROMPT_VERSION_BUILD_CONFIG_SANDBOX (readonly)

Returns Configuration used to build this prompt version.

Returns:



14
15
16
# File 'lib/vellum_ai/types/prompt_deployment_release_prompt_version.rb', line 14

def build_config
  @build_config
end

#id ⇒ String (readonly)

Returns:

  • (String)


10
11
12
# File 'lib/vellum_ai/types/prompt_deployment_release_prompt_version.rb', line 10

def id
  @id
end

#ml_model_to_workspace_id ⇒ String (readonly)

Returns:

  • (String)


12
13
14
# File 'lib/vellum_ai/types/prompt_deployment_release_prompt_version.rb', line 12

def ml_model_to_workspace_id
  @ml_model_to_workspace_id
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::PromptDeploymentReleasePromptVersion

Parameters:

  • json_object (String)

Returns:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/vellum_ai/types/prompt_deployment_release_prompt_version.rb', line 39

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  ml_model_to_workspace_id = parsed_json["ml_model_to_workspace_id"]
  unless parsed_json["build_config"].nil?
    build_config = parsed_json["build_config"].to_json
    build_config = Vellum::PromptVersionBuildConfigSandbox.from_json(json_object: build_config)
  else
    build_config = nil
  end
  new(
    id: id,
    ml_model_to_workspace_id: ml_model_to_workspace_id,
    build_config: build_config,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


69
70
71
72
73
# File 'lib/vellum_ai/types/prompt_deployment_release_prompt_version.rb', line 69

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.ml_model_to_workspace_id.is_a?(String) != false || raise("Passed value for field obj.ml_model_to_workspace_id is not the expected type, validation failed.")
  Vellum::PromptVersionBuildConfigSandbox.validate_raw(obj: obj.build_config)
end

Instance Method Details

#to_json ⇒ String

Returns:

  • (String)


60
61
62
# File 'lib/vellum_ai/types/prompt_deployment_release_prompt_version.rb', line 60

def to_json
  @_field_set&.to_json
end