Class: Vapi::LangfuseObservabilityPlan

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/types/langfuse_observability_plan.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(provider:, tags:, metadata: OMIT, additional_properties: nil) ⇒ Vapi::LangfuseObservabilityPlan

Parameters:

  • provider (String)
  • tags (Array<String>)

    This is an array of tags to be added to the Langfuse trace. Tags allow you to categorize and filter traces. langfuse.com/docs/tracing-features/tags

  • metadata (Hash{String => Object}) (defaults to: OMIT)

    This is a JSON object that will be added to the Langfuse trace. Traces can be enriched with metadata to better understand your users, application, and experiments. langfuse.com/docs/tracing-features/metadata By default it includes the call metadata, assistant metadata, and assistant overrides.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



37
38
39
40
41
42
43
44
45
# File 'lib/vapi_server_sdk/types/langfuse_observability_plan.rb', line 37

def initialize(provider:, tags:, metadata: OMIT, additional_properties: nil)
  @provider = provider
  @tags = tags
  @metadata =  if  != OMIT
  @additional_properties = additional_properties
  @_field_set = { "provider": provider, "tags": tags, "metadata":  }.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



20
21
22
# File 'lib/vapi_server_sdk/types/langfuse_observability_plan.rb', line 20

def additional_properties
  @additional_properties
end

#metadataHash{String => Object} (readonly)

Returns This is a JSON object that will be added to the Langfuse trace. Traces can be enriched with metadata to better understand your users, application, and experiments. langfuse.com/docs/tracing-features/metadata By default it includes the call metadata, assistant metadata, and assistant overrides.

Returns:

  • (Hash{String => Object})

    This is a JSON object that will be added to the Langfuse trace. Traces can be enriched with metadata to better understand your users, application, and experiments. langfuse.com/docs/tracing-features/metadata By default it includes the call metadata, assistant metadata, and assistant overrides.



18
19
20
# File 'lib/vapi_server_sdk/types/langfuse_observability_plan.rb', line 18

def 
  @metadata
end

#providerString (readonly)

Returns:

  • (String)


9
10
11
# File 'lib/vapi_server_sdk/types/langfuse_observability_plan.rb', line 9

def provider
  @provider
end

#tagsArray<String> (readonly)

Returns This is an array of tags to be added to the Langfuse trace. Tags allow you to categorize and filter traces. langfuse.com/docs/tracing-features/tags.

Returns:



12
13
14
# File 'lib/vapi_server_sdk/types/langfuse_observability_plan.rb', line 12

def tags
  @tags
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::LangfuseObservabilityPlan

Deserialize a JSON object to an instance of LangfuseObservabilityPlan

Parameters:

  • json_object (String)

Returns:



51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/vapi_server_sdk/types/langfuse_observability_plan.rb', line 51

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  provider = parsed_json["provider"]
  tags = parsed_json["tags"]
   = parsed_json["metadata"]
  new(
    provider: provider,
    tags: tags,
    metadata: ,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


78
79
80
81
82
# File 'lib/vapi_server_sdk/types/langfuse_observability_plan.rb', line 78

def self.validate_raw(obj:)
  obj.provider.is_a?(String) != false || raise("Passed value for field obj.provider is not the expected type, validation failed.")
  obj.tags.is_a?(Array) != false || raise("Passed value for field obj.tags 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.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of LangfuseObservabilityPlan to a JSON object

Returns:

  • (String)


68
69
70
# File 'lib/vapi_server_sdk/types/langfuse_observability_plan.rb', line 68

def to_json(*_args)
  @_field_set&.to_json
end