async def _reason(
        self,
        query: str,
        *args,
        **kwargs,
    ) -> dict[str, Any]:
        """Execute a reasoning query using a specialized reasoning LLM."""
        msg_list = await self.conversation.get_messages()

        # Create a specialized generation config for reasoning
        gen_cfg = self.get_generation_config(msg_list[-1], stream=False)
        gen_cfg.model = self.app_config.reasoning_llm
        gen_cfg.top_p = None
        gen_cfg.temperature = 0.1
        gen_cfg.max_tokens_to_sample = 64000
        gen_cfg.stream = False
        gen_cfg.tools = None
        gen_cfg.functions = None
        gen_cfg.reasoning_effort = "high"
        gen_cfg.add_generation_kwargs = None

        # Call the LLM with the reasoning request
        response = await self.llm_provider.aget_completion(
            [{"role": "user", "content": query}], gen_cfg
        )
        return response.choices[0].message.content
Execute a reasoning query using a specialized reasoning LLM.
py/core/agent/research.py