Class: ElevenlabsClient::Endpoints::AgentsPlatform::Conversations
- Inherits:
-
Object
- Object
- ElevenlabsClient::Endpoints::AgentsPlatform::Conversations
- Defined in:
- lib/elevenlabs_client/endpoints/agents_platform/conversations.rb
Instance Method Summary collapse
-
#delete(conversation_id) ⇒ Hash
DELETE /v1/convai/conversations/conversation_id Delete a particular conversation Documentation: https://elevenlabs.io/docs/api-reference/convai/conversations/delete.
-
#get(conversation_id) ⇒ Hash
GET /v1/convai/conversations/conversation_id Get the details of a particular conversation Documentation: https://elevenlabs.io/docs/api-reference/convai/conversations/get.
-
#get_audio(conversation_id) ⇒ String
GET /v1/convai/conversations/conversation_id/audio Get the audio recording of a particular conversation Documentation: https://elevenlabs.io/docs/api-reference/convai/conversations/audio.
-
#get_signed_url(agent_id, **options) ⇒ Hash
GET /v1/convai/conversation/get-signed-url Get a signed url to start a conversation with an agent that requires authorization Documentation: https://elevenlabs.io/docs/api-reference/convai/conversations/get-signed-url.
-
#get_token(agent_id, **options) ⇒ Hash
GET /v1/convai/conversation/token Get a WebRTC session token for real-time communication Documentation: https://elevenlabs.io/docs/api-reference/convai/conversations/token.
-
#initialize(client) ⇒ Conversations
constructor
A new instance of Conversations.
-
#list(**options) ⇒ Hash
GET /v1/convai/conversations Get all conversations of agents that user owns Documentation: https://elevenlabs.io/docs/api-reference/convai/conversations/list.
-
#send_feedback(conversation_id, feedback) ⇒ Hash
POST /v1/convai/conversations/conversation_id/feedback Send the feedback for the given conversation Documentation: https://elevenlabs.io/docs/api-reference/convai/conversations/feedback.
Constructor Details
#initialize(client) ⇒ Conversations
Returns a new instance of Conversations.
7 8 9 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/conversations.rb', line 7 def initialize(client) @client = client end |
Instance Method Details
#delete(conversation_id) ⇒ Hash
DELETE /v1/convai/conversations/conversation_id Delete a particular conversation Documentation: https://elevenlabs.io/docs/api-reference/convai/conversations/delete
54 55 56 57 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/conversations.rb', line 54 def delete(conversation_id) endpoint = "/v1/convai/conversations/#{conversation_id}" @client.delete(endpoint) end |
#get(conversation_id) ⇒ Hash
GET /v1/convai/conversations/conversation_id Get the details of a particular conversation Documentation: https://elevenlabs.io/docs/api-reference/convai/conversations/get
43 44 45 46 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/conversations.rb', line 43 def get(conversation_id) endpoint = "/v1/convai/conversations/#{conversation_id}" @client.get(endpoint) end |
#get_audio(conversation_id) ⇒ String
GET /v1/convai/conversations/conversation_id/audio Get the audio recording of a particular conversation Documentation: https://elevenlabs.io/docs/api-reference/convai/conversations/audio
65 66 67 68 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/conversations.rb', line 65 def get_audio(conversation_id) endpoint = "/v1/convai/conversations/#{conversation_id}/audio" @client.get_binary(endpoint) end |
#get_signed_url(agent_id, **options) ⇒ Hash
GET /v1/convai/conversation/get-signed-url Get a signed url to start a conversation with an agent that requires authorization Documentation: https://elevenlabs.io/docs/api-reference/convai/conversations/get-signed-url
78 79 80 81 82 83 84 85 86 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/conversations.rb', line 78 def get_signed_url(agent_id, **) endpoint = "/v1/convai/conversation/get-signed-url" query_params = { agent_id: agent_id }.merge(.compact) query_string = URI.encode_www_form(query_params) endpoint_with_query = "#{endpoint}?#{query_string}" @client.get(endpoint_with_query) end |
#get_token(agent_id, **options) ⇒ Hash
GET /v1/convai/conversation/token Get a WebRTC session token for real-time communication Documentation: https://elevenlabs.io/docs/api-reference/convai/conversations/token
96 97 98 99 100 101 102 103 104 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/conversations.rb', line 96 def get_token(agent_id, **) endpoint = "/v1/convai/conversation/token" query_params = { agent_id: agent_id }.merge(.compact) query_string = URI.encode_www_form(query_params) endpoint_with_query = "#{endpoint}?#{query_string}" @client.get(endpoint_with_query) end |
#list(**options) ⇒ Hash
GET /v1/convai/conversations Get all conversations of agents that user owns Documentation: https://elevenlabs.io/docs/api-reference/convai/conversations/list
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/conversations.rb', line 25 def list(**) endpoint = "/v1/convai/conversations" query_params = .compact if query_params.any? query_string = URI.encode_www_form(query_params) endpoint = "#{endpoint}?#{query_string}" end @client.get(endpoint) end |
#send_feedback(conversation_id, feedback) ⇒ Hash
POST /v1/convai/conversations/conversation_id/feedback Send the feedback for the given conversation Documentation: https://elevenlabs.io/docs/api-reference/convai/conversations/feedback
113 114 115 116 117 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/conversations.rb', line 113 def send_feedback(conversation_id, feedback) endpoint = "/v1/convai/conversations/#{conversation_id}/feedback" request_body = { feedback: feedback } @client.post(endpoint, request_body) end |