(
self,
model: Optional[BaseModelBackend] = None,
task_type: TaskType = TaskType.AI_SOCIETY,
task_specify_prompt: Optional[Union[str, TextPrompt]] = None,
word_limit: int = DEFAULT_WORD_LIMIT,
output_language: Optional[str] = None,
)
| 58 | DEFAULT_WORD_LIMIT = 50 |
| 59 | |
| 60 | def __init__( |
| 61 | self, |
| 62 | model: Optional[BaseModelBackend] = None, |
| 63 | task_type: TaskType = TaskType.AI_SOCIETY, |
| 64 | task_specify_prompt: Optional[Union[str, TextPrompt]] = None, |
| 65 | word_limit: int = DEFAULT_WORD_LIMIT, |
| 66 | output_language: Optional[str] = None, |
| 67 | ) -> None: |
| 68 | self.task_specify_prompt: Union[str, TextPrompt] |
| 69 | if task_specify_prompt is None: |
| 70 | task_specify_prompt_template = ( |
| 71 | PromptTemplateGenerator().get_task_specify_prompt(task_type) |
| 72 | ) |
| 73 | |
| 74 | self.task_specify_prompt = task_specify_prompt_template.format( |
| 75 | word_limit=word_limit |
| 76 | ) |
| 77 | else: |
| 78 | self.task_specify_prompt = TextPrompt(task_specify_prompt) |
| 79 | |
| 80 | system_message = BaseMessage( |
| 81 | role_name="Task Specifier", |
| 82 | role_type=RoleType.ASSISTANT, |
| 83 | meta_dict=None, |
| 84 | content="You can make a task more specific.", |
| 85 | ) |
| 86 | |
| 87 | super().__init__( |
| 88 | system_message, |
| 89 | model=model, |
| 90 | output_language=output_language, |
| 91 | ) |
| 92 | |
| 93 | def run( |
| 94 | self, |
no test coverage detected