(self,
model: str,
endpoints: str,
api_key: str,
consume_token_path: Optional[str] = None)
| 561 | self.agent_chat_history = add_response("assistant", response_prefix, self.agent_chat_history) |
| 562 | |
| 563 | def solve_task(self, |
| 564 | model: str, |
| 565 | endpoints: str, |
| 566 | api_key: str, |
| 567 | consume_token_path: Optional[str] = None) -> None: |
| 568 | global CURRENT_STEP |
| 569 | |
| 570 | # solve task |
| 571 | subtask_solve_prefix = f'Now, based on the following details and your specific role, generate your answer for solving the subtask:\nUser Query: {self.optimize_user_prompt}\nTask Type: {self.task_type}\nCore Intent: {self.core_intent}\nKey Details: {self.key_details}\nCurrent Subtask: {self.current_subtask}' |
| 572 | |
| 573 | self.agent_chat_history = add_response("user", subtask_solve_prefix, self.agent_chat_history) |
| 574 | |
| 575 | task_solve_response = inference_chat(self.agent_chat_history, model, endpoints, api_key, consume_token_path) |
| 576 | self.agent_chat_history = add_response("assistant", task_solve_response, self.agent_chat_history) |
| 577 | |
| 578 | CURRENT_STEP += 1 |
| 579 | self.logger.info(f'{DELIMITER}step {CURRENT_STEP}: the agent role of {self.agent_role} for solving subtask{DELIMITER}') |
| 580 | self.logger.info(f"{self.agent_role} responses: {task_solve_response}") |
| 581 | self.answer = task_solve_response |
| 582 | |
| 583 | |
| 584 | class MCTSAgentSelector(object): |
no test coverage detected