def _validate_chat_with_tools_response(
        self,
        response: ChatResponse,
        tools: List["BaseTool"],
        allow_parallel_tool_calls: bool = False,
        **kwargs: Any,
    ) -> ChatResponse:
        """
        Validate the response from chat_with_tools.

        Args:
            response (ChatResponse): The chat response to validate.
            tools (List[BaseTool]): A list of tools used.
            allow_parallel_tool_calls (bool): Whether parallel tool calls are allowed.
            **kwargs: Additional keyword arguments.

        Returns:
            ChatResponse: The validated chat response.

        """
        if not allow_parallel_tool_calls:
            # Ensures that the 'tool_calls' in the response contain only a single tool call.
            tool_calls = response.message.additional_kwargs.get("tool_calls", [])
            if len(tool_calls) > 1:
                logger.warning(
                    "Multiple tool calls detected but parallel tool calls are not allowed. "
                    "Limiting to the first tool call."
                )
                response.message.additional_kwargs["tool_calls"] = [tool_calls[0]]
        return response

        Validate the response from chat_with_tools.

        Args:
            response (ChatResponse): The chat response to validate.
            tools (List[BaseTool]): A list of tools used.
            allow_parallel_tool_calls (bool): Whether parallel tool calls are allowed.
            **kwargs: Additional keyword arguments.

        Returns:
            ChatResponse: The validated chat response.

        
llama-index-integrations/llms/llama-index-llms-oci-data-science/llama_index/llms/oci_data_science/base.py