File size: 1,022 Bytes
328a7cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from smolagents import Tool
from typing import Any, Optional

class SimpleTool(Tool):
    name = "suggest_room"
    description = "suggest room based on subject."
    inputs = {'subject': {'type': 'string', 'description': 'The type of subject for a college computer science student.'}}
    output_type = "string"

    def forward(self, subject: str) -> str:
        """

        suggest room based on subject.

        Args:

            subject: The type of subject for a college computer science student.

        """
        if subject == "Computer security":
            return "library and Pst1"

        elif subject == "Software Engineering":
            return "software lab"
        elif subject == "Database ":
            return "Microprocessor lab"
        elif subject == "Computer Ethics":
            return "Kilimo hall, Pst5"
        elif subject == "Computer Networking":
            return "Microprocessor Lab"
        else:
            return "You can just use your Hostel buddy"