Class: ElevenlabsClient::Endpoints::AgentsPlatform::Agents
- Inherits:
-
Object
- Object
- ElevenlabsClient::Endpoints::AgentsPlatform::Agents
- Defined in:
- lib/elevenlabs_client/endpoints/agents_platform/agents.rb
Instance Method Summary collapse
-
#calculate_llm_usage(agent_id, **options) ⇒ Hash
POST /v1/convai/agent/agent_id/llm-usage/calculate Calculates expected number of LLM tokens needed for the specified agent Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/calculate-llm-usage.
-
#create(**options) ⇒ Hash
POST /v1/convai/agents/create Create an agent from a config object Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/create.
-
#delete(agent_id) ⇒ Hash
DELETE /v1/convai/agents/agent_id Delete an agent Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/delete.
-
#duplicate(agent_id, **options) ⇒ Hash
POST /v1/convai/agents/agent_id/duplicate Create a new agent by duplicating an existing one Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/duplicate.
-
#get(agent_id) ⇒ Hash
GET /v1/convai/agents/agent_id Retrieve config for an agent Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/get.
-
#initialize(client) ⇒ Agents
constructor
A new instance of Agents.
-
#link(agent_id) ⇒ Hash
GET /v1/convai/agents/agent_id/link Get the current link used to share the agent with others Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/link.
-
#list(**options) ⇒ Hash
GET /v1/convai/agents Returns a list of your agents and their metadata Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/list.
-
#simulate_conversation(agent_id, **options) ⇒ Hash
POST /v1/convai/agents/agent_id/simulate-conversation Run a conversation between the agent and a simulated user Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/simulate-conversation.
-
#simulate_conversation_stream(agent_id, **options, &block) ⇒ Enumerator
POST /v1/convai/agents/agent_id/simulate-conversation/stream Run a conversation between the agent and a simulated user and stream back the response Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/simulate-conversation-stream.
-
#update(agent_id, **options) ⇒ Hash
PATCH /v1/convai/agents/agent_id Patches an Agent settings Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/update.
Constructor Details
#initialize(client) ⇒ Agents
Returns a new instance of Agents.
7 8 9 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/agents.rb', line 7 def initialize(client) @client = client end |
Instance Method Details
#calculate_llm_usage(agent_id, **options) ⇒ Hash
POST /v1/convai/agent/agent_id/llm-usage/calculate Calculates expected number of LLM tokens needed for the specified agent Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/calculate-llm-usage
157 158 159 160 161 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/agents.rb', line 157 def calculate_llm_usage(agent_id, **) endpoint = "/v1/convai/agent/#{agent_id}/llm-usage/calculate" request_body = .compact @client.post(endpoint, request_body) end |
#create(**options) ⇒ Hash
POST /v1/convai/agents/create Create an agent from a config object Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/create
21 22 23 24 25 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/agents.rb', line 21 def create(**) endpoint = "/v1/convai/agents/create" request_body = @client.post(endpoint, request_body) end |
#delete(agent_id) ⇒ Hash
DELETE /v1/convai/agents/agent_id Delete an agent Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/delete
84 85 86 87 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/agents.rb', line 84 def delete(agent_id) endpoint = "/v1/convai/agents/#{agent_id}" @client.delete(endpoint) end |
#duplicate(agent_id, **options) ⇒ Hash
POST /v1/convai/agents/agent_id/duplicate Create a new agent by duplicating an existing one Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/duplicate
97 98 99 100 101 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/agents.rb', line 97 def duplicate(agent_id, **) endpoint = "/v1/convai/agents/#{agent_id}/duplicate" request_body = .compact @client.post(endpoint, request_body) end |
#get(agent_id) ⇒ Hash
GET /v1/convai/agents/agent_id Retrieve config for an agent Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/get
33 34 35 36 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/agents.rb', line 33 def get(agent_id) endpoint = "/v1/convai/agents/#{agent_id}" @client.get(endpoint) end |
#link(agent_id) ⇒ Hash
GET /v1/convai/agents/agent_id/link Get the current link used to share the agent with others Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/link
109 110 111 112 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/agents.rb', line 109 def link(agent_id) endpoint = "/v1/convai/agents/#{agent_id}/link" @client.get(endpoint) end |
#list(**options) ⇒ Hash
GET /v1/convai/agents Returns a list of your agents and their metadata Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/list
49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/agents.rb', line 49 def list(**) endpoint = "/v1/convai/agents" query_params = .compact if query_params.any? query_string = URI.encode_www_form(query_params) endpoint = "#{endpoint}?#{query_string}" end @client.get(endpoint) end |
#simulate_conversation(agent_id, **options) ⇒ Hash
POST /v1/convai/agents/agent_id/simulate-conversation Run a conversation between the agent and a simulated user Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/simulate-conversation
124 125 126 127 128 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/agents.rb', line 124 def simulate_conversation(agent_id, **) endpoint = "/v1/convai/agents/#{agent_id}/simulate-conversation" request_body = @client.post(endpoint, request_body) end |
#simulate_conversation_stream(agent_id, **options, &block) ⇒ Enumerator
POST /v1/convai/agents/agent_id/simulate-conversation/stream Run a conversation between the agent and a simulated user and stream back the response Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/simulate-conversation-stream
141 142 143 144 145 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/agents.rb', line 141 def simulate_conversation_stream(agent_id, **, &block) endpoint = "/v1/convai/agents/#{agent_id}/simulate-conversation/stream" request_body = @client.post_streaming(endpoint, request_body, &block) end |
#update(agent_id, **options) ⇒ Hash
PATCH /v1/convai/agents/agent_id Patches an Agent settings Documentation: https://elevenlabs.io/docs/api-reference/convai/agents/update
72 73 74 75 76 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/agents.rb', line 72 def update(agent_id, **) endpoint = "/v1/convai/agents/#{agent_id}" request_body = .compact @client.patch(endpoint, request_body) end |