Class: Google::Apis::DialogflowV3beta1::GoogleCloudDialogflowCxV3beta1LlmCallTokenCount

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/dialogflow_v3beta1/classes.rb,
lib/google/apis/dialogflow_v3beta1/representations.rb,
lib/google/apis/dialogflow_v3beta1/representations.rb

Overview

Stores token counts of the LLM call.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDialogflowCxV3beta1LlmCallTokenCount

Returns a new instance of GoogleCloudDialogflowCxV3beta1LlmCallTokenCount.



10969
10970
10971
# File 'lib/google/apis/dialogflow_v3beta1/classes.rb', line 10969

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#conversation_context_token_countFixnum

The number of tokens used for the conversation history in the prompt. Corresponds to the JSON property conversationContextTokenCount

Returns:

  • (Fixnum)


10952
10953
10954
# File 'lib/google/apis/dialogflow_v3beta1/classes.rb', line 10952

def conversation_context_token_count
  @conversation_context_token_count
end

#example_token_countFixnum

The number of tokens used for the retrieved examples in the prompt. Corresponds to the JSON property exampleTokenCount

Returns:

  • (Fixnum)


10957
10958
10959
# File 'lib/google/apis/dialogflow_v3beta1/classes.rb', line 10957

def example_token_count
  @example_token_count
end

#total_input_token_countFixnum

The total number of tokens used for the input to the LLM call. Corresponds to the JSON property totalInputTokenCount

Returns:

  • (Fixnum)


10962
10963
10964
# File 'lib/google/apis/dialogflow_v3beta1/classes.rb', line 10962

def total_input_token_count
  @total_input_token_count
end

#total_output_token_countFixnum

The total number of tokens used for the output of the LLM call. Corresponds to the JSON property totalOutputTokenCount

Returns:

  • (Fixnum)


10967
10968
10969
# File 'lib/google/apis/dialogflow_v3beta1/classes.rb', line 10967

def total_output_token_count
  @total_output_token_count
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



10974
10975
10976
10977
10978
10979
# File 'lib/google/apis/dialogflow_v3beta1/classes.rb', line 10974

def update!(**args)
  @conversation_context_token_count = args[:conversation_context_token_count] if args.key?(:conversation_context_token_count)
  @example_token_count = args[:example_token_count] if args.key?(:example_token_count)
  @total_input_token_count = args[:total_input_token_count] if args.key?(:total_input_token_count)
  @total_output_token_count = args[:total_output_token_count] if args.key?(:total_output_token_count)
end