Services

Here we present all the services used to communicate with the other microservices of the system.

By default, in the settings.ini is described every address of the other microservices

These are the main methods of this class:

services.discover_intent(agent, text)

This method connects to the microservice NLP Engine in order to retrieve the intents from a raw text.

Parameters:
  • agent – The agent name of the chatbot
  • text – The raw input to discover the intent
Returns:

The uri of a intent

services.discover_entities(agent, text)

This method connects to the microservice NLP Engine in order to retrieve the entities from a raw text.

Parameters:
  • agent – The agent name of the chatbot
  • text – The raw input to discover the intent
Returns:

A list with the URIS of the entities and type of entities.

services.get_requirements(intent)

This service connects to the microservice Intents Managment in order to retrieve requirements of an intent

Parameters:intent – The intent from where requirements will be retrieved
Returns:A list of URIS of the different entities needed to complete an intent
services.get_options(entity)

This service connects to the microservice Intents Management in order to retrieve options of an entity type

Parameters:entity – The entity from where options will be retrieved
Returns:A list of options to complete an entity

Todo

give a list of entities

services.get_answer(intent, entities)

This service connects to the microservice Intents Management in order to retrieve the answer of an intent.

Parameters:
  • intent – The intent from where answer will be retrieved
  • entities – A list of entities used to retrieve answer
Returns:

A list of options to complete an entity

services.find_in_context(user, entities)
This method looks for information in the conversation thread.
param user:The id of the user to find information
param entities:The entities to be found in context.
services.get_agent_data(agent)

This service connects to the microservice Intents Management in order to information about and agent

Parameters:agent – A valid agent name
Returns:A dict containing agent, a description and the different intents.
services.get_intent_rq(intent, entity)

This service connects to the microservice Intents Management in order to get the resolution question of an intent

Parameters:
  • intent – A valid intent
  • entity – A valid entity
Returns:

A dict containing intent, a entity and the resolution question.