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 |
# 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) 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
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/algolia/api/agent_studio_client.rb', line 32 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
48 49 50 |
# File 'lib/algolia/api/agent_studio_client.rb', line 48 def self.create_with_config(config) new(config) end |
Instance Method Details
#add_user_agent_segment(segment, version = nil) ⇒ Object
62 63 64 65 66 |
# File 'lib/algolia/api/agent_studio_client.rb', line 62 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
123 124 125 126 127 128 129 |
# File 'lib/algolia/api/agent_studio_client.rb', line 123 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
76 77 78 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 76 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
186 187 188 189 |
# File 'lib/algolia/api/agent_studio_client.rb', line 186 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
139 140 141 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 139 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
230 231 232 233 234 235 236 |
# File 'lib/algolia/api/agent_studio_client.rb', line 230 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
290 291 292 293 294 295 296 |
# File 'lib/algolia/api/agent_studio_client.rb', line 290 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
246 247 248 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 246 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
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 |
# File 'lib/algolia/api/agent_studio_client.rb', line 385 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
312 313 314 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 312 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
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/algolia/api/agent_studio_client.rb', line 198 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
449 450 451 452 |
# File 'lib/algolia/api/agent_studio_client.rb', line 449 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
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 |
# File 'lib/algolia/api/agent_studio_client.rb', line 417 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
493 494 495 496 497 498 499 |
# File 'lib/algolia/api/agent_studio_client.rb', line 493 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
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 |
# File 'lib/algolia/api/agent_studio_client.rb', line 461 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
540 541 542 543 |
# File 'lib/algolia/api/agent_studio_client.rb', line 540 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
508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 |
# File 'lib/algolia/api/agent_studio_client.rb', line 508 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
587 588 589 590 |
# File 'lib/algolia/api/agent_studio_client.rb', line 587 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.
551 552 553 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 551 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
634 635 636 637 |
# File 'lib/algolia/api/agent_studio_client.rb', line 634 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.
598 599 600 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 598 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
683 684 685 686 |
# File 'lib/algolia/api/agent_studio_client.rb', line 683 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.
646 647 648 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 646 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
732 733 734 735 |
# File 'lib/algolia/api/agent_studio_client.rb', line 732 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.
695 696 697 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 695 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
780 781 782 783 |
# File 'lib/algolia/api/agent_studio_client.rb', line 780 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
837 838 839 840 |
# File 'lib/algolia/api/agent_studio_client.rb', line 837 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
794 795 796 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 794 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
744 745 746 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 744 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
897 898 899 900 |
# File 'lib/algolia/api/agent_studio_client.rb', line 897 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
850 851 852 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 850 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
957 958 959 960 |
# File 'lib/algolia/api/agent_studio_client.rb', line 957 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
910 911 912 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 910 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
1008 1009 1010 1011 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1008 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
969 970 971 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 969 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
1059 1060 1061 1062 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1059 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
1020 1021 1022 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1020 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
1107 1108 1109 1110 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1107 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
1071 1072 1073 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1071 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
1164 1165 1166 1167 1168 1169 1170 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1164 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
1121 1122 1123 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1121 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.
2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2344 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
1215 1216 1217 1218 1219 1220 1221 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1215 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
1179 1180 1181 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1179 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
1278 1279 1280 1281 1282 1283 1284 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1278 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
1231 1232 1233 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1231 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
1318 1319 1320 1321 1322 1323 1324 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1318 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
1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1292 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
1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1396 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
1336 1337 1338 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1336 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
1462 1463 1464 1465 1466 1467 1468 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1462 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
1423 1424 1425 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1423 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
1516 1517 1518 1519 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1516 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
1477 1478 1479 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1477 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
1564 1565 1566 1567 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1564 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
1528 1529 1530 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1528 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
1615 1616 1617 1618 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1615 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
1577 1578 1579 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1577 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
1666 1667 1668 1669 1670 1671 1672 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1666 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
1627 1628 1629 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1627 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
1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1754 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
1688 1689 1690 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1688 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
1823 1824 1825 1826 1827 1828 1829 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1823 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
1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1791 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
1863 1864 1865 1866 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1863 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
1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1837 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
1914 1915 1916 1917 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1914 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
1875 1876 1877 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1875 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
1957 1958 1959 1960 1961 1962 1963 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1957 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
1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1927 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
2003 2004 2005 2006 2007 2008 2009 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2003 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
1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 |
# File 'lib/algolia/api/agent_studio_client.rb', line 1973 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
2054 2055 2056 2057 2058 2059 2060 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2054 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
2018 2019 2020 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2018 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.
56 57 58 59 60 |
# File 'lib/algolia/api/agent_studio_client.rb', line 56 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
2108 2109 2110 2111 2112 2113 2114 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2108 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
2069 2070 2071 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2069 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
2165 2166 2167 2168 2169 2170 2171 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2165 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
2124 2125 2126 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2124 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
2212 2213 2214 2215 2216 2217 2218 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2212 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
2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2180 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
2272 2273 2274 2275 2276 2277 2278 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2272 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
2228 2229 2230 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2228 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
2332 2333 2334 2335 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2332 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
2288 2289 2290 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 |
# File 'lib/algolia/api/agent_studio_client.rb', line 2288 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 |