Skip to content

API Reference - Main Package#

Init file for Intentional's sample tools.

EndConversationTool #

Bases: Tool

Tool to end the conversation. This tool must be handled by each model client. TODO

Source code in intentional/sample_tools.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class EndConversationTool(Tool):
    """
    Tool to end the conversation. This tool must be handled by each model client. TODO
    """

    name = "end_conversation"
    description = "End the conversation."
    parameters = []

    async def run(self, _) -> str:
        """
        Ends the conversation.
        """
        return "The conversation has ended."

run(_) async #

Ends the conversation.

Source code in intentional/sample_tools.py
20
21
22
23
24
async def run(self, _) -> str:
    """
    Ends the conversation.
    """
    return "The conversation has ended."

GetCurrentDateTimeTool #

Bases: Tool

Simple tool to get the current date and time.

Source code in intentional/sample_tools.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
class GetCurrentDateTimeTool(Tool):
    """
    Simple tool to get the current date and time.
    """

    name = "get_current_date_and_time"
    description = "Get the current date and time in the format 'YYYY-MM-DD HH:MM:SS'."
    parameters = []

    async def run(self, _) -> str:
        """
        Returns the current time.
        """
        return datetime.now().strftime("%Y-%m-%d %H:%M:%S")

run(_) async #

Returns the current time.

Source code in intentional/sample_tools.py
36
37
38
39
40
async def run(self, _) -> str:
    """
    Returns the current time.
    """
    return datetime.now().strftime("%Y-%m-%d %H:%M:%S")

RescheduleInterviewTool #

Bases: Tool

Mock tool to reschedule an interview.

Source code in intentional/sample_tools.py
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
class RescheduleInterviewTool(Tool):
    """
    Mock tool to reschedule an interview.
    """

    name = "reschedule_interview"
    description = "Set a new date and time for the interview in the database."
    parameters = [
        ToolParameter(
            "date",
            "The new date for the interview.",
            "string",
            True,
            None,
        ),
        ToolParameter(
            "time",
            "The new time for the interview.",
            "string",
            True,
            None,
        ),
    ]

    async def run(self, _) -> str:
        """
        Returns the current time.
        """
        return "The interview was rescheduled successfully."

run(_) async #

Returns the current time.

Source code in intentional/sample_tools.py
67
68
69
70
71
async def run(self, _) -> str:
    """
    Returns the current time.
    """
    return "The interview was rescheduled successfully."

__about__ #

Package descriptors for intentional.

cli #

Entry point for the Intentional CLI.

main() #

Entry point for the Intentional CLI.

Source code in intentional/cli.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
def main():
    """
    Entry point for the Intentional CLI.
    """
    parser = argparse.ArgumentParser()
    parser.add_argument("path", help="the path to the configuration file to load.", type=str)
    parser.add_argument("--log-level", help="Select the logging level.", type=str)
    args = parser.parse_args()

    if args.log_level:
        level = logging.getLevelName(args.log_level.upper())
        logging.basicConfig(level=level)

    bot = load_configuration_file(args.path)
    asyncio.run(bot.run())

sample_tools #

Sample tools for Intentional's examples.

EndConversationTool #

Bases: Tool

Tool to end the conversation. This tool must be handled by each model client. TODO

Source code in intentional/sample_tools.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class EndConversationTool(Tool):
    """
    Tool to end the conversation. This tool must be handled by each model client. TODO
    """

    name = "end_conversation"
    description = "End the conversation."
    parameters = []

    async def run(self, _) -> str:
        """
        Ends the conversation.
        """
        return "The conversation has ended."

run(_) async #

Ends the conversation.

Source code in intentional/sample_tools.py
20
21
22
23
24
async def run(self, _) -> str:
    """
    Ends the conversation.
    """
    return "The conversation has ended."

GetCurrentDateTimeTool #

Bases: Tool

Simple tool to get the current date and time.

Source code in intentional/sample_tools.py
27
28
29
30
31
32
33
34
35
36
37
38
39
40
class GetCurrentDateTimeTool(Tool):
    """
    Simple tool to get the current date and time.
    """

    name = "get_current_date_and_time"
    description = "Get the current date and time in the format 'YYYY-MM-DD HH:MM:SS'."
    parameters = []

    async def run(self, _) -> str:
        """
        Returns the current time.
        """
        return datetime.now().strftime("%Y-%m-%d %H:%M:%S")

run(_) async #

Returns the current time.

Source code in intentional/sample_tools.py
36
37
38
39
40
async def run(self, _) -> str:
    """
    Returns the current time.
    """
    return datetime.now().strftime("%Y-%m-%d %H:%M:%S")

RescheduleInterviewTool #

Bases: Tool

Mock tool to reschedule an interview.

Source code in intentional/sample_tools.py
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
class RescheduleInterviewTool(Tool):
    """
    Mock tool to reschedule an interview.
    """

    name = "reschedule_interview"
    description = "Set a new date and time for the interview in the database."
    parameters = [
        ToolParameter(
            "date",
            "The new date for the interview.",
            "string",
            True,
            None,
        ),
        ToolParameter(
            "time",
            "The new time for the interview.",
            "string",
            True,
            None,
        ),
    ]

    async def run(self, _) -> str:
        """
        Returns the current time.
        """
        return "The interview was rescheduled successfully."

run(_) async #

Returns the current time.

Source code in intentional/sample_tools.py
67
68
69
70
71
async def run(self, _) -> str:
    """
    Returns the current time.
    """
    return "The interview was rescheduled successfully."