Class: ElevenlabsClient::Endpoints::AgentsPlatform::Tests
- Inherits:
-
Object
- Object
- ElevenlabsClient::Endpoints::AgentsPlatform::Tests
- Defined in:
- lib/elevenlabs_client/endpoints/agents_platform/tests.rb
Instance Method Summary collapse
-
#create(name:, chat_history:, success_condition:, success_examples:, failure_examples:, **options) ⇒ Hash
POST /v1/convai/agent-testing/create Creates a new agent response test Documentation: https://elevenlabs.io/docs/api-reference/convai/agent-testing/create.
-
#delete(test_id) ⇒ Hash
DELETE /v1/convai/agent-testing/test_id Deletes an agent response test by ID Documentation: https://elevenlabs.io/docs/api-reference/convai/agent-testing/delete.
-
#get(test_id) ⇒ Hash
GET /v1/convai/agent-testing/test_id Gets an agent response test by ID Documentation: https://elevenlabs.io/docs/api-reference/convai/agent-testing/get.
-
#get_summaries(test_ids) ⇒ Hash
POST /v1/convai/agent-testing/summaries Gets multiple agent response tests by their IDs Documentation: https://elevenlabs.io/docs/api-reference/convai/agent-testing/summaries.
-
#initialize(client) ⇒ Tests
constructor
A new instance of Tests.
-
#list(**options) ⇒ Hash
GET /v1/convai/agent-testing Lists all agent response tests with pagination support and optional search filtering Documentation: https://elevenlabs.io/docs/api-reference/convai/agent-testing/list.
-
#run_on_agent(agent_id, tests:, **options) ⇒ Hash
POST /v1/convai/agents/agent_id/run-tests Run selected tests on the agent with provided configuration Documentation: https://elevenlabs.io/docs/api-reference/convai/agent-testing/run-tests.
-
#update(test_id, name:, chat_history:, success_condition:, success_examples:, failure_examples:, **options) ⇒ Hash
PUT /v1/convai/agent-testing/test_id Updates an agent response test by ID Documentation: https://elevenlabs.io/docs/api-reference/convai/agent-testing/update.
Constructor Details
#initialize(client) ⇒ Tests
Returns a new instance of Tests.
7 8 9 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/tests.rb', line 7 def initialize(client) @client = client end |
Instance Method Details
#create(name:, chat_history:, success_condition:, success_examples:, failure_examples:, **options) ⇒ Hash
POST /v1/convai/agent-testing/create Creates a new agent response test Documentation: https://elevenlabs.io/docs/api-reference/convai/agent-testing/create
57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/tests.rb', line 57 def create(name:, chat_history:, success_condition:, success_examples:, failure_examples:, **) endpoint = "/v1/convai/agent-testing/create" request_body = { name: name, chat_history: chat_history, success_condition: success_condition, success_examples: success_examples, failure_examples: failure_examples }.merge() @client.post(endpoint, request_body) end |
#delete(test_id) ⇒ Hash
DELETE /v1/convai/agent-testing/test_id Deletes an agent response test by ID Documentation: https://elevenlabs.io/docs/api-reference/convai/agent-testing/delete
104 105 106 107 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/tests.rb', line 104 def delete(test_id) endpoint = "/v1/convai/agent-testing/#{test_id}" @client.delete(endpoint) end |
#get(test_id) ⇒ Hash
GET /v1/convai/agent-testing/test_id Gets an agent response test by ID Documentation: https://elevenlabs.io/docs/api-reference/convai/agent-testing/get
38 39 40 41 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/tests.rb', line 38 def get(test_id) endpoint = "/v1/convai/agent-testing/#{test_id}" @client.get(endpoint) end |
#get_summaries(test_ids) ⇒ Hash
POST /v1/convai/agent-testing/summaries Gets multiple agent response tests by their IDs Documentation: https://elevenlabs.io/docs/api-reference/convai/agent-testing/summaries
115 116 117 118 119 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/tests.rb', line 115 def get_summaries(test_ids) endpoint = "/v1/convai/agent-testing/summaries" request_body = { test_ids: test_ids } @client.post(endpoint, request_body) end |
#list(**options) ⇒ Hash
GET /v1/convai/agent-testing Lists all agent response tests with pagination support and optional search filtering Documentation: https://elevenlabs.io/docs/api-reference/convai/agent-testing/list
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/tests.rb', line 20 def list(**) endpoint = "/v1/convai/agent-testing" query_params = .compact if query_params.any? query_string = URI.encode_www_form(query_params) endpoint = "#{endpoint}?#{query_string}" end @client.get(endpoint) end |
#run_on_agent(agent_id, tests:, **options) ⇒ Hash
POST /v1/convai/agents/agent_id/run-tests Run selected tests on the agent with provided configuration Documentation: https://elevenlabs.io/docs/api-reference/convai/agent-testing/run-tests
130 131 132 133 134 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/tests.rb', line 130 def run_on_agent(agent_id, tests:, **) endpoint = "/v1/convai/agents/#{agent_id}/run-tests" request_body = { tests: tests }.merge() @client.post(endpoint, request_body) end |
#update(test_id, name:, chat_history:, success_condition:, success_examples:, failure_examples:, **options) ⇒ Hash
PUT /v1/convai/agent-testing/test_id Updates an agent response test by ID Documentation: https://elevenlabs.io/docs/api-reference/convai/agent-testing/update
85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/tests.rb', line 85 def update(test_id, name:, chat_history:, success_condition:, success_examples:, failure_examples:, **) endpoint = "/v1/convai/agent-testing/#{test_id}" request_body = { name: name, chat_history: chat_history, success_condition: success_condition, success_examples: success_examples, failure_examples: failure_examples }.merge() @client.patch(endpoint, request_body) end |