INNER CODE UNIT · Python

solve_task

OSU-NLP-Group/ScienceAgentBench · agent.py:205

    def solve_task(self, task, out_fname):
        # Clean history
        self.history = []

        self.sys_msg = self.get_sys_msg(task)

        user_input = [
            {'role': 'user', 'content': self.sys_msg}
        ]

        assistant_output, prompt_tokens, completion_tokens = self.llm_engine.respond(user_input, temperature=0.2, top_p=0.95)

        cost = (
            self.llm_cost["input_cost_per_token"] * prompt_tokens +
            self.llm_cost["output_cost_per_token"] * completion_tokens
        )

        self.write_program(assistant_output, out_fname)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…