MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / __init__

Method __init__

camel/agents/task_agent.py:338–380  ·  view source on GitHub ↗
(
        self,
        objective: Union[str, TextPrompt],
        model: Optional[BaseModelBackend] = None,
        output_language: Optional[str] = None,
        message_window_size: Optional[int] = None,
    )

Source from the content-addressed store, hash-verified

336 """
337
338 def __init__(
339 self,
340 objective: Union[str, TextPrompt],
341 model: Optional[BaseModelBackend] = None,
342 output_language: Optional[str] = None,
343 message_window_size: Optional[int] = None,
344 ) -> None:
345 task_prioritization_prompt = TextPrompt(
346 """Prioritize the following tasks : {task_list}.
347Consider the ultimate objective of you: {objective}.
348Tasks should be sorted from highest to lowest priority, where higher-priority \
349tasks are those that act as pre-requisites or are more essential for meeting \
350the objective. Return one task per line in your response.
351Do not remove or modify any tasks.
352The result must be a numbered list in the format:
353
354 #. First task
355 #. Second task
356
357The entries must be consecutively numbered, starting with 1.
358The number of each entry must be followed by a period.
359Do not include any headers before your ranked list or follow your list \
360with any other output."""
361 )
362
363 self.task_prioritization_prompt = task_prioritization_prompt.format(
364 objective=objective
365 )
366 self.objective = objective
367
368 system_message = BaseMessage(
369 role_name="Task Prioritizer",
370 role_type=RoleType.ASSISTANT,
371 meta_dict=None,
372 content="You are a helpful task prioritizer.",
373 )
374
375 super().__init__(
376 system_message,
377 model=model,
378 output_language=output_language,
379 message_window_size=message_window_size,
380 )
381
382 def run(
383 self,

Callers

nothing calls this directly

Calls 4

formatMethod · 0.95
TextPromptClass · 0.90
BaseMessageClass · 0.90
__init__Method · 0.45

Tested by

no test coverage detected