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

Method __init__

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

Source from the content-addressed store, hash-verified

226 """
227
228 def __init__(
229 self,
230 role_name: str,
231 objective: Union[str, TextPrompt],
232 model: Optional[BaseModelBackend] = None,
233 output_language: Optional[str] = None,
234 message_window_size: Optional[int] = None,
235 max_task_num: Optional[int] = 3,
236 ) -> None:
237 task_creation_prompt = TextPrompt(
238 """Create new a task with the following objective: {objective}.
239Never forget you are a Task Creator of {role_name}.
240You must instruct me based on my expertise and your needs to solve the task.
241You should consider past solved tasks and in-progress tasks: {task_list}.
242The new created tasks must not overlap with these past tasks.
243The result must be a numbered list in the format:
244
245 #. First Task
246 #. Second Task
247 #. Third Task
248
249You can only give me up to {max_task_num} tasks at a time. \
250Each task should be concise, concrete and doable for a {role_name}.
251You should make task plan and not ask me questions.
252If you think no new tasks are needed right now, write "No tasks to add."
253Now start to give me new tasks one by one. No more than three tasks.
254Be concrete.
255"""
256 )
257
258 self.task_creation_prompt = task_creation_prompt.format(
259 objective=objective, role_name=role_name, max_task_num=max_task_num
260 )
261 self.objective = objective
262
263 system_message = BaseMessage(
264 role_name="Task Creator",
265 role_type=RoleType.ASSISTANT,
266 meta_dict=None,
267 content="You are a helpful task creator.",
268 )
269
270 super().__init__(
271 system_message,
272 model=model,
273 output_language=output_language,
274 message_window_size=message_window_size,
275 )
276
277 def run(
278 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