Class: Vellum::PromptDeploymentParentContext

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent: OMIT, links: OMIT, type:, span_id:, deployment_id:, deployment_name:, deployment_history_item_id:, release_tag_id:, release_tag_name:, external_id: OMIT, metadata: OMIT, prompt_version_id:, additional_properties: nil) ⇒ Vellum::PromptDeploymentParentContext

Parameters:

  • parent (Vellum::ParentContext) (defaults to: OMIT)
  • links (Array<Vellum::SpanLink>) (defaults to: OMIT)
  • type (String)
  • span_id (String)
  • deployment_id (String)
  • deployment_name (String)
  • deployment_history_item_id (String)
  • release_tag_id (String)
  • release_tag_name (String)
  • external_id (String) (defaults to: OMIT)
  • metadata (Hash{String => Object}) (defaults to: OMIT)
  • prompt_version_id (String)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/vellum_ai/types/prompt_deployment_parent_context.rb', line 55

def initialize(parent: OMIT, links: OMIT, type:, span_id:, deployment_id:, deployment_name:, deployment_history_item_id:, release_tag_id:, release_tag_name:, external_id: OMIT, metadata: OMIT, prompt_version_id:, additional_properties: nil)
  @parent = parent if parent != OMIT
  @links = links if links != OMIT
  @type = type
  @span_id = span_id
  @deployment_id = deployment_id
  @deployment_name = deployment_name
  @deployment_history_item_id = deployment_history_item_id
  @release_tag_id = release_tag_id
  @release_tag_name = release_tag_name
  @external_id = external_id if external_id != OMIT
  @metadata =  if  != OMIT
  @prompt_version_id = prompt_version_id
  @additional_properties = additional_properties
  @_field_set = { "parent": parent, "links": links, "type": type, "span_id": span_id, "deployment_id": deployment_id, "deployment_name": deployment_name, "deployment_history_item_id": deployment_history_item_id, "release_tag_id": release_tag_id, "release_tag_name": release_tag_name, "external_id": external_id, "metadata": , "prompt_version_id": prompt_version_id }.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



34
35
36
# File 'lib/vellum_ai/types/prompt_deployment_parent_context.rb', line 34

def additional_properties
  @additional_properties
end

#deployment_history_item_idString (readonly)

Returns:

  • (String)


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

def deployment_history_item_id
  @deployment_history_item_id
end

#deployment_idString (readonly)

Returns:

  • (String)


18
19
20
# File 'lib/vellum_ai/types/prompt_deployment_parent_context.rb', line 18

def deployment_id
  @deployment_id
end

#deployment_nameString (readonly)

Returns:

  • (String)


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

def deployment_name
  @deployment_name
end

#external_idString (readonly)

Returns:

  • (String)


28
29
30
# File 'lib/vellum_ai/types/prompt_deployment_parent_context.rb', line 28

def external_id
  @external_id
end

Returns:



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

def links
  @links
end

#metadataHash{String => Object} (readonly)

Returns:

  • (Hash{String => Object})


30
31
32
# File 'lib/vellum_ai/types/prompt_deployment_parent_context.rb', line 30

def 
  @metadata
end

#parentVellum::ParentContext (readonly)



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

def parent
  @parent
end

#prompt_version_idString (readonly)

Returns:

  • (String)


32
33
34
# File 'lib/vellum_ai/types/prompt_deployment_parent_context.rb', line 32

def prompt_version_id
  @prompt_version_id
end

#release_tag_idString (readonly)

Returns:

  • (String)


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

def release_tag_id
  @release_tag_id
end

#release_tag_nameString (readonly)

Returns:

  • (String)


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

def release_tag_name
  @release_tag_name
end

#span_idString (readonly)

Returns:

  • (String)


16
17
18
# File 'lib/vellum_ai/types/prompt_deployment_parent_context.rb', line 16

def span_id
  @span_id
end

#typeString (readonly)

Returns:

  • (String)


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

def type
  @type
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::PromptDeploymentParentContext

Parameters:

  • json_object (String)

Returns:



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/vellum_ai/types/prompt_deployment_parent_context.rb', line 77

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  unless parsed_json["parent"].nil?
    parent = parsed_json["parent"].to_json
    parent = Vellum::ParentContext.from_json(json_object: parent)
  else
    parent = nil
  end
  links = parsed_json["links"]&.map do | item |
  item = item.to_json
  Vellum::SpanLink.from_json(json_object: item)
end
  type = parsed_json["type"]
  span_id = parsed_json["span_id"]
  deployment_id = parsed_json["deployment_id"]
  deployment_name = parsed_json["deployment_name"]
  deployment_history_item_id = parsed_json["deployment_history_item_id"]
  release_tag_id = parsed_json["release_tag_id"]
  release_tag_name = parsed_json["release_tag_name"]
  external_id = parsed_json["external_id"]
   = parsed_json["metadata"]
  prompt_version_id = parsed_json["prompt_version_id"]
  new(
    parent: parent,
    links: links,
    type: type,
    span_id: span_id,
    deployment_id: deployment_id,
    deployment_name: deployment_name,
    deployment_history_item_id: deployment_history_item_id,
    release_tag_id: release_tag_id,
    release_tag_name: release_tag_name,
    external_id: external_id,
    metadata: ,
    prompt_version_id: prompt_version_id,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/vellum_ai/types/prompt_deployment_parent_context.rb', line 128

def self.validate_raw(obj:)
  obj.parent.nil? || Vellum::ParentContext.validate_raw(obj: obj.parent)
  obj.links&.is_a?(Array) != false || raise("Passed value for field obj.links 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.span_id.is_a?(String) != false || raise("Passed value for field obj.span_id is not the expected type, validation failed.")
  obj.deployment_id.is_a?(String) != false || raise("Passed value for field obj.deployment_id is not the expected type, validation failed.")
  obj.deployment_name.is_a?(String) != false || raise("Passed value for field obj.deployment_name is not the expected type, validation failed.")
  obj.deployment_history_item_id.is_a?(String) != false || raise("Passed value for field obj.deployment_history_item_id is not the expected type, validation failed.")
  obj.release_tag_id.is_a?(String) != false || raise("Passed value for field obj.release_tag_id is not the expected type, validation failed.")
  obj.release_tag_name.is_a?(String) != false || raise("Passed value for field obj.release_tag_name is not the expected type, validation failed.")
  obj.external_id&.is_a?(String) != false || raise("Passed value for field obj.external_id is not the expected type, validation failed.")
  obj.&.is_a?(Hash) != false || raise("Passed value for field obj.metadata is not the expected type, validation failed.")
  obj.prompt_version_id.is_a?(String) != false || raise("Passed value for field obj.prompt_version_id is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


119
120
121
# File 'lib/vellum_ai/types/prompt_deployment_parent_context.rb', line 119

def to_json
  @_field_set&.to_json
end