Class: Algolia::AgentStudioClient
- Inherits:
-
Object
- Object
- Algolia::AgentStudioClient
- Defined in:
- lib/algolia/api/agent_studio_client.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Class Method Summary collapse
Instance Method Summary collapse
- #add_user_agent_segment(segment, version = nil) ⇒ Object
-
#bulk_create_allowed_domains(agent_id, allowed_domain_bulk_insert, request_options = {}) ⇒ AllowedDomainListResponse
Add multiple allowed domain patterns.
-
#bulk_create_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_insert, request_options = {}) ⇒ Http::Response
Add multiple allowed domain patterns.
-
#bulk_delete_allowed_domains(agent_id, allowed_domain_bulk_delete, request_options = {}) ⇒ nil
Delete allowed domains by id list.
-
#bulk_delete_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_delete, request_options = {}) ⇒ Http::Response
Delete allowed domains by id list.
-
#create_agent(agent_config_create, request_options = {}) ⇒ AgentWithVersionResponse
Create a new agent.
-
#create_agent_allowed_domain(agent_id, allowed_domain_create, request_options = {}) ⇒ AllowedDomainResponse
Add a single allowed domain pattern (e.g. app.example.com or *.example.com).
-
#create_agent_allowed_domain_with_http_info(agent_id, allowed_domain_create, request_options = {}) ⇒ Http::Response
Add a single allowed domain pattern (e.g. app.example.com or *.example.com).
-
#create_agent_completion(agent_id, compatibility_mode, agent_completion_request, stream = nil, cache = nil, memory = nil, analytics = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ Hash<String, Object>
Create a completion for the specified agent.
-
#create_agent_completion_with_http_info(agent_id, compatibility_mode, agent_completion_request, stream = nil, cache = nil, memory = nil, analytics = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ Http::Response
Create a completion for the specified agent.
-
#create_agent_with_http_info(agent_config_create, request_options = {}) ⇒ Http::Response
Create a new agent.
-
#create_feedback(feedback_creation_request, request_options = {}) ⇒ FeedbackResponse
Create new feedback entry.
-
#create_feedback_with_http_info(feedback_creation_request, request_options = {}) ⇒ Http::Response
Create new feedback entry.
-
#create_provider(provider_authentication_create, request_options = {}) ⇒ ProviderAuthenticationResponse
Create Provider.
-
#create_provider_with_http_info(provider_authentication_create, request_options = {}) ⇒ Http::Response
Create Provider.
-
#create_secret_key(secret_key_create, request_options = {}) ⇒ SecretKeyResponse
Create Secret Key.
-
#create_secret_key_with_http_info(secret_key_create, request_options = {}) ⇒ Http::Response
Create Secret Key.
- #custom_delete(path, parameters = nil, request_options = {}) ⇒ Object
-
#custom_delete_with_http_info(path, parameters = nil, request_options = {}) ⇒ Http::Response
The response.
- #custom_get(path, parameters = nil, request_options = {}) ⇒ Object
-
#custom_get_with_http_info(path, parameters = nil, request_options = {}) ⇒ Http::Response
The response.
- #custom_post(path, parameters = nil, body = nil, request_options = {}) ⇒ Object
-
#custom_post_with_http_info(path, parameters = nil, body = nil, request_options = {}) ⇒ Http::Response
The response.
- #custom_put(path, parameters = nil, body = nil, request_options = {}) ⇒ Object
-
#custom_put_with_http_info(path, parameters = nil, body = nil, request_options = {}) ⇒ Http::Response
The response.
-
#delete_agent(agent_id, request_options = {}) ⇒ nil
Delete the specified agent.
-
#delete_agent_conversations(agent_id, start_date = nil, end_date = nil, request_options = {}) ⇒ nil
Deletes the conversations matching the given filers.
-
#delete_agent_conversations_with_http_info(agent_id, start_date = nil, end_date = nil, request_options = {}) ⇒ Http::Response
Deletes the conversations matching the given filers.
-
#delete_agent_with_http_info(agent_id, request_options = {}) ⇒ Http::Response
Delete the specified agent.
-
#delete_allowed_domain(domain_id, agent_id, request_options = {}) ⇒ nil
Remove an allowed domain by id.
-
#delete_allowed_domain_with_http_info(domain_id, agent_id, request_options = {}) ⇒ Http::Response
Remove an allowed domain by id.
-
#delete_conversation(conversation_id, agent_id, request_options = {}) ⇒ nil
Deletes the conversation with the given ID.
-
#delete_conversation_with_http_info(conversation_id, agent_id, request_options = {}) ⇒ Http::Response
Deletes the conversation with the given ID.
-
#delete_provider(provider_id, request_options = {}) ⇒ nil
Delete Provider.
-
#delete_provider_with_http_info(provider_id, request_options = {}) ⇒ Http::Response
Delete Provider.
-
#delete_secret_key(secret_key_id, request_options = {}) ⇒ nil
Delete Secret Key.
-
#delete_secret_key_with_http_info(secret_key_id, request_options = {}) ⇒ Http::Response
Delete Secret Key.
-
#delete_user_data(user_token, request_options = {}) ⇒ nil
Permanently deletes all messages for the given user token.
-
#delete_user_data_with_http_info(user_token, request_options = {}) ⇒ Http::Response
Permanently deletes all messages for the given user token.
-
#export_conversations(agent_id, start_date = nil, end_date = nil, request_options = {}) ⇒ Array<ConversationFullResponse>
Exports all conversations based on the passed filters.
-
#export_conversations_with_http_info(agent_id, start_date = nil, end_date = nil, request_options = {}) ⇒ Http::Response
Exports all conversations based on the passed filters.
-
#forge_secured_user_token(secret_key, secret_key_id, user_id, expires_in = 86400) ⇒ String
Helper: Forges a secured user token (JWT) for Agent Studio authenticated requests.
-
#get_agent(agent_id, request_options = {}) ⇒ AgentWithVersionResponse
Retrieve details of the specified agent.
-
#get_agent_with_http_info(agent_id, request_options = {}) ⇒ Http::Response
Retrieve details of the specified agent.
-
#get_allowed_domain(domain_id, agent_id, request_options = {}) ⇒ AllowedDomainResponse
Get a single allowed domain by id.
-
#get_allowed_domain_with_http_info(domain_id, agent_id, request_options = {}) ⇒ Http::Response
Get a single allowed domain by id.
-
#get_configuration(request_options = {}) ⇒ ApplicationConfigResponse
Get Configuration.
-
#get_configuration_with_http_info(request_options = {}) ⇒ Http::Response
Get Configuration.
-
#get_conversation(conversation_id, agent_id, include_feedback = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ ConversationFullResponse
Retrieves the conversation and its messages for the given ID.
-
#get_conversation_with_http_info(conversation_id, agent_id, include_feedback = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ Http::Response
Retrieves the conversation and its messages for the given ID.
-
#get_provider(provider_id, request_options = {}) ⇒ ProviderAuthenticationResponse
Get Provider.
-
#get_provider_with_http_info(provider_id, request_options = {}) ⇒ Http::Response
Get Provider.
-
#get_secret_key(secret_key_id, request_options = {}) ⇒ SecretKeyResponse
Get Secret Key.
-
#get_secret_key_with_http_info(secret_key_id, request_options = {}) ⇒ Http::Response
Get Secret Key.
-
#get_user_data(user_token, request_options = {}) ⇒ UserDataResponse
Retrieves all memories, conversations and their messages for the given user token.
-
#get_user_data_with_http_info(user_token, request_options = {}) ⇒ Http::Response
Retrieves all memories, conversations and their messages for the given user token.
-
#initialize(config = nil) ⇒ AgentStudioClient
constructor
A new instance of AgentStudioClient.
-
#invalidate_agent_cache(agent_id, before = nil, request_options = {}) ⇒ nil
Invalidate cached completions for this agent.
-
#invalidate_agent_cache_with_http_info(agent_id, before = nil, request_options = {}) ⇒ Http::Response
Invalidate cached completions for this agent.
-
#list_agent_allowed_domains(agent_id, request_options = {}) ⇒ AllowedDomainListResponse
List all allowed domain patterns for this agent.
-
#list_agent_allowed_domains_with_http_info(agent_id, request_options = {}) ⇒ Http::Response
List all allowed domain patterns for this agent.
-
#list_agent_conversations(agent_id, start_date = nil, end_date = nil, include_feedback = nil, feedback_vote = nil, page = nil, limit = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ PaginatedConversationsResponse
Retrieves the conversations for the given agent ID.
-
#list_agent_conversations_with_http_info(agent_id, start_date = nil, end_date = nil, include_feedback = nil, feedback_vote = nil, page = nil, limit = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ Http::Response
Retrieves the conversations for the given agent ID.
-
#list_agents(page = nil, limit = nil, provider_id = nil, request_options = {}) ⇒ PaginatedAgentsResponse
List all agents with pagination and filtering.
-
#list_agents_with_http_info(page = nil, limit = nil, provider_id = nil, request_options = {}) ⇒ Http::Response
List all agents with pagination and filtering.
-
#list_models(request_options = {}) ⇒ Hash<String, Array<String>>
Get Provider Models.
-
#list_models_with_http_info(request_options = {}) ⇒ Http::Response
Get Provider Models.
-
#list_provider_models(provider_id, request_options = {}) ⇒ Array<String>
Get available models for a specific provider.
-
#list_provider_models_with_http_info(provider_id, request_options = {}) ⇒ Http::Response
Get available models for a specific provider.
-
#list_providers(page = nil, limit = nil, request_options = {}) ⇒ PaginatedProviderAuthenticationsResponse
List Providers.
-
#list_providers_with_http_info(page = nil, limit = nil, request_options = {}) ⇒ Http::Response
List Providers.
-
#list_secret_keys(page = nil, limit = nil, request_options = {}) ⇒ PaginatedSecretKeysResponse
List Secret Keys.
-
#list_secret_keys_with_http_info(page = nil, limit = nil, request_options = {}) ⇒ Http::Response
List Secret Keys.
-
#publish_agent(agent_id, request_options = {}) ⇒ AgentWithVersionResponse
Publish the specified agent.
-
#publish_agent_with_http_info(agent_id, request_options = {}) ⇒ Http::Response
Publish the specified agent.
-
#set_client_api_key(api_key) ⇒ void
Helper method to switch the API key used to authenticate the requests.
-
#unpublish_agent(agent_id, request_options = {}) ⇒ AgentWithVersionResponse
Unpublish the specified agent.
-
#unpublish_agent_with_http_info(agent_id, request_options = {}) ⇒ Http::Response
Unpublish the specified agent.
-
#update_agent(agent_id, agent_config_update, request_options = {}) ⇒ AgentWithVersionResponse
Update the specified agent.
-
#update_agent_with_http_info(agent_id, agent_config_update, request_options = {}) ⇒ Http::Response
Update the specified agent.
-
#update_configuration(application_config_patch, request_options = {}) ⇒ ApplicationConfigResponse
Patch Configuration.
-
#update_configuration_with_http_info(application_config_patch, request_options = {}) ⇒ Http::Response
Patch Configuration.
-
#update_provider(provider_id, provider_authentication_patch, request_options = {}) ⇒ ProviderAuthenticationResponse
Update Provider.
-
#update_provider_with_http_info(provider_id, provider_authentication_patch, request_options = {}) ⇒ Http::Response
Update Provider.
-
#update_secret_key(secret_key_id, secret_key_patch, request_options = {}) ⇒ SecretKeyResponse
Patch Secret Key.
-
#update_secret_key_with_http_info(secret_key_id, secret_key_patch, request_options = {}) ⇒ Http::Response
Patch Secret Key.
Constructor Details
#initialize(config = nil) ⇒ AgentStudioClient
Returns a new instance of AgentStudioClient.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/algolia/api/agent_studio_client.rb', line 12 def initialize(config = nil) raise "`config` is missing." if config.nil? raise "`app_id` is missing." if config.app_id.nil? || config.app_id == "" raise "`api_key` is missing." if config.api_key.nil? || config.api_key == "" if config.connect_timeout.nil? config.connect_timeout = 25000 end if config.read_timeout.nil? config.read_timeout = 25000 end if config.write_timeout.nil? config.write_timeout = 25000 end @api_client = Algolia::ApiClient.new(config) warn( "[algolia] Agent Studio API is in beta and subject to breaking changes. See https://www.algolia.com/doc/rest-api/agent-studio" ) end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
10 11 12 |
# File 'lib/algolia/api/agent_studio_client.rb', line 10 def api_client @api_client end |
Class Method Details
.create(app_id, api_key, opts = {}) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/algolia/api/agent_studio_client.rb', line 35 def self.create(app_id, api_key, opts = {}) hosts = [] hosts << Transport::StatefulHost.new("#{app_id}-dsn.algolia.net", accept: CallType::READ) hosts << Transport::StatefulHost.new("#{app_id}.algolia.net", accept: CallType::WRITE) hosts += 1 .upto(3) .map do |i| Transport::StatefulHost.new("#{app_id}-#{i}.algolianet.com", accept: CallType::READ | CallType::WRITE) end .shuffle config = Algolia::Configuration.new(app_id, api_key, hosts, "AgentStudio", opts) new(config) end |
.create_with_config(config) ⇒ Object
51 52 53 |
# File 'lib/algolia/api/agent_studio_client.rb', line 51 def self.create_with_config(config) new(config) end |
Instance Method Details
#add_user_agent_segment(segment, version = nil) ⇒ Object
65 66 67 68 69 |
# File 'lib/algolia/api/agent_studio_client.rb', line 65 def add_user_agent_segment(segment, version = nil) @api_client.config.add_user_agent_segment(segment, version) self end |
#bulk_create_allowed_domains(agent_id, allowed_domain_bulk_insert, request_options = {}) ⇒ AllowedDomainListResponse
Add multiple allowed domain patterns. Duplicates are skipped.
Required API Key ACLs:
- editSettings
126 127 128 129 130 131 132 |
# File 'lib/algolia/api/agent_studio_client.rb', line 126 def bulk_create_allowed_domains(agent_id, allowed_domain_bulk_insert, = {}) response = bulk_create_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_insert, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::AllowedDomainListResponse" ) end |
#bulk_create_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_insert, request_options = {}) ⇒ Http::Response
Add multiple allowed domain patterns. Duplicates are skipped.
Required API Key ACLs:
- editSettings
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/algolia/api/agent_studio_client.rb', line 79 def bulk_create_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_insert, = {}) # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `bulk_create_allowed_domains`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `bulk_create_allowed_domains`." end # verify the required parameter 'allowed_domain_bulk_insert' is set if @api_client.config.client_side_validation && allowed_domain_bulk_insert.nil? raise( ArgumentError, "Parameter `allowed_domain_bulk_insert` is required when calling `bulk_create_allowed_domains`." ) end path = "/agent-studio/1/agents/{agentId}/allowed-domains/bulk".sub( "{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s) ) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] || @api_client.object_to_http_body(allowed_domain_bulk_insert) = .merge( :operation => :"AgentStudioClient.bulk_create_allowed_domains", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:POST, path, ) end |
#bulk_delete_allowed_domains(agent_id, allowed_domain_bulk_delete, request_options = {}) ⇒ nil
Delete allowed domains by id list.
Required API Key ACLs:
- editSettings
189 190 191 192 |
# File 'lib/algolia/api/agent_studio_client.rb', line 189 def bulk_delete_allowed_domains(agent_id, allowed_domain_bulk_delete, = {}) bulk_delete_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_delete, ) nil end |
#bulk_delete_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_delete, request_options = {}) ⇒ Http::Response
Delete allowed domains by id list.
Required API Key ACLs:
- editSettings
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/algolia/api/agent_studio_client.rb', line 142 def bulk_delete_allowed_domains_with_http_info(agent_id, allowed_domain_bulk_delete, = {}) # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `bulk_delete_allowed_domains`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `bulk_delete_allowed_domains`." end # verify the required parameter 'allowed_domain_bulk_delete' is set if @api_client.config.client_side_validation && allowed_domain_bulk_delete.nil? raise( ArgumentError, "Parameter `allowed_domain_bulk_delete` is required when calling `bulk_delete_allowed_domains`." ) end path = "/agent-studio/1/agents/{agentId}/allowed-domains/bulk".sub( "{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s) ) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] || @api_client.object_to_http_body(allowed_domain_bulk_delete) = .merge( :operation => :"AgentStudioClient.bulk_delete_allowed_domains", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:DELETE, path, ) end |
#create_agent(agent_config_create, request_options = {}) ⇒ AgentWithVersionResponse
Create a new agent.
Required API Key ACLs:
- editSettings
233 234 235 236 237 238 239 |
# File 'lib/algolia/api/agent_studio_client.rb', line 233 def create_agent(agent_config_create, = {}) response = create_agent_with_http_info(agent_config_create, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::AgentWithVersionResponse" ) end |
#create_agent_allowed_domain(agent_id, allowed_domain_create, request_options = {}) ⇒ AllowedDomainResponse
Add a single allowed domain pattern (e.g. app.example.com or *.example.com).
Required API Key ACLs:
- editSettings
293 294 295 296 297 298 299 |
# File 'lib/algolia/api/agent_studio_client.rb', line 293 def create_agent_allowed_domain(agent_id, allowed_domain_create, = {}) response = create_agent_allowed_domain_with_http_info(agent_id, allowed_domain_create, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::AllowedDomainResponse" ) end |
#create_agent_allowed_domain_with_http_info(agent_id, allowed_domain_create, request_options = {}) ⇒ Http::Response
Add a single allowed domain pattern (e.g. app.example.com or *.example.com).
Required API Key ACLs:
- editSettings
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/algolia/api/agent_studio_client.rb', line 249 def create_agent_allowed_domain_with_http_info(agent_id, allowed_domain_create, = {}) # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `create_agent_allowed_domain`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `create_agent_allowed_domain`." end # verify the required parameter 'allowed_domain_create' is set if @api_client.config.client_side_validation && allowed_domain_create.nil? raise ArgumentError, "Parameter `allowed_domain_create` is required when calling `create_agent_allowed_domain`." end path = "/agent-studio/1/agents/{agentId}/allowed-domains".sub( "{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s) ) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] || @api_client.object_to_http_body(allowed_domain_create) = .merge( :operation => :"AgentStudioClient.create_agent_allowed_domain", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:POST, path, ) end |
#create_agent_completion(agent_id, compatibility_mode, agent_completion_request, stream = nil, cache = nil, memory = nil, analytics = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ Hash<String, Object>
Create a completion for the specified agent. This endpoint handles two types of requests: 1. Normal completion request: User message -> Agent response 2. Tool approval response: User approval -> Execute tool -> Agent response Tool Approval Flow (for MCP tools with requiresApproval: true): - Request 1: User sends message -> Agent requests tool call -> Return approval request - Request 2: User approves -> Execute tool -> Agent continues with result.
Required API Key ACLs:
- search
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 |
# File 'lib/algolia/api/agent_studio_client.rb', line 388 def create_agent_completion( agent_id, compatibility_mode, agent_completion_request, stream = nil, cache = nil, memory = nil, analytics = nil, x_algolia_secure_user_token = nil, = {} ) response = create_agent_completion_with_http_info( agent_id, compatibility_mode, agent_completion_request, stream, cache, memory, analytics, x_algolia_secure_user_token, ) @api_client.deserialize(response.body, [:debug_return_type] || "Hash<String, Object>") end |
#create_agent_completion_with_http_info(agent_id, compatibility_mode, agent_completion_request, stream = nil, cache = nil, memory = nil, analytics = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ Http::Response
Create a completion for the specified agent. This endpoint handles two types of requests: 1. Normal completion request: User message -> Agent response 2. Tool approval response: User approval -> Execute tool -> Agent response Tool Approval Flow (for MCP tools with requiresApproval: true): - Request 1: User sends message -> Agent requests tool call -> Return approval request - Request 2: User approves -> Execute tool -> Agent continues with result.
Required API Key ACLs:
- search
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
# File 'lib/algolia/api/agent_studio_client.rb', line 315 def create_agent_completion_with_http_info( agent_id, compatibility_mode, agent_completion_request, stream = nil, cache = nil, memory = nil, analytics = nil, x_algolia_secure_user_token = nil, = {} ) # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `create_agent_completion`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `create_agent_completion`." end # verify the required parameter 'compatibility_mode' is set if @api_client.config.client_side_validation && compatibility_mode.nil? raise ArgumentError, "Parameter `compatibility_mode` is required when calling `create_agent_completion`." end # verify the required parameter 'agent_completion_request' is set if @api_client.config.client_side_validation && agent_completion_request.nil? raise ArgumentError, "Parameter `agent_completion_request` is required when calling `create_agent_completion`." end path = "/agent-studio/1/agents/{agentId}/completions".sub( "{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s) ) query_params = {} query_params[:compatibilityMode] = compatibility_mode query_params[:stream] = stream unless stream.nil? query_params[:cache] = cache unless cache.nil? query_params[:memory] = memory unless memory.nil? query_params[:analytics] = analytics unless analytics.nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} unless x_algolia_secure_user_token.nil? header_params[:"X-Algolia-Secure-User-Token"] = x_algolia_secure_user_token end header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] || @api_client.object_to_http_body(agent_completion_request) = .merge( :operation => :"AgentStudioClient.create_agent_completion", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:POST, path, ) end |
#create_agent_with_http_info(agent_config_create, request_options = {}) ⇒ Http::Response
Create a new agent.
Required API Key ACLs:
- editSettings
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
# File 'lib/algolia/api/agent_studio_client.rb', line 201 def create_agent_with_http_info(agent_config_create, = {}) # verify the required parameter 'agent_config_create' is set if @api_client.config.client_side_validation && agent_config_create.nil? raise ArgumentError, "Parameter `agent_config_create` is required when calling `create_agent`." end path = "/agent-studio/1/agents" query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] || @api_client.object_to_http_body(agent_config_create) = .merge( :operation => :"AgentStudioClient.create_agent", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:POST, path, ) end |
#create_feedback(feedback_creation_request, request_options = {}) ⇒ FeedbackResponse
Create new feedback entry.
Required API Key ACLs:
- search
452 453 454 455 |
# File 'lib/algolia/api/agent_studio_client.rb', line 452 def create_feedback(feedback_creation_request, = {}) response = create_feedback_with_http_info(feedback_creation_request, ) @api_client.deserialize(response.body, [:debug_return_type] || "AgentStudio::FeedbackResponse") end |
#create_feedback_with_http_info(feedback_creation_request, request_options = {}) ⇒ Http::Response
Create new feedback entry.
Required API Key ACLs:
- search
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 |
# File 'lib/algolia/api/agent_studio_client.rb', line 420 def create_feedback_with_http_info(feedback_creation_request, = {}) # verify the required parameter 'feedback_creation_request' is set if @api_client.config.client_side_validation && feedback_creation_request.nil? raise ArgumentError, "Parameter `feedback_creation_request` is required when calling `create_feedback`." end path = "/agent-studio/1/feedback" query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] || @api_client.object_to_http_body(feedback_creation_request) = .merge( :operation => :"AgentStudioClient.create_feedback", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:POST, path, ) end |
#create_provider(provider_authentication_create, request_options = {}) ⇒ ProviderAuthenticationResponse
Create Provider.
Required API Key ACLs:
- editSettings
496 497 498 499 500 501 502 |
# File 'lib/algolia/api/agent_studio_client.rb', line 496 def create_provider(provider_authentication_create, = {}) response = create_provider_with_http_info(provider_authentication_create, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::ProviderAuthenticationResponse" ) end |
#create_provider_with_http_info(provider_authentication_create, request_options = {}) ⇒ Http::Response
Create Provider.
Required API Key ACLs:
- editSettings
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 |
# File 'lib/algolia/api/agent_studio_client.rb', line 464 def create_provider_with_http_info(provider_authentication_create, = {}) # verify the required parameter 'provider_authentication_create' is set if @api_client.config.client_side_validation && provider_authentication_create.nil? raise ArgumentError, "Parameter `provider_authentication_create` is required when calling `create_provider`." end path = "/agent-studio/1/providers" query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] || @api_client.object_to_http_body(provider_authentication_create) = .merge( :operation => :"AgentStudioClient.create_provider", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:POST, path, ) end |
#create_secret_key(secret_key_create, request_options = {}) ⇒ SecretKeyResponse
Create Secret Key.
Required API Key ACLs:
- admin
543 544 545 546 |
# File 'lib/algolia/api/agent_studio_client.rb', line 543 def create_secret_key(secret_key_create, = {}) response = create_secret_key_with_http_info(secret_key_create, ) @api_client.deserialize(response.body, [:debug_return_type] || "AgentStudio::SecretKeyResponse") end |
#create_secret_key_with_http_info(secret_key_create, request_options = {}) ⇒ Http::Response
Create Secret Key.
Required API Key ACLs:
- admin
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 |
# File 'lib/algolia/api/agent_studio_client.rb', line 511 def create_secret_key_with_http_info(secret_key_create, = {}) # verify the required parameter 'secret_key_create' is set if @api_client.config.client_side_validation && secret_key_create.nil? raise ArgumentError, "Parameter `secret_key_create` is required when calling `create_secret_key`." end path = "/agent-studio/1/secret-keys" query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] || @api_client.object_to_http_body(secret_key_create) = .merge( :operation => :"AgentStudioClient.create_secret_key", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:POST, path, ) end |
#custom_delete(path, parameters = nil, request_options = {}) ⇒ Object
590 591 592 593 |
# File 'lib/algolia/api/agent_studio_client.rb', line 590 def custom_delete(path, parameters = nil, = {}) response = custom_delete_with_http_info(path, parameters, ) @api_client.deserialize(response.body, [:debug_return_type] || "Object") end |
#custom_delete_with_http_info(path, parameters = nil, request_options = {}) ⇒ Http::Response
Returns the response.
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 |
# File 'lib/algolia/api/agent_studio_client.rb', line 554 def custom_delete_with_http_info(path, parameters = nil, = {}) # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? raise ArgumentError, "Parameter `path` is required when calling `custom_delete`." end # verify the required parameter 'path' is not empty if @api_client.config.client_side_validation && path.empty? raise ArgumentError, "Parameter `path` is required when calling `custom_delete`." end path = "/agent-studio/{path}".sub("{" + "path" + "}", path.to_s) query_params = {} query_params = query_params.merge(parameters) unless parameters.nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.custom_delete", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:DELETE, path, ) end |
#custom_get(path, parameters = nil, request_options = {}) ⇒ Object
637 638 639 640 |
# File 'lib/algolia/api/agent_studio_client.rb', line 637 def custom_get(path, parameters = nil, = {}) response = custom_get_with_http_info(path, parameters, ) @api_client.deserialize(response.body, [:debug_return_type] || "Object") end |
#custom_get_with_http_info(path, parameters = nil, request_options = {}) ⇒ Http::Response
Returns the response.
601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 |
# File 'lib/algolia/api/agent_studio_client.rb', line 601 def custom_get_with_http_info(path, parameters = nil, = {}) # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? raise ArgumentError, "Parameter `path` is required when calling `custom_get`." end # verify the required parameter 'path' is not empty if @api_client.config.client_side_validation && path.empty? raise ArgumentError, "Parameter `path` is required when calling `custom_get`." end path = "/agent-studio/{path}".sub("{" + "path" + "}", path.to_s) query_params = {} query_params = query_params.merge(parameters) unless parameters.nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.custom_get", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#custom_post(path, parameters = nil, body = nil, request_options = {}) ⇒ Object
686 687 688 689 |
# File 'lib/algolia/api/agent_studio_client.rb', line 686 def custom_post(path, parameters = nil, body = nil, = {}) response = custom_post_with_http_info(path, parameters, body, ) @api_client.deserialize(response.body, [:debug_return_type] || "Object") end |
#custom_post_with_http_info(path, parameters = nil, body = nil, request_options = {}) ⇒ Http::Response
Returns the response.
649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 |
# File 'lib/algolia/api/agent_studio_client.rb', line 649 def custom_post_with_http_info(path, parameters = nil, body = nil, = {}) # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? raise ArgumentError, "Parameter `path` is required when calling `custom_post`." end # verify the required parameter 'path' is not empty if @api_client.config.client_side_validation && path.empty? raise ArgumentError, "Parameter `path` is required when calling `custom_post`." end path = "/agent-studio/{path}".sub("{" + "path" + "}", path.to_s) query_params = {} query_params = query_params.merge(parameters) unless parameters.nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] || @api_client.object_to_http_body(body) = .merge( :operation => :"AgentStudioClient.custom_post", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:POST, path, ) end |
#custom_put(path, parameters = nil, body = nil, request_options = {}) ⇒ Object
735 736 737 738 |
# File 'lib/algolia/api/agent_studio_client.rb', line 735 def custom_put(path, parameters = nil, body = nil, = {}) response = custom_put_with_http_info(path, parameters, body, ) @api_client.deserialize(response.body, [:debug_return_type] || "Object") end |
#custom_put_with_http_info(path, parameters = nil, body = nil, request_options = {}) ⇒ Http::Response
Returns the response.
698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 |
# File 'lib/algolia/api/agent_studio_client.rb', line 698 def custom_put_with_http_info(path, parameters = nil, body = nil, = {}) # verify the required parameter 'path' is set if @api_client.config.client_side_validation && path.nil? raise ArgumentError, "Parameter `path` is required when calling `custom_put`." end # verify the required parameter 'path' is not empty if @api_client.config.client_side_validation && path.empty? raise ArgumentError, "Parameter `path` is required when calling `custom_put`." end path = "/agent-studio/{path}".sub("{" + "path" + "}", path.to_s) query_params = {} query_params = query_params.merge(parameters) unless parameters.nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] || @api_client.object_to_http_body(body) = .merge( :operation => :"AgentStudioClient.custom_put", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:PUT, path, ) end |
#delete_agent(agent_id, request_options = {}) ⇒ nil
Delete the specified agent.
Required API Key ACLs:
- editSettings
783 784 785 786 |
# File 'lib/algolia/api/agent_studio_client.rb', line 783 def delete_agent(agent_id, = {}) delete_agent_with_http_info(agent_id, ) nil end |
#delete_agent_conversations(agent_id, start_date = nil, end_date = nil, request_options = {}) ⇒ nil
Deletes the conversations matching the given filers.
Required API Key ACLs:
- logs
840 841 842 843 |
# File 'lib/algolia/api/agent_studio_client.rb', line 840 def delete_agent_conversations(agent_id, start_date = nil, end_date = nil, = {}) delete_agent_conversations_with_http_info(agent_id, start_date, end_date, ) nil end |
#delete_agent_conversations_with_http_info(agent_id, start_date = nil, end_date = nil, request_options = {}) ⇒ Http::Response
Deletes the conversations matching the given filers.
Required API Key ACLs:
- logs
797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 |
# File 'lib/algolia/api/agent_studio_client.rb', line 797 def delete_agent_conversations_with_http_info(agent_id, start_date = nil, end_date = nil, = {}) # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `delete_agent_conversations`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `delete_agent_conversations`." end path = "/agent-studio/1/agents/{agentId}/conversations".sub( "{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s) ) query_params = {} query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.delete_agent_conversations", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:DELETE, path, ) end |
#delete_agent_with_http_info(agent_id, request_options = {}) ⇒ Http::Response
Delete the specified agent.
Required API Key ACLs:
- editSettings
747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 |
# File 'lib/algolia/api/agent_studio_client.rb', line 747 def delete_agent_with_http_info(agent_id, = {}) # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `delete_agent`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `delete_agent`." end path = "/agent-studio/1/agents/{agentId}".sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s)) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.delete_agent", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:DELETE, path, ) end |
#delete_allowed_domain(domain_id, agent_id, request_options = {}) ⇒ nil
Remove an allowed domain by id.
Required API Key ACLs:
- editSettings
900 901 902 903 |
# File 'lib/algolia/api/agent_studio_client.rb', line 900 def delete_allowed_domain(domain_id, agent_id, = {}) delete_allowed_domain_with_http_info(domain_id, agent_id, ) nil end |
#delete_allowed_domain_with_http_info(domain_id, agent_id, request_options = {}) ⇒ Http::Response
Remove an allowed domain by id.
Required API Key ACLs:
- editSettings
853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 |
# File 'lib/algolia/api/agent_studio_client.rb', line 853 def delete_allowed_domain_with_http_info(domain_id, agent_id, = {}) # verify the required parameter 'domain_id' is set if @api_client.config.client_side_validation && domain_id.nil? raise ArgumentError, "Parameter `domain_id` is required when calling `delete_allowed_domain`." end # verify the required parameter 'domain_id' is not empty if @api_client.config.client_side_validation && domain_id.empty? raise ArgumentError, "Parameter `domain_id` is required when calling `delete_allowed_domain`." end # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `delete_allowed_domain`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `delete_allowed_domain`." end path = "/agent-studio/1/agents/{agentId}/allowed-domains/{domainId}" .sub("{" + "domainId" + "}", Transport.encode_uri(domain_id.to_s)) .sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s)) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.delete_allowed_domain", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:DELETE, path, ) end |
#delete_conversation(conversation_id, agent_id, request_options = {}) ⇒ nil
Deletes the conversation with the given ID.
Required API Key ACLs:
- logs
960 961 962 963 |
# File 'lib/algolia/api/agent_studio_client.rb', line 960 def delete_conversation(conversation_id, agent_id, = {}) delete_conversation_with_http_info(conversation_id, agent_id, ) nil end |
#delete_conversation_with_http_info(conversation_id, agent_id, request_options = {}) ⇒ Http::Response
Deletes the conversation with the given ID.
Required API Key ACLs:
- logs
913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 |
# File 'lib/algolia/api/agent_studio_client.rb', line 913 def delete_conversation_with_http_info(conversation_id, agent_id, = {}) # verify the required parameter 'conversation_id' is set if @api_client.config.client_side_validation && conversation_id.nil? raise ArgumentError, "Parameter `conversation_id` is required when calling `delete_conversation`." end # verify the required parameter 'conversation_id' is not empty if @api_client.config.client_side_validation && conversation_id.empty? raise ArgumentError, "Parameter `conversation_id` is required when calling `delete_conversation`." end # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `delete_conversation`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `delete_conversation`." end path = "/agent-studio/1/agents/{agentId}/conversations/{conversationId}" .sub("{" + "conversationId" + "}", Transport.encode_uri(conversation_id.to_s)) .sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s)) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.delete_conversation", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:DELETE, path, ) end |
#delete_provider(provider_id, request_options = {}) ⇒ nil
Delete Provider.
Required API Key ACLs:
- editSettings
1011 1012 1013 1014 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1011 def delete_provider(provider_id, = {}) delete_provider_with_http_info(provider_id, ) nil end |
#delete_provider_with_http_info(provider_id, request_options = {}) ⇒ Http::Response
Delete Provider.
Required API Key ACLs:
- editSettings
972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 |
# File 'lib/algolia/api/agent_studio_client.rb', line 972 def delete_provider_with_http_info(provider_id, = {}) # verify the required parameter 'provider_id' is set if @api_client.config.client_side_validation && provider_id.nil? raise ArgumentError, "Parameter `provider_id` is required when calling `delete_provider`." end # verify the required parameter 'provider_id' is not empty if @api_client.config.client_side_validation && provider_id.empty? raise ArgumentError, "Parameter `provider_id` is required when calling `delete_provider`." end path = "/agent-studio/1/providers/{providerId}".sub( "{" + "providerId" + "}", Transport.encode_uri(provider_id.to_s) ) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.delete_provider", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:DELETE, path, ) end |
#delete_secret_key(secret_key_id, request_options = {}) ⇒ nil
Delete Secret Key.
Required API Key ACLs:
- admin
1062 1063 1064 1065 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1062 def delete_secret_key(secret_key_id, = {}) delete_secret_key_with_http_info(secret_key_id, ) nil end |
#delete_secret_key_with_http_info(secret_key_id, request_options = {}) ⇒ Http::Response
Delete Secret Key.
Required API Key ACLs:
- admin
1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1023 def delete_secret_key_with_http_info(secret_key_id, = {}) # verify the required parameter 'secret_key_id' is set if @api_client.config.client_side_validation && secret_key_id.nil? raise ArgumentError, "Parameter `secret_key_id` is required when calling `delete_secret_key`." end # verify the required parameter 'secret_key_id' is not empty if @api_client.config.client_side_validation && secret_key_id.empty? raise ArgumentError, "Parameter `secret_key_id` is required when calling `delete_secret_key`." end path = "/agent-studio/1/secret-keys/{secretKeyId}".sub( "{" + "secretKeyId" + "}", Transport.encode_uri(secret_key_id.to_s) ) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.delete_secret_key", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:DELETE, path, ) end |
#delete_user_data(user_token, request_options = {}) ⇒ nil
Permanently deletes all messages for the given user token. Does not delete conversations.
Required API Key ACLs:
- logs
1110 1111 1112 1113 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1110 def delete_user_data(user_token, = {}) delete_user_data_with_http_info(user_token, ) nil end |
#delete_user_data_with_http_info(user_token, request_options = {}) ⇒ Http::Response
Permanently deletes all messages for the given user token. Does not delete conversations.
Required API Key ACLs:
- logs
1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1074 def delete_user_data_with_http_info(user_token, = {}) # verify the required parameter 'user_token' is set if @api_client.config.client_side_validation && user_token.nil? raise ArgumentError, "Parameter `user_token` is required when calling `delete_user_data`." end # verify the required parameter 'user_token' is not empty if @api_client.config.client_side_validation && user_token.empty? raise ArgumentError, "Parameter `user_token` is required when calling `delete_user_data`." end path = "/agent-studio/1/user-data/{userToken}".sub("{" + "userToken" + "}", Transport.encode_uri(user_token.to_s)) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.delete_user_data", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:DELETE, path, ) end |
#export_conversations(agent_id, start_date = nil, end_date = nil, request_options = {}) ⇒ Array<ConversationFullResponse>
Exports all conversations based on the passed filters.
Required API Key ACLs:
- logs
1167 1168 1169 1170 1171 1172 1173 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1167 def export_conversations(agent_id, start_date = nil, end_date = nil, = {}) response = export_conversations_with_http_info(agent_id, start_date, end_date, ) @api_client.deserialize( response.body, [:debug_return_type] || "Array<AgentStudio::ConversationFullResponse>" ) end |
#export_conversations_with_http_info(agent_id, start_date = nil, end_date = nil, request_options = {}) ⇒ Http::Response
Exports all conversations based on the passed filters.
Required API Key ACLs:
- logs
1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1124 def export_conversations_with_http_info(agent_id, start_date = nil, end_date = nil, = {}) # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `export_conversations`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `export_conversations`." end path = "/agent-studio/1/agents/{agentId}/conversations/export".sub( "{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s) ) query_params = {} query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.export_conversations", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#forge_secured_user_token(secret_key, secret_key_id, user_id, expires_in = 86400) ⇒ String
Helper: Forges a secured user token (JWT) for Agent Studio authenticated requests.
2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2347 def forge_secured_user_token(secret_key, secret_key_id, user_id, expires_in = 86400) header = Base64.urlsafe_encode64( "{\"alg\":\"HS256\",\"typ\":\"JWT\",\"kid\":\"" + secret_key_id + "\"}", padding: false ) payload = Base64.urlsafe_encode64( "{\"sub\":\"" + user_id + "\",\"exp\":" + (Time.now.to_i + expires_in).to_s + "}", padding: false ) signature = Base64.urlsafe_encode64( OpenSSL::HMAC.digest("SHA256", secret_key, header + "." + payload), padding: false ) header + "." + payload + "." + signature end |
#get_agent(agent_id, request_options = {}) ⇒ AgentWithVersionResponse
Retrieve details of the specified agent.
Required API Key ACLs:
- settings
1218 1219 1220 1221 1222 1223 1224 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1218 def get_agent(agent_id, = {}) response = get_agent_with_http_info(agent_id, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::AgentWithVersionResponse" ) end |
#get_agent_with_http_info(agent_id, request_options = {}) ⇒ Http::Response
Retrieve details of the specified agent.
Required API Key ACLs:
- settings
1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1182 def get_agent_with_http_info(agent_id, = {}) # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `get_agent`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `get_agent`." end path = "/agent-studio/1/agents/{agentId}".sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s)) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.get_agent", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_allowed_domain(domain_id, agent_id, request_options = {}) ⇒ AllowedDomainResponse
Get a single allowed domain by id.
Required API Key ACLs:
- settings
1281 1282 1283 1284 1285 1286 1287 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1281 def get_allowed_domain(domain_id, agent_id, = {}) response = get_allowed_domain_with_http_info(domain_id, agent_id, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::AllowedDomainResponse" ) end |
#get_allowed_domain_with_http_info(domain_id, agent_id, request_options = {}) ⇒ Http::Response
Get a single allowed domain by id.
Required API Key ACLs:
- settings
1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1234 def get_allowed_domain_with_http_info(domain_id, agent_id, = {}) # verify the required parameter 'domain_id' is set if @api_client.config.client_side_validation && domain_id.nil? raise ArgumentError, "Parameter `domain_id` is required when calling `get_allowed_domain`." end # verify the required parameter 'domain_id' is not empty if @api_client.config.client_side_validation && domain_id.empty? raise ArgumentError, "Parameter `domain_id` is required when calling `get_allowed_domain`." end # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `get_allowed_domain`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `get_allowed_domain`." end path = "/agent-studio/1/agents/{agentId}/allowed-domains/{domainId}" .sub("{" + "domainId" + "}", Transport.encode_uri(domain_id.to_s)) .sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s)) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.get_allowed_domain", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_configuration(request_options = {}) ⇒ ApplicationConfigResponse
Get Configuration.
Required API Key ACLs:
- logs
1321 1322 1323 1324 1325 1326 1327 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1321 def get_configuration( = {}) response = get_configuration_with_http_info() @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::ApplicationConfigResponse" ) end |
#get_configuration_with_http_info(request_options = {}) ⇒ Http::Response
Get Configuration.
Required API Key ACLs:
- logs
1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1295 def get_configuration_with_http_info( = {}) path = "/agent-studio/1/configuration" query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.get_configuration", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_conversation(conversation_id, agent_id, include_feedback = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ ConversationFullResponse
Retrieves the conversation and its messages for the given ID.
Required API Key ACLs:
- logs
1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1399 def get_conversation( conversation_id, agent_id, include_feedback = nil, x_algolia_secure_user_token = nil, = {} ) response = get_conversation_with_http_info( conversation_id, agent_id, include_feedback, x_algolia_secure_user_token, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::ConversationFullResponse" ) end |
#get_conversation_with_http_info(conversation_id, agent_id, include_feedback = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ Http::Response
Retrieves the conversation and its messages for the given ID.
Required API Key ACLs:
- logs
1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1339 def get_conversation_with_http_info( conversation_id, agent_id, include_feedback = nil, x_algolia_secure_user_token = nil, = {} ) # verify the required parameter 'conversation_id' is set if @api_client.config.client_side_validation && conversation_id.nil? raise ArgumentError, "Parameter `conversation_id` is required when calling `get_conversation`." end # verify the required parameter 'conversation_id' is not empty if @api_client.config.client_side_validation && conversation_id.empty? raise ArgumentError, "Parameter `conversation_id` is required when calling `get_conversation`." end # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `get_conversation`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `get_conversation`." end path = "/agent-studio/1/agents/{agentId}/conversations/{conversationId}" .sub("{" + "conversationId" + "}", Transport.encode_uri(conversation_id.to_s)) .sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s)) query_params = {} query_params[:includeFeedback] = include_feedback unless include_feedback.nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} unless x_algolia_secure_user_token.nil? header_params[:"X-Algolia-Secure-User-Token"] = x_algolia_secure_user_token end header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.get_conversation", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_provider(provider_id, request_options = {}) ⇒ ProviderAuthenticationResponse
Get Provider.
Required API Key ACLs:
- settings
1465 1466 1467 1468 1469 1470 1471 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1465 def get_provider(provider_id, = {}) response = get_provider_with_http_info(provider_id, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::ProviderAuthenticationResponse" ) end |
#get_provider_with_http_info(provider_id, request_options = {}) ⇒ Http::Response
Get Provider.
Required API Key ACLs:
- settings
1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1426 def get_provider_with_http_info(provider_id, = {}) # verify the required parameter 'provider_id' is set if @api_client.config.client_side_validation && provider_id.nil? raise ArgumentError, "Parameter `provider_id` is required when calling `get_provider`." end # verify the required parameter 'provider_id' is not empty if @api_client.config.client_side_validation && provider_id.empty? raise ArgumentError, "Parameter `provider_id` is required when calling `get_provider`." end path = "/agent-studio/1/providers/{providerId}".sub( "{" + "providerId" + "}", Transport.encode_uri(provider_id.to_s) ) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.get_provider", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_secret_key(secret_key_id, request_options = {}) ⇒ SecretKeyResponse
Get Secret Key.
Required API Key ACLs:
- settings
1519 1520 1521 1522 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1519 def get_secret_key(secret_key_id, = {}) response = get_secret_key_with_http_info(secret_key_id, ) @api_client.deserialize(response.body, [:debug_return_type] || "AgentStudio::SecretKeyResponse") end |
#get_secret_key_with_http_info(secret_key_id, request_options = {}) ⇒ Http::Response
Get Secret Key.
Required API Key ACLs:
- settings
1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1480 def get_secret_key_with_http_info(secret_key_id, = {}) # verify the required parameter 'secret_key_id' is set if @api_client.config.client_side_validation && secret_key_id.nil? raise ArgumentError, "Parameter `secret_key_id` is required when calling `get_secret_key`." end # verify the required parameter 'secret_key_id' is not empty if @api_client.config.client_side_validation && secret_key_id.empty? raise ArgumentError, "Parameter `secret_key_id` is required when calling `get_secret_key`." end path = "/agent-studio/1/secret-keys/{secretKeyId}".sub( "{" + "secretKeyId" + "}", Transport.encode_uri(secret_key_id.to_s) ) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.get_secret_key", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#get_user_data(user_token, request_options = {}) ⇒ UserDataResponse
Retrieves all memories, conversations and their messages for the given user token.
Required API Key ACLs:
- logs
1567 1568 1569 1570 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1567 def get_user_data(user_token, = {}) response = get_user_data_with_http_info(user_token, ) @api_client.deserialize(response.body, [:debug_return_type] || "AgentStudio::UserDataResponse") end |
#get_user_data_with_http_info(user_token, request_options = {}) ⇒ Http::Response
Retrieves all memories, conversations and their messages for the given user token.
Required API Key ACLs:
- logs
1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1531 def get_user_data_with_http_info(user_token, = {}) # verify the required parameter 'user_token' is set if @api_client.config.client_side_validation && user_token.nil? raise ArgumentError, "Parameter `user_token` is required when calling `get_user_data`." end # verify the required parameter 'user_token' is not empty if @api_client.config.client_side_validation && user_token.empty? raise ArgumentError, "Parameter `user_token` is required when calling `get_user_data`." end path = "/agent-studio/1/user-data/{userToken}".sub("{" + "userToken" + "}", Transport.encode_uri(user_token.to_s)) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.get_user_data", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#invalidate_agent_cache(agent_id, before = nil, request_options = {}) ⇒ nil
Invalidate cached completions for this agent. Filter with ‘before` (exclusive).
Required API Key ACLs:
- editSettings
1618 1619 1620 1621 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1618 def invalidate_agent_cache(agent_id, before = nil, = {}) invalidate_agent_cache_with_http_info(agent_id, before, ) nil end |
#invalidate_agent_cache_with_http_info(agent_id, before = nil, request_options = {}) ⇒ Http::Response
Invalidate cached completions for this agent. Filter with ‘before` (exclusive).
Required API Key ACLs:
- editSettings
1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1580 def invalidate_agent_cache_with_http_info(agent_id, before = nil, = {}) # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `invalidate_agent_cache`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `invalidate_agent_cache`." end path = "/agent-studio/1/agents/{agentId}/cache".sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s)) query_params = {} query_params[:before] = before unless before.nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.invalidate_agent_cache", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:DELETE, path, ) end |
#list_agent_allowed_domains(agent_id, request_options = {}) ⇒ AllowedDomainListResponse
List all allowed domain patterns for this agent.
Required API Key ACLs:
- settings
1669 1670 1671 1672 1673 1674 1675 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1669 def list_agent_allowed_domains(agent_id, = {}) response = list_agent_allowed_domains_with_http_info(agent_id, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::AllowedDomainListResponse" ) end |
#list_agent_allowed_domains_with_http_info(agent_id, request_options = {}) ⇒ Http::Response
List all allowed domain patterns for this agent.
Required API Key ACLs:
- settings
1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1630 def list_agent_allowed_domains_with_http_info(agent_id, = {}) # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `list_agent_allowed_domains`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `list_agent_allowed_domains`." end path = "/agent-studio/1/agents/{agentId}/allowed-domains".sub( "{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s) ) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.list_agent_allowed_domains", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#list_agent_conversations(agent_id, start_date = nil, end_date = nil, include_feedback = nil, feedback_vote = nil, page = nil, limit = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ PaginatedConversationsResponse
Retrieves the conversations for the given agent ID.
Required API Key ACLs:
- logs
1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1757 def list_agent_conversations( agent_id, start_date = nil, end_date = nil, include_feedback = nil, feedback_vote = nil, page = nil, limit = nil, x_algolia_secure_user_token = nil, = {} ) response = list_agent_conversations_with_http_info( agent_id, start_date, end_date, include_feedback, feedback_vote, page, limit, x_algolia_secure_user_token, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::PaginatedConversationsResponse" ) end |
#list_agent_conversations_with_http_info(agent_id, start_date = nil, end_date = nil, include_feedback = nil, feedback_vote = nil, page = nil, limit = nil, x_algolia_secure_user_token = nil, request_options = {}) ⇒ Http::Response
Retrieves the conversations for the given agent ID.
Required API Key ACLs:
- logs
1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1691 def list_agent_conversations_with_http_info( agent_id, start_date = nil, end_date = nil, include_feedback = nil, feedback_vote = nil, page = nil, limit = nil, x_algolia_secure_user_token = nil, = {} ) # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `list_agent_conversations`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `list_agent_conversations`." end path = "/agent-studio/1/agents/{agentId}/conversations".sub( "{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s) ) query_params = {} query_params[:startDate] = start_date unless start_date.nil? query_params[:endDate] = end_date unless end_date.nil? query_params[:includeFeedback] = include_feedback unless include_feedback.nil? query_params[:feedbackVote] = feedback_vote unless feedback_vote.nil? query_params[:page] = page unless page.nil? query_params[:limit] = limit unless limit.nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} unless x_algolia_secure_user_token.nil? header_params[:"X-Algolia-Secure-User-Token"] = x_algolia_secure_user_token end header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.list_agent_conversations", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#list_agents(page = nil, limit = nil, provider_id = nil, request_options = {}) ⇒ PaginatedAgentsResponse
List all agents with pagination and filtering.
Required API Key ACLs:
- settings
1826 1827 1828 1829 1830 1831 1832 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1826 def list_agents(page = nil, limit = nil, provider_id = nil, = {}) response = list_agents_with_http_info(page, limit, provider_id, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::PaginatedAgentsResponse" ) end |
#list_agents_with_http_info(page = nil, limit = nil, provider_id = nil, request_options = {}) ⇒ Http::Response
List all agents with pagination and filtering.
Required API Key ACLs:
- settings
1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1794 def list_agents_with_http_info(page = nil, limit = nil, provider_id = nil, = {}) path = "/agent-studio/1/agents" query_params = {} query_params[:page] = page unless page.nil? query_params[:limit] = limit unless limit.nil? query_params[:providerId] = provider_id unless provider_id.nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.list_agents", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#list_models(request_options = {}) ⇒ Hash<String, Array<String>>
Get Provider Models.
Required API Key ACLs:
- settings
1866 1867 1868 1869 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1866 def list_models( = {}) response = list_models_with_http_info() @api_client.deserialize(response.body, [:debug_return_type] || "Hash<String, Array<String>>") end |
#list_models_with_http_info(request_options = {}) ⇒ Http::Response
Get Provider Models.
Required API Key ACLs:
- settings
1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1840 def list_models_with_http_info( = {}) path = "/agent-studio/1/providers/models" query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.list_models", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#list_provider_models(provider_id, request_options = {}) ⇒ Array<String>
Get available models for a specific provider.
Required API Key ACLs:
- settings
1917 1918 1919 1920 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1917 def list_provider_models(provider_id, = {}) response = list_provider_models_with_http_info(provider_id, ) @api_client.deserialize(response.body, [:debug_return_type] || "Array<AgentStudio::>") end |
#list_provider_models_with_http_info(provider_id, request_options = {}) ⇒ Http::Response
Get available models for a specific provider.
Required API Key ACLs:
- settings
1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1878 def list_provider_models_with_http_info(provider_id, = {}) # verify the required parameter 'provider_id' is set if @api_client.config.client_side_validation && provider_id.nil? raise ArgumentError, "Parameter `provider_id` is required when calling `list_provider_models`." end # verify the required parameter 'provider_id' is not empty if @api_client.config.client_side_validation && provider_id.empty? raise ArgumentError, "Parameter `provider_id` is required when calling `list_provider_models`." end path = "/agent-studio/1/providers/{providerId}/models".sub( "{" + "providerId" + "}", Transport.encode_uri(provider_id.to_s) ) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.list_provider_models", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#list_providers(page = nil, limit = nil, request_options = {}) ⇒ PaginatedProviderAuthenticationsResponse
List Providers.
Required API Key ACLs:
- settings
1960 1961 1962 1963 1964 1965 1966 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1960 def list_providers(page = nil, limit = nil, = {}) response = list_providers_with_http_info(page, limit, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::PaginatedProviderAuthenticationsResponse" ) end |
#list_providers_with_http_info(page = nil, limit = nil, request_options = {}) ⇒ Http::Response
List Providers.
Required API Key ACLs:
- settings
1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1930 def list_providers_with_http_info(page = nil, limit = nil, = {}) path = "/agent-studio/1/providers" query_params = {} query_params[:page] = page unless page.nil? query_params[:limit] = limit unless limit.nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.list_providers", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#list_secret_keys(page = nil, limit = nil, request_options = {}) ⇒ PaginatedSecretKeysResponse
List Secret Keys.
Required API Key ACLs:
- settings
2006 2007 2008 2009 2010 2011 2012 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2006 def list_secret_keys(page = nil, limit = nil, = {}) response = list_secret_keys_with_http_info(page, limit, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::PaginatedSecretKeysResponse" ) end |
#list_secret_keys_with_http_info(page = nil, limit = nil, request_options = {}) ⇒ Http::Response
List Secret Keys.
Required API Key ACLs:
- settings
1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1976 def list_secret_keys_with_http_info(page = nil, limit = nil, = {}) path = "/agent-studio/1/secret-keys" query_params = {} query_params[:page] = page unless page.nil? query_params[:limit] = limit unless limit.nil? query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.list_secret_keys", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:GET, path, ) end |
#publish_agent(agent_id, request_options = {}) ⇒ AgentWithVersionResponse
Publish the specified agent.
Required API Key ACLs:
- editSettings
2057 2058 2059 2060 2061 2062 2063 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2057 def publish_agent(agent_id, = {}) response = publish_agent_with_http_info(agent_id, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::AgentWithVersionResponse" ) end |
#publish_agent_with_http_info(agent_id, request_options = {}) ⇒ Http::Response
Publish the specified agent.
Required API Key ACLs:
- editSettings
2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2021 def publish_agent_with_http_info(agent_id, = {}) # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `publish_agent`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `publish_agent`." end path = "/agent-studio/1/agents/{agentId}/publish".sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s)) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.publish_agent", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:POST, path, ) end |
#set_client_api_key(api_key) ⇒ void
This method returns an undefined value.
Helper method to switch the API key used to authenticate the requests.
59 60 61 62 63 |
# File 'lib/algolia/api/agent_studio_client.rb', line 59 def set_client_api_key(api_key) @api_client.set_client_api_key(api_key) self end |
#unpublish_agent(agent_id, request_options = {}) ⇒ AgentWithVersionResponse
Unpublish the specified agent.
Required API Key ACLs:
- editSettings
2111 2112 2113 2114 2115 2116 2117 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2111 def unpublish_agent(agent_id, = {}) response = unpublish_agent_with_http_info(agent_id, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::AgentWithVersionResponse" ) end |
#unpublish_agent_with_http_info(agent_id, request_options = {}) ⇒ Http::Response
Unpublish the specified agent.
Required API Key ACLs:
- editSettings
2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2072 def unpublish_agent_with_http_info(agent_id, = {}) # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `unpublish_agent`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `unpublish_agent`." end path = "/agent-studio/1/agents/{agentId}/unpublish".sub( "{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s) ) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] = .merge( :operation => :"AgentStudioClient.unpublish_agent", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:POST, path, ) end |
#update_agent(agent_id, agent_config_update, request_options = {}) ⇒ AgentWithVersionResponse
Update the specified agent.
Required API Key ACLs:
- editSettings
2168 2169 2170 2171 2172 2173 2174 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2168 def update_agent(agent_id, agent_config_update, = {}) response = update_agent_with_http_info(agent_id, agent_config_update, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::AgentWithVersionResponse" ) end |
#update_agent_with_http_info(agent_id, agent_config_update, request_options = {}) ⇒ Http::Response
Update the specified agent.
Required API Key ACLs:
- editSettings
2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2127 def update_agent_with_http_info(agent_id, agent_config_update, = {}) # verify the required parameter 'agent_id' is set if @api_client.config.client_side_validation && agent_id.nil? raise ArgumentError, "Parameter `agent_id` is required when calling `update_agent`." end # verify the required parameter 'agent_id' is not empty if @api_client.config.client_side_validation && agent_id.empty? raise ArgumentError, "Parameter `agent_id` is required when calling `update_agent`." end # verify the required parameter 'agent_config_update' is set if @api_client.config.client_side_validation && agent_config_update.nil? raise ArgumentError, "Parameter `agent_config_update` is required when calling `update_agent`." end path = "/agent-studio/1/agents/{agentId}".sub("{" + "agentId" + "}", Transport.encode_uri(agent_id.to_s)) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] || @api_client.object_to_http_body(agent_config_update) = .merge( :operation => :"AgentStudioClient.update_agent", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:PATCH, path, ) end |
#update_configuration(application_config_patch, request_options = {}) ⇒ ApplicationConfigResponse
Patch Configuration.
Required API Key ACLs:
- logs
2215 2216 2217 2218 2219 2220 2221 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2215 def update_configuration(application_config_patch, = {}) response = update_configuration_with_http_info(application_config_patch, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::ApplicationConfigResponse" ) end |
#update_configuration_with_http_info(application_config_patch, request_options = {}) ⇒ Http::Response
Patch Configuration.
Required API Key ACLs:
- logs
2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2183 def update_configuration_with_http_info(application_config_patch, = {}) # verify the required parameter 'application_config_patch' is set if @api_client.config.client_side_validation && application_config_patch.nil? raise ArgumentError, "Parameter `application_config_patch` is required when calling `update_configuration`." end path = "/agent-studio/1/configuration" query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] || @api_client.object_to_http_body(application_config_patch) = .merge( :operation => :"AgentStudioClient.update_configuration", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:PATCH, path, ) end |
#update_provider(provider_id, provider_authentication_patch, request_options = {}) ⇒ ProviderAuthenticationResponse
Update Provider.
Required API Key ACLs:
- editSettings
2275 2276 2277 2278 2279 2280 2281 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2275 def update_provider(provider_id, provider_authentication_patch, = {}) response = update_provider_with_http_info(provider_id, provider_authentication_patch, ) @api_client.deserialize( response.body, [:debug_return_type] || "AgentStudio::ProviderAuthenticationResponse" ) end |
#update_provider_with_http_info(provider_id, provider_authentication_patch, request_options = {}) ⇒ Http::Response
Update Provider.
Required API Key ACLs:
- editSettings
2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2231 def update_provider_with_http_info(provider_id, provider_authentication_patch, = {}) # verify the required parameter 'provider_id' is set if @api_client.config.client_side_validation && provider_id.nil? raise ArgumentError, "Parameter `provider_id` is required when calling `update_provider`." end # verify the required parameter 'provider_id' is not empty if @api_client.config.client_side_validation && provider_id.empty? raise ArgumentError, "Parameter `provider_id` is required when calling `update_provider`." end # verify the required parameter 'provider_authentication_patch' is set if @api_client.config.client_side_validation && provider_authentication_patch.nil? raise ArgumentError, "Parameter `provider_authentication_patch` is required when calling `update_provider`." end path = "/agent-studio/1/providers/{providerId}".sub( "{" + "providerId" + "}", Transport.encode_uri(provider_id.to_s) ) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] || @api_client.object_to_http_body(provider_authentication_patch) = .merge( :operation => :"AgentStudioClient.update_provider", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:PATCH, path, ) end |
#update_secret_key(secret_key_id, secret_key_patch, request_options = {}) ⇒ SecretKeyResponse
Patch Secret Key.
Required API Key ACLs:
- admin
2335 2336 2337 2338 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2335 def update_secret_key(secret_key_id, secret_key_patch, = {}) response = update_secret_key_with_http_info(secret_key_id, secret_key_patch, ) @api_client.deserialize(response.body, [:debug_return_type] || "AgentStudio::SecretKeyResponse") end |
#update_secret_key_with_http_info(secret_key_id, secret_key_patch, request_options = {}) ⇒ Http::Response
Patch Secret Key.
Required API Key ACLs:
- admin
2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2291 def update_secret_key_with_http_info(secret_key_id, secret_key_patch, = {}) # verify the required parameter 'secret_key_id' is set if @api_client.config.client_side_validation && secret_key_id.nil? raise ArgumentError, "Parameter `secret_key_id` is required when calling `update_secret_key`." end # verify the required parameter 'secret_key_id' is not empty if @api_client.config.client_side_validation && secret_key_id.empty? raise ArgumentError, "Parameter `secret_key_id` is required when calling `update_secret_key`." end # verify the required parameter 'secret_key_patch' is set if @api_client.config.client_side_validation && secret_key_patch.nil? raise ArgumentError, "Parameter `secret_key_patch` is required when calling `update_secret_key`." end path = "/agent-studio/1/secret-keys/{secretKeyId}".sub( "{" + "secretKeyId" + "}", Transport.encode_uri(secret_key_id.to_s) ) query_params = {} query_params = query_params.merge([:query_params]) unless [:query_params].nil? header_params = {} header_params = header_params.merge([:header_params]) unless [:header_params].nil? post_body = [:debug_body] || @api_client.object_to_http_body(secret_key_patch) = .merge( :operation => :"AgentStudioClient.update_secret_key", :header_params => header_params, :query_params => query_params, :body => post_body, :use_read_transporter => false ) @api_client.call_api(:PATCH, path, ) end |