(
self,
objective: Union[str, TextPrompt],
model: Optional[BaseModelBackend] = None,
output_language: Optional[str] = None,
message_window_size: Optional[int] = None,
)
| 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}. |
| 347 | Consider the ultimate objective of you: {objective}. |
| 348 | Tasks should be sorted from highest to lowest priority, where higher-priority \ |
| 349 | tasks are those that act as pre-requisites or are more essential for meeting \ |
| 350 | the objective. Return one task per line in your response. |
| 351 | Do not remove or modify any tasks. |
| 352 | The result must be a numbered list in the format: |
| 353 | |
| 354 | #. First task |
| 355 | #. Second task |
| 356 | |
| 357 | The entries must be consecutively numbered, starting with 1. |
| 358 | The number of each entry must be followed by a period. |
| 359 | Do not include any headers before your ranked list or follow your list \ |
| 360 | with 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, |
nothing calls this directly
no test coverage detected