Skip to content

Main

main_function(id)

Main function to determine the action and response.

Parameters:

Name Type Description Default
id int

The id of the user.

required

Returns:

Name Type Description
tuple

A tuple containing the action and response.

Examples:

>>> main_function(1)
('Talk', 'What can I do for you?')
Source code in backend/Multi-Sensory Virtual AAGI/main.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
def main_function(id):
    """
    Main function to determine the action and response.
    Args:
      id (int): The id of the user.
    Returns:
      tuple: A tuple containing the action and response.
    Examples:
      >>> main_function(1)
      ('Talk', 'What can I do for you?')
    """
    check_values_function()
    action = determine_task_talk_function()
    print("Action is " + action)
    if action == "Talk":
        response = talk_function(id)
        print(response)
        return action, response

    well_defined_task = create_task_function()
    print("Task is " + well_defined_task)
    update_task_list_function(well_defined_task, id)
    response = start_task_message_function(well_defined_task)
    print(response)
    return action, response