Class: ElevenlabsClient::Endpoints::AgentsPlatform::LlmUsage
- Inherits:
-
Object
- Object
- ElevenlabsClient::Endpoints::AgentsPlatform::LlmUsage
- Defined in:
- lib/elevenlabs_client/endpoints/agents_platform/llm_usage.rb
Overview
LLM Usage endpoint - refactored for better maintainability
Instance Method Summary collapse
-
#calculate(prompt_length:, number_of_pages:, rag_enabled:) ⇒ Hash
(also: #calculate_usage)
POST /v1/convai/llm-usage/calculate Returns a list of LLM models and the expected cost for using them based on the provided values Documentation: https://elevenlabs.io/docs/api-reference/convai/llm-usage/calculate.
-
#initialize(client) ⇒ LlmUsage
constructor
A new instance of LlmUsage.
Constructor Details
#initialize(client) ⇒ LlmUsage
Returns a new instance of LlmUsage.
8 9 10 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/llm_usage.rb', line 8 def initialize(client) @client = client end |
Instance Method Details
#calculate(prompt_length:, number_of_pages:, rag_enabled:) ⇒ Hash Also known as: calculate_usage
POST /v1/convai/llm-usage/calculate Returns a list of LLM models and the expected cost for using them based on the provided values Documentation: https://elevenlabs.io/docs/api-reference/convai/llm-usage/calculate
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/llm_usage.rb', line 20 def calculate(prompt_length:, number_of_pages:, rag_enabled:) validate_required!(:prompt_length, prompt_length) validate_required!(:number_of_pages, number_of_pages) validate_required!(:rag_enabled, rag_enabled) body = { prompt_length: prompt_length, number_of_pages: number_of_pages, rag_enabled: rag_enabled } @client.post("/v1/convai/llm-usage/calculate", body) end |