Skip to content

Handler

RAGHandler

Source code in Agent/modules/rag/handler.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
class RAGHandler:
    def __init__(self):
        pass

    def handle_task(self, task: Task) -> Task:
        """
        Handle the task
        Args:
            task:

        Returns:

        """
        result_profile = {}
        latency_profile = {}
        TimeLogger.log_task(task, "start_rag")
        # NOTE: this is a placeholder for the actual implementation
        result_profile["text"] = "This is a placeholder for the actual implementation"
        task.result_status = ResultStatus.completed.value
        task.result_json.result_profile.update(result_profile)
        task.result_json.latency_profile.update(latency_profile)
        TimeLogger.log_task(task, "end_rag")
        return task

handle_task(task)

Handle the task Args: task:

Returns:

Source code in Agent/modules/rag/handler.py
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def handle_task(self, task: Task) -> Task:
    """
    Handle the task
    Args:
        task:

    Returns:

    """
    result_profile = {}
    latency_profile = {}
    TimeLogger.log_task(task, "start_rag")
    # NOTE: this is a placeholder for the actual implementation
    result_profile["text"] = "This is a placeholder for the actual implementation"
    task.result_status = ResultStatus.completed.value
    task.result_json.result_profile.update(result_profile)
    task.result_json.latency_profile.update(latency_profile)
    TimeLogger.log_task(task, "end_rag")
    return task