from typing import List, Any, Dict
import uuid
class AgentTask:
def __init__(self,
task_id: str = None,
prompt: str = None,
file_path: str = None,
expectation: str = None,
ground_truth: Any = None,
conversation_history: List[Dict] = None
):
if task_id is None:
self.task_id = str(uuid.uuid4())
else:
self.task_id = task_id
self.prompt = prompt
if file_path is not None:
self.file_path = file_path
if ground_truth is not None:
self.expectation = ground_truth
else:
self.expectation = expectation
if self.expectation is not None:
self.task_type = "evaluation"
else:
self.task_type = "sampling"
if conversation_history is not None:
self.conversation_history = conversation_history
elif prompt is not None:
self.conversation_history = [
{
"role": "user",
"content": prompt
}
]
else:
self.conversation_history = []
class GAIATasks:
def __init__(self,
tasks: List[AgentTask] = None,
):
self.tasks = tasks