Class: ElevenlabsClient::Endpoints::AgentsPlatform::Tools
- Inherits:
-
Object
- Object
- ElevenlabsClient::Endpoints::AgentsPlatform::Tools
- Defined in:
- lib/elevenlabs_client/endpoints/agents_platform/tools.rb
Instance Method Summary collapse
-
#create(tool_config:) ⇒ Hash
POST /v1/convai/tools Add a new tool to the available tools in the workspace Documentation: https://elevenlabs.io/docs/api-reference/convai/tools/create.
-
#delete(tool_id) ⇒ Hash
DELETE /v1/convai/tools/tool_id Delete tool from the workspace Documentation: https://elevenlabs.io/docs/api-reference/convai/tools/delete.
-
#get(tool_id) ⇒ Hash
GET /v1/convai/tools/tool_id Get tool that is available in the workspace Documentation: https://elevenlabs.io/docs/api-reference/convai/tools/get.
-
#get_dependent_agents(tool_id, **options) ⇒ Hash
GET /v1/convai/tools/tool_id/dependent-agents Get a list of agents depending on this tool Documentation: https://elevenlabs.io/docs/api-reference/convai/tools/dependent-agents.
-
#initialize(client) ⇒ Tools
constructor
A new instance of Tools.
-
#list ⇒ Hash
GET /v1/convai/tools Get all available tools in the workspace Documentation: https://elevenlabs.io/docs/api-reference/convai/tools/list.
-
#update(tool_id, tool_config:) ⇒ Hash
PATCH /v1/convai/tools/tool_id Update tool that is available in the workspace Documentation: https://elevenlabs.io/docs/api-reference/convai/tools/update.
Constructor Details
#initialize(client) ⇒ Tools
Returns a new instance of Tools.
7 8 9 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/tools.rb', line 7 def initialize(client) @client = client end |
Instance Method Details
#create(tool_config:) ⇒ Hash
POST /v1/convai/tools Add a new tool to the available tools in the workspace Documentation: https://elevenlabs.io/docs/api-reference/convai/tools/create
46 47 48 49 50 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/tools.rb', line 46 def create(tool_config:) endpoint = "/v1/convai/tools" request_body = { tool_config: tool_config } @client.post(endpoint, request_body) end |
#delete(tool_id) ⇒ Hash
DELETE /v1/convai/tools/tool_id Delete tool from the workspace Documentation: https://elevenlabs.io/docs/api-reference/convai/tools/delete
79 80 81 82 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/tools.rb', line 79 def delete(tool_id) endpoint = "/v1/convai/tools/#{tool_id}" @client.delete(endpoint) end |
#get(tool_id) ⇒ Hash
GET /v1/convai/tools/tool_id Get tool that is available in the workspace Documentation: https://elevenlabs.io/docs/api-reference/convai/tools/get
27 28 29 30 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/tools.rb', line 27 def get(tool_id) endpoint = "/v1/convai/tools/#{tool_id}" @client.get(endpoint) end |
#get_dependent_agents(tool_id, **options) ⇒ Hash
GET /v1/convai/tools/tool_id/dependent-agents Get a list of agents depending on this tool Documentation: https://elevenlabs.io/docs/api-reference/convai/tools/dependent-agents
93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/tools.rb', line 93 def get_dependent_agents(tool_id, **) endpoint = "/v1/convai/tools/#{tool_id}/dependent-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 |
#list ⇒ Hash
GET /v1/convai/tools Get all available tools in the workspace Documentation: https://elevenlabs.io/docs/api-reference/convai/tools/list
16 17 18 19 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/tools.rb', line 16 def list endpoint = "/v1/convai/tools" @client.get(endpoint) end |
#update(tool_id, tool_config:) ⇒ Hash
PATCH /v1/convai/tools/tool_id Update tool that is available in the workspace Documentation: https://elevenlabs.io/docs/api-reference/convai/tools/update
67 68 69 70 71 |
# File 'lib/elevenlabs_client/endpoints/agents_platform/tools.rb', line 67 def update(tool_id, tool_config:) endpoint = "/v1/convai/tools/#{tool_id}" request_body = { tool_config: tool_config } @client.patch(endpoint, request_body) end |