File size: 3,377 Bytes
3d648f2
910ae58
 
4fb4269
3d648f2
4fb4269
 
910ae58
 
 
 
4fb4269
f49023b
910ae58
 
 
 
 
 
4fb4269
f49023b
910ae58
 
 
 
 
 
4fb4269
58afc3a
910ae58
 
 
 
 
 
4fb4269
f49023b
910ae58
 
 
 
 
 
4fb4269
 
 
 
 
 
 
f49023b
910ae58
3d648f2
 
 
 
 
 
910ae58
4fb4269
910ae58
4fb4269
910ae58
4fb4269
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f49023b
4fb4269
 
58afc3a
 
 
 
 
 
 
 
98ada6c
910ae58
 
 
4fb4269
58afc3a
910ae58
 
98ada6c
910ae58
98ada6c
910ae58
4fb4269
58afc3a
 
 
 
 
 
 
 
 
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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
72
73
74
75
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
from typing import List
from args import Args
from itf_agent import IAgent
from toolbox import Toolbox
import datetime


class Manager(IAgent):
    """
    Orchestrates the workflow by delegating tasks to specialized nodes and integrating their outputs
    """
    def __init__(self):
        super().__init__("01_manager.txt", Args.PRIMARY_AGENT_PRESET)


class Auditor(IAgent):
    """
    Reviews manager's outputs for accuracy, safety, and quality
    """
    def __init__(self):
        super().__init__("02_auditor.txt", Args.PRIMARY_AGENT_PRESET)


class Summarizer(IAgent):
    """
    Generates concise summaries of conversations or passages.
    """
    def __init__(self):
        super().__init__("03_summarizer.txt", Args.SECONDARY_AGENT_PRESET)


class Solver(IAgent):
    """
    Central problem-solving node that coordinates with specialized experts based on task requirements
    """
    def __init__(self):
        super().__init__("04_solver.txt", Args.PRIMARY_AGENT_PRESET)


class Researcher(IAgent):
    """
    Retrieves and synthesizes information from various sources to answer knowledge-based questions
    """
    def __init__(self):
        toolbox = Toolbox.web_search
        tools = [
            toolbox.duckduckgo_text_search,
            toolbox.duckduckgo_images_search,
            toolbox.duckduckgo_videos_search
            ]
        super().__init__("05_researcher.txt", Args.PRIMARY_AGENT_PRESET, tools)

    def query(self, messages: List[str]) -> str:
        last_message = messages[-1]
        current_time = datetime.datetime.now().isoformat()
        messages[-1] = f"Current time: {current_time}\n" + last_message
        return super().query(messages)


class Reasoner(IAgent):
    """
    Performs logical reasoning, inference, and step-by-step problem-solving
    """
    def __init__(self):
        math_toolbox = Toolbox.math
        encryption_toolbox = Toolbox.encryption
        tools = [
            math_toolbox.symbolic_calc,
            math_toolbox.unit_converter,
            encryption_toolbox.ascii_decode,
            encryption_toolbox.ascii_encode,
            encryption_toolbox.base64_decode,
            encryption_toolbox.base64_encode,
            encryption_toolbox.caesar_cipher_decode,
            encryption_toolbox.caesar_cipher_encode,
            encryption_toolbox.caesar_cipher_brute_force,
            encryption_toolbox.reverse_string
            ]
        super().__init__("06_reasoner.txt", Args.PRIMARY_AGENT_PRESET, tools)


class HyperReasoner(IAgent):
    """
    Performs logical reasoning, inference, and step-by-step problem-solving
    """
    def __init__(self):
        super().__init__("07_hyper_reasoner.txt", Args.PRIMARY_AGENT_PRESET)


class Viewer(IAgent):
    """
    Processes, analyzes, and generates information related to images
    """
    def __init__(self):
        super().__init__("08_viewer.txt", Args.VISION_AGENT_PRESET)


class OutputGuard(IAgent):
    """
    Performs logical reasoning, inference, and step-by-step problem-solving
    """
    def __init__(self):
        super().__init__("09_output_guard.txt", Args.SECONDARY_AGENT_PRESET)


class FinalAnswer(IAgent):
    """
    Performs logical reasoning, inference, and step-by-step problem-solving
    """
    def __init__(self):
        super().__init__("10_final_answer.txt", Args.PRIMARY_AGENT_PRESET)